Take changelog notes as fragments in .changelog/, on changelog v2 #52

Merged
city-root merged 1 commit from worker/gascitypacks-c7j into main 2026-11-12 12:30:02 +00:00
Contributor

Notes a change as a fragment in .changelog/ instead of a line under [Unreleased], so parallel pull requests stop colliding in CHANGELOG.md, and moves CI to version 2 of the changelog tool (v2.0.1, which carries the linked-worktree fix).

What changed

  • test / changelog (job name unchanged, so the required check of main still matches) and the release workflow's validate step run https://sarak.sh/mikluko/changelog/actions/validate@v2.
  • What v2 checks that v1 did not: missing-fragment (a pull request adds a fragment, or a note the changelog lacked at the merge base), fragment-form (each file in .changelog/ is a fragment) and fragments-release (the fragments would release without a finding). The format checks of CHANGELOG.md are v1's. CHANGELOG.md already conforms: v2.0.1 reports nothing on it.
  • This pull request notes itself as .changelog/changelog-fragments.md; it does not touch CHANGELOG.md.
  • .gitignore had .* with an exception for .forgejo only, which hid .changelog/ from git add; it gets !.changelog.
  • README "Releases": how a note is written, how to run the checker locally, how a version is cut, what the release pull request holds, what the release workflow does.
  • The reviewer formula (it serves other repositories) says the note of a change is "as the repository's own rules ask: an entry in its changelog, or a fragment file".

How a release is cut now
go run sarak.sh/mikluko/changelog/v2/cmd/changelog@latest release on a branch from main folds the fragments into [Unreleased], deletes them, renames [Unreleased] to the computed version (or -version), dated today UTC (or -date), and opens an empty [Unreleased]. The release pull request holds CHANGELOG.md and the deleted fragments. On merge the release workflow, unchanged in logic (it runs on a push to main that changes CHANGELOG.md), tags vX.Y.Z and creates the Forgejo release. A pull request that adds only a fragment does not touch CHANGELOG.md, so it starts no release.

Verified

  • v2.0.1's checker in this linked worktree, -base main: reports missing-fragment without the fragment, nothing with it.
  • Scratch copy of this changelog plus this fragment: release computes 0.7.0, folds the fragment into the existing [Unreleased] note, deletes the file; the release branch passes the checker (-base main), so a release pull request is not failed for adding no fragment.
  • gc lint . and tests/reviewer.sh pass. Nothing run against the forge's runner: the first CI run of this pull request is the first with v2.

For the Operator

  • Pull requests of this repository open before this merges and carrying a line under [Unreleased] will fail missing-fragment and need their note moved to a fragment.
  • The @v2 tag of the action moves with v2.x releases, as @v1 did.

Bead: gascitypacks-c7j

