A branch cut before a release merges green and breaks main's changelog check #87

Merged
city-root merged 1 commit from worker/rexcity-dpnj3 into main 2026-11-12 13:24:39 +00:00
Contributor

Closes the gap rexcity-dpnj3 describes: CI checked a pull request's head, not its merge with main, so a branch cut before a release and merged after it could be green and still break main's changelog check (release-entry-modified, seen on rexcity#66).

Of the three options the bead listed, the user took fragments (#83). They keep a pull request that follows the rules out of CHANGELOG.md. This adds option 2 on top, for a branch that still edits it: the changelog job merges the base branch into the checkout on pull_request before the validate action. A checkout that is already the merge is left as it is, and a branch that does not merge cleanly fails the job with "rebase it". The required check keeps its name. README says so in the changelog paragraph.

How I checked it: in a scratch repo, with changelog v2.0.1 built from the module cache, a branch that adds a bullet under the section a later release froze gives 0 release-entry-modified findings on its head and 1 on the merge of main into it; a second merge is "Already up to date". yq parses the workflow, go vet ./... is clean. I could not run the Forgejo job itself.

No fragment: a change to CI and docs alone carries no note (REVIEW.md), and missing-fragment only warns.

Not done: option 1 (branch protection that refuses a branch behind main) is the repository owner's setting.

Bead: rexcity-dpnj3

Closes the gap rexcity-dpnj3 describes: CI checked a pull request's head, not its merge with main, so a branch cut before a release and merged after it could be green and still break main's changelog check (`release-entry-modified`, seen on rexcity#66). Of the three options the bead listed, the user took fragments (#83). They keep a pull request that follows the rules out of `CHANGELOG.md`. This adds option 2 on top, for a branch that still edits it: the `changelog` job merges the base branch into the checkout on `pull_request` before the validate action. A checkout that is already the merge is left as it is, and a branch that does not merge cleanly fails the job with "rebase it". The required check keeps its name. README says so in the changelog paragraph. How I checked it: in a scratch repo, with changelog v2.0.1 built from the module cache, a branch that adds a bullet under the section a later release froze gives 0 `release-entry-modified` findings on its head and 1 on the merge of main into it; a second merge is "Already up to date". `yq` parses the workflow, `go vet ./...` is clean. I could not run the Forgejo job itself. No fragment: a change to CI and docs alone carries no note (REVIEW.md), and `missing-fragment` only warns. Not done: option 1 (branch protection that refuses a branch behind main) is the repository owner's setting. Bead: rexcity-dpnj3
ci: check a pull request's changelog as merged into its base (rexcity-dpnj3)
All checks were successful
image / image (pull_request) Successful in 3s
test / changelog (pull_request) Successful in 6s
test / go (pull_request) Successful in 1m46s
c4a5e36f7e
A branch cut before a release and merged after it can be green on its own head and still break main: git merges it cleanly, but its CHANGELOG.md lines land in an entry the release froze, and the checker then fails release-entry-modified on main. CI checked the head commit, never the merge result (seen on rexcity#66).

The changelog job now merges the base branch into the checkout on pull_request events before the validate action runs, so it checks what main would become. If the forge's checkout already is the merge, the merge is a no-op; a branch that does not merge cleanly fails the job with a message to rebase it. Changelog fragments (#83) already keep compliant pull requests out of CHANGELOG.md; this closes the case of a branch that still edits it.

Validation: reproduced in a scratch repo with changelog v2.0.1 built from the module cache. A branch that appends a bullet to the section a later release froze passes on its head (0 release-entry-modified findings) and fails on the merge of main into it (1 finding); a second merge is 'Already up to date'. Workflow YAML parses (yq), go vet is clean. No fragment: a change to CI and docs alone carries no note (REVIEW.md).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
city-root-review left a comment

Review of c4a5e36f7e for rexcity-dpnj3. Checks of the head: success.

Verdict

pass

Findings

None that block, and no minor ones on this diff.

Outside this pull request, for whoever wants it: on main's code (this PR changes no Go), go test -race ./... fails TestAWordOfMegabytesIsCutAtTheWidthInLinearTime/thinking/chunk_32768 at internal/acpbox/pane_test.go:610 (2.49s against a 1s bound). The race detector slows the code, and CI does not run -race. The plain go test ./... passes.

Verified

  • The requirement: rexcity-dpnj3 lists three options. The PR body says the user took fragments (#83, on main) and that this adds option 2 for a branch that still edits CHANGELOG.md. Option 1 is a forge setting and is correctly left out. The PR has a description.
  • The diff: .forgejo/workflows/test.yaml. On pull_request only, a step before the validate action fetches refs/heads/$BASE_REF and merges origin/$BASE_REF into the checkout. A conflict fails the job with "rebase it". github.base_ref reaches the shell through env and is quoted, so it cannot inject a command. The job name and the required check test / changelog are unchanged. README.md, changelog paragraph: two lines that match what the step does.
  • Interaction with the validate action (changelog v2.0.1 actions/validate/action.yml): the tag-dependent checks compare against the newest tag reachable from HEAD, so only after the merge does a frozen section get compared with its release. missing-fragment takes the merge base with base, which is the base tip after the merge, so it still sees only the PR's own changes.
  • Conventions (REVIEW.md of main): a CI and docs change carries no fragment, and the missing-fragment warning is not a finding. REVIEW.md is not changed. main has no AGENTS.md or CLAUDE.md.
  • The merge result: the head is on top of origin/main (83bb714), so the merge is a clean fast-forward. Forge says mergeable.
  • The head's CI: run 1791, go and changelog both success. The changelog job's log shows the new step ran. Its anonymous fetch worked and printed "Already up to date.". Then validate ran, with only the missing-fragment warning.
  • Run on the merged tree with the city's variables removed: go vet ./... and GOOS=darwin GOARCH=arm64 go vet ./... are clean. go test ./... passes. yq parses the workflow. changelog v2.0.1, built from the module cache and run with -base=main -warn=missing-fragment: valid=true, missing-fragment warning only.
  • The bead's own scenario, reproduced on the real history. A branch from e626804 (before Release 0.33.0) adds a bullet under [Unreleased] / ### Fixed:
    • On the head, the checker gives valid=true.
    • The step's merge of origin/main is clean.
    • On the merge, the checker gives CHANGELOG.md:14: error: the notes under version 0.33.0 differ from the ones released at tag v0.33.0 (release-entry-modified), valid=false.
      So the step catches exactly the gap rexcity#66 showed.
Review of c4a5e36f7e0583f6503dd3eb79e12227c5be2eae for rexcity-dpnj3. Checks of the head: success. ### Verdict pass ### Findings None that block, and no minor ones on this diff. Outside this pull request, for whoever wants it: on main's code (this PR changes no Go), `go test -race ./...` fails `TestAWordOfMegabytesIsCutAtTheWidthInLinearTime/thinking/chunk_32768` at `internal/acpbox/pane_test.go:610` (2.49s against a 1s bound). The race detector slows the code, and CI does not run `-race`. The plain `go test ./...` passes. ### Verified - The requirement: rexcity-dpnj3 lists three options. The PR body says the user took fragments (#83, on main) and that this adds option 2 for a branch that still edits `CHANGELOG.md`. Option 1 is a forge setting and is correctly left out. The PR has a description. - The diff: `.forgejo/workflows/test.yaml`. On `pull_request` only, a step before the validate action fetches `refs/heads/$BASE_REF` and merges `origin/$BASE_REF` into the checkout. A conflict fails the job with "rebase it". `github.base_ref` reaches the shell through `env` and is quoted, so it cannot inject a command. The job name and the required check `test / changelog` are unchanged. `README.md`, changelog paragraph: two lines that match what the step does. - Interaction with the validate action (changelog v2.0.1 `actions/validate/action.yml`): the tag-dependent checks compare against the newest tag reachable from HEAD, so only after the merge does a frozen section get compared with its release. `missing-fragment` takes the merge base with `base`, which is the base tip after the merge, so it still sees only the PR's own changes. - Conventions (REVIEW.md of main): a CI and docs change carries no fragment, and the `missing-fragment` warning is not a finding. REVIEW.md is not changed. main has no AGENTS.md or CLAUDE.md. - The merge result: the head is on top of `origin/main` (83bb714), so the merge is a clean fast-forward. Forge says `mergeable`. - The head's CI: run 1791, `go` and `changelog` both success. The changelog job's log shows the new step ran. Its anonymous fetch worked and printed "Already up to date.". Then validate ran, with only the `missing-fragment` warning. - Run on the merged tree with the city's variables removed: `go vet ./...` and `GOOS=darwin GOARCH=arm64 go vet ./...` are clean. `go test ./...` passes. `yq` parses the workflow. changelog v2.0.1, built from the module cache and run with `-base=main -warn=missing-fragment`: valid=true, missing-fragment warning only. - The bead's own scenario, reproduced on the real history. A branch from e626804 (before Release 0.33.0) adds a bullet under `[Unreleased]` / `### Fixed`: - On the head, the checker gives valid=true. - The step's merge of `origin/main` is clean. - On the merge, the checker gives `CHANGELOG.md:14: error: the notes under version 0.33.0 differ from the ones released at tag v0.33.0 (release-entry-modified)`, valid=false. So the step catches exactly the gap rexcity#66 showed.
Commenting is not possible because the repository is archived.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
mikluko/rexcity!87
No description provided.