Commit 0e0467dd authored by xuwang's avatar xuwang
Browse files

fix(agentic): keep Closes and Changelog in separate paragraphs so trailers parse



The integrator built its squash-merge message with `Closes #N` on the line
directly above `Changelog:`, putting both in one final paragraph. `Closes #N` is
a GitLab keyword, not a colon-trailer, so git/GitLab stop recognizing the block
as trailers and silently drop the `Changelog:` entry from CHANGELOG.md — verified
with `git interpret-trailers --parse`. This is a likely cause of fixes going
missing from release notes.

Separate them with a blank line in the integrator's merge message, add a verify
step, harden the resolver's caveat (its `-m`-per-paragraph form was already
correct), and make the mr-reviewer's changelog dimension FAIL when a
consumer-facing commit's trailer does not actually parse (not just when the text
is absent).

Internal-only change to agent instructions (not consumer-facing), so no
Changelog trailer per CONTRIBUTING.md.

Co-Authored-By: default avatarClaude Opus 4.8 <noreply@anthropic.com>
parent 571167fc
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -23,7 +23,12 @@ Steps:
     fail-fast on missing vars, naming (`<platform>-<action>.sh` / `*.mk`), include
     guards. (rules in CLAUDE.md)
   - **changelog** — consumer-facing commits carry a correct `Changelog:` trailer
     (`added`/`fixed`/`changed`/`breaking`); `make validate` would pass.
     (`added`/`fixed`/`changed`/`breaking`); `make validate` would pass. Verify the
     trailer actually **parses**, not just that the text is present: for each commit
     on the branch, `git show -s --format='%(trailers:key=Changelog,valueonly)' <sha>`
     must be non-empty. A `Closes #N` line sharing the final paragraph with
     `Changelog:` silently breaks parsing — FAIL if a consumer-facing commit's
     trailer doesn't parse.
3. Optionally run `make validate` if your dimension needs it (conventions/correctness).

Return EXACTLY:
+9 −1
Original line number Diff line number Diff line
@@ -43,7 +43,15 @@ If any gate fails and isn't just "pipeline still running", leave a note and stop
Merge so the squash commit carries the `Changelog:` trailer (the repo generates
`CHANGELOG.md` from these). Derive the type from the MR:
```
scripts/gl-flow.sh mr-merge <iid> --message "$(printf '%s\n\nCloses #<linked_iid>\nChangelog: <added|fixed|changed|breaking>' '<mr title>')"
scripts/gl-flow.sh mr-merge <iid> --message "$(printf '%s\n\nCloses #<linked_iid>\n\nChangelog: <added|fixed|changed|breaking>' '<mr title>')"
```
**Trailer format is load-bearing — keep `Changelog:` in its own final paragraph.**
`Closes #<iid>` is a GitLab keyword, not a colon-trailer; if it sits on the line
directly above `Changelog:` (one block), git/GitLab stop recognizing the block as
trailers and the entry is silently dropped from `CHANGELOG.md`. Note the **blank
line** (`\n\n`) between them above. Verify before merging — the trailer must echo back:
```
printf '%s\n\nCloses #<id>\n\nChangelog: fixed' '<mr title>' | git interpret-trailers --parse
```
This merges into `main` on **origin** (code.stanford.edu). The med mirror updates
itself on the next sync (~5 min) — never push there yourself.
+6 −1
Original line number Diff line number Diff line
@@ -93,7 +93,12 @@ and convention violations in your working-tree change.
  ```
  git commit -m "fix: <summary>" -m "Closes #<iid>" -m "Changelog: fixed"
  ```
  Use `added`/`fixed`/`changed`/`breaking` to match the change.
  Use `added`/`fixed`/`changed`/`breaking` to match the change. Keep each `-m` a
  **separate paragraph**`Closes #<iid>` is a GitLab keyword, not a colon-trailer,
  so it must NOT share a paragraph with `Changelog:` or the trailer fails to parse
  and the entry is dropped from `CHANGELOG.md`. Confirm it parses:
  `git show -s --format='%(trailers:key=Changelog,valueonly)' HEAD` (must be non-empty).
  Internal-only commits (refactors, test tweaks) may omit the trailer per CONTRIBUTING.md.
- After committing, `git show --stat HEAD` and verify **no unintended files** slipped in.
- Push **only to origin** (code.stanford.edu). **Never push to the med mirror**
  it is overwritten to match code: `git push -u origin agent/issue-<iid>`.