Notes a change as a fragment in `.changelog/` instead of a line under `[Unreleased]`, so parallel pull requests stop colliding in `CHANGELOG.md`, and moves CI to version 2 of the changelog tool (v2.0.1, which carries the linked-worktree fix). **What changed** - `test / changelog` (job name unchanged, so the required check of `main` still matches) and the `release` workflow's validate step run `https://sarak.sh/mikluko/changelog/actions/validate@v2`. - What v2 checks that v1 did not: `missing-fragment` (a pull request adds a fragment, or a note the changelog lacked at the merge base), `fragment-form` (each file in `.changelog/` is a fragment) and `fragments-release` (the fragments would release without a finding). The format checks of `CHANGELOG.md` are v1's. `CHANGELOG.md` already conforms: v2.0.1 reports nothing on it. - This pull request notes itself as `.changelog/changelog-fragments.md`; it does not touch `CHANGELOG.md`. - `.gitignore` had `.*` with an exception for `.forgejo` only, which hid `.changelog/` from `git add`; it gets `!.changelog`. - README "Releases": how a note is written, how to run the checker locally, how a version is cut, what the release pull request holds, what the release workflow does. - The reviewer formula (it serves other repositories) says the note of a change is "as the repository's own rules ask: an entry in its changelog, or a fragment file". **How a release is cut now** `go run sarak.sh/mikluko/changelog/v2/cmd/changelog@latest release` on a branch from `main` folds the fragments into `[Unreleased]`, deletes them, renames `[Unreleased]` to the computed version (or `-version`), dated today UTC (or `-date`), and opens an empty `[Unreleased]`. The release pull request holds `CHANGELOG.md` and the deleted fragments. On merge the `release` workflow, unchanged in logic (it runs on a push to `main` that changes `CHANGELOG.md`), tags `vX.Y.Z` and creates the Forgejo release. A pull request that adds only a fragment does not touch `CHANGELOG.md`, so it starts no release. **Verified** - v2.0.1's checker in this linked worktree, `-base main`: reports `missing-fragment` without the fragment, nothing with it. - Scratch copy of this changelog plus this fragment: `release` computes 0.7.0, folds the fragment into the existing `[Unreleased]` note, deletes the file; the release branch passes the checker (`-base main`), so a release pull request is not failed for adding no fragment. - `gc lint .` and `tests/reviewer.sh` pass. Nothing run against the forge's runner: the first CI run of this pull request is the first with v2. **For the Operator** - Pull requests of this repository open before this merges and carrying a line under `[Unreleased]` will fail `missing-fragment` and need their note moved to a fragment. - The `@v2` tag of the action moves with v2.x releases, as `@v1` did. Bead: gascitypacks-c7j
feat: note a change as a fragment in .changelog/, on changelog v2 (gascitypacks-c7j)
All checks were successful
test / changelog (pull_request) Successful in 5s
test / lint (pull_request) Successful in 21s
test / scripts (pull_request) Successful in 33s
2e1b5bc13f
Pull requests that run in parallel each added a line under [Unreleased] in CHANGELOG.md and collided there: four pull requests cost a rebase round within an hour on 2026-11-12. Version 2 of the changelog tool lets each change carry its note as a file of its own in .changelog/.

The test workflow's `changelog` job and the release workflow's validate step now run actions/validate@v2 (job and workflow names are unchanged, so main's required checks still match). v2 adds missing-fragment, fragment-form and fragments-release to the format checks of v1. A release is `changelog release`, run on a branch: it folds the fragments into CHANGELOG.md, deletes them and writes the version section; the release workflow still tags the push that brings that section, and a push that only adds a fragment does not touch CHANGELOG.md, so it starts nothing. The README's "Releases" section says how, and the reviewer formula (which serves other repositories) says "as the repository's own rules ask".

.gitignore had `.*` with an exception for .forgejo only, which hid .changelog/ from git add; it gets the same exception. CHANGELOG.md already conformed to v2: the checker reports nothing on it but missing-fragment for a branch with no fragment.

Validation: v2.0.1 of the checker run in this linked worktree (the fix for it is in 2.0.1) reports nothing with the fragment present and missing-fragment without it; a scratch copy of the changelog released with the fragment gives 0.7.0, folds the fragment into the existing [Unreleased] note, deletes it, and the release branch then passes the checker with -base main; gc lint . and tests/reviewer.sh pass.

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

Review of 2e1b5bc13f for gascitypacks-c7j. Checks of the head: success.

Verdict

pass

Findings

  • [minor] README.md:490: "A change with nothing notable gets no fragment, and then test / changelog fails the pull request with missing-fragment" describes a dead end and says nothing about how to get past it. Version 1 let through a pull request with no changelog line; version 2 fails every pull request that carries no note, including test-only or docs-only ones. Say outright that every pull request needs a fragment (or what such a change should write), or set missing-fragment to a warning in test.yaml if that is the intent.
  • [minor] forgejo/formulas/mol-forgejo-review.toml:188: "with -base the pull request's target branch where its workflow gives the action one". This repository's workflow gives the action no base: the action takes it from github.base_ref by default. A Reviewer who follows the text literally runs the checker without -base, and missing-fragment then says nothing. Something like "with -base the pull request's target branch, unless the workflow sets fragments empty or turns missing-fragment off" matches what CI does.

Verified

  • Read the work bead, the PR description and the whole diff (6 files). The target has no REVIEW.md, AGENTS.md or CLAUDE.md. Nothing else in the repository speaks of a changelog entry (searched roles/, forgejo/, docs/, README). The job name changelog of workflow test is unchanged, so the required check keeps its name.
  • Merge into origin/main (50455b6): a clean fast-forward. The forge reports mergeable.
  • Changelog checker built from the action's tagged source (v2 = v2.0.1 = c19d67d) and run in a clean env on the merged tree: -base main valid with no finding; without -base (a push to main) valid; with the fragment removed it fails with missing-fragment (exit 1).
  • changelog release in a throwaway worktree: computes 0.7.0, folds the fragment into the existing [Unreleased] note, deletes the file. The committed release branch passes -base main with due=true, so a release PR is not failed for adding no fragment.
  • release.yaml: still triggers only on pushes to main that change CHANGELOG.md or the workflow itself. The due, version and notes outputs it reads exist in v2's actions/validate.
  • .gitignore !.changelog makes the fragment directory trackable.
  • In a clean env (city variables removed, throwaway HOME): gc lint . (2 packs ok), tests/formula.sh, tests/reviewer.sh, go vet, go test and go test -race of forgejo/, and every script of the scripts job (worktree-setup, worktree, gnu-tools, merge, apply, upgrade, view-beads, view-mail, permission-deny, permission-request): all pass.
Review of 2e1b5bc13f50c8e18fbdcbbf91383ff615647cda for gascitypacks-c7j. Checks of the head: success. ### Verdict pass ### Findings - [minor] README.md:490: "A change with nothing notable gets no fragment, and then `test / changelog` fails the pull request with `missing-fragment`" describes a dead end and says nothing about how to get past it. Version 1 let through a pull request with no changelog line; version 2 fails every pull request that carries no note, including test-only or docs-only ones. Say outright that every pull request needs a fragment (or what such a change should write), or set `missing-fragment` to a warning in `test.yaml` if that is the intent. - [minor] forgejo/formulas/mol-forgejo-review.toml:188: "with `-base` the pull request's target branch where its workflow gives the action one". This repository's workflow gives the action no `base`: the action takes it from `github.base_ref` by default. A Reviewer who follows the text literally runs the checker without `-base`, and `missing-fragment` then says nothing. Something like "with `-base` the pull request's target branch, unless the workflow sets `fragments` empty or turns `missing-fragment` off" matches what CI does. ### Verified - Read the work bead, the PR description and the whole diff (6 files). The target has no REVIEW.md, AGENTS.md or CLAUDE.md. Nothing else in the repository speaks of a changelog entry (searched roles/, forgejo/, docs/, README). The job name `changelog` of workflow `test` is unchanged, so the required check keeps its name. - Merge into origin/main (50455b6): a clean fast-forward. The forge reports mergeable. - Changelog checker built from the action's tagged source (`v2` = `v2.0.1` = c19d67d) and run in a clean env on the merged tree: `-base main` valid with no finding; without `-base` (a push to main) valid; with the fragment removed it fails with `missing-fragment` (exit 1). - `changelog release` in a throwaway worktree: computes 0.7.0, folds the fragment into the existing `[Unreleased]` note, deletes the file. The committed release branch passes `-base main` with `due=true`, so a release PR is not failed for adding no fragment. - `release.yaml`: still triggers only on pushes to main that change CHANGELOG.md or the workflow itself. The `due`, `version` and `notes` outputs it reads exist in v2's `actions/validate`. - `.gitignore` `!.changelog` makes the fragment directory trackable. - In a clean env (city variables removed, throwaway HOME): `gc lint .` (2 packs ok), `tests/formula.sh`, `tests/reviewer.sh`, `go vet`, `go test` and `go test -race` of forgejo/, and every script of the `scripts` job (worktree-setup, worktree, gnu-tools, merge, apply, upgrade, view-beads, view-mail, permission-deny, permission-request): all pass.
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/gascitypacks!52
No description provided.