Pre-merge PR gate for changelog fragment-kind discipline (reusable workflow, sibling to manifest-check) #271
Labels
No labels
bump
major
bump
minor
bump
patch
kind/bug
kind/chore
kind/docs
kind/feature
priority/critical
priority/high
priority/low
priority/medium
size/L
size/M
size/S
size/XL
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
frankenbit/release-toolkit#271
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The fragment-kind discipline (release-prep.sh's check that
<id>.<kind>.mduses one ofadded/changed/deprecated/removed/fixed/security/internal) only fires at release-prep time — well after the bad fragment has merged to main.Concrete failure shape (tmux-tell, 2026-06-30): the docs-cluster PR #655 used
.documentation.mdas the fragment suffix. The PR merged cleanly (no pre-merge gate caught it). When release.yml next tried to roll a release-prep PR for v0.25.0, release-prep.sh exited FATAL:Required a recovery PR (tmux-tell#658 rename
.documentation.md→.added.md) before the next cut could proceed. The failure surfaces AFTER the substrate-of-record is wrong; the recovery cost (and the cut delay) compounds with cut cadence.Proposed fix: reusable PR-gate workflow
Add
reusable-changelog-fragment-check.ymlto release-toolkit, sibling to the existingreusable-manifest-check.yml. Triggers onpull_requestevents that touchchangelog.d/; runs the existing fragment-kind validation logic fromscripts/lib/fragments.sh(or a thin wrapper around it); fails the PR check if any fragment has an unknown kind.Consumers wire it in via
uses: <toolkit-self>/.forgejo/workflows/reusable-changelog-fragment-check.yml@<rc-tag>in theirmanifest-check.yml(or a siblingfragment-check.yml), same pattern as the manifest check.Acceptance criteria
.forgejo/workflows/reusable-changelog-fragment-check.yml:pull_request(orworkflow_callconsumed by per-repopull_requestwiring)changelog.d/**.forgejo/workflows/fragment-check.ymlin a consumer repo.documentation.md-style mistakes fail PR check before mergeRefs
.documentation.mdfragment-kind mistake from #655)reusable-manifest-check.yml(same shape: PR-gate for a release-toolkit invariant)scripts/lib/fragments.sh(extract or wrap)Anchor
2026-06-30 — empirical recurrence: 1 instance today (#655 → #658 recovery). Pre-merge gate prevents the recurrence + the compounding recovery cost. Composes with the wider release-toolkit substrate-care work this morning (release-toolkit#268 + #269 + #270 bake-reset commit guard cycle).
Substantive update from Surveyor's review of tmux-tell#662 (same-day recurrence)
Today's second
.documentation.mdrecurrence: Engineer's tmux-tell#662 (anti-stall pin docs PR, closing #615) initially used.documentation.mdas the changelog suffix — same mistake as tmux-tell#655 hours earlier (which forced the recovery PR #658). Surveyor caught it at review with REQUEST_CHANGES; Engineer renamed.documentation.md → .added.md.Empirical reinforcement of #271's value: a competent chamber made the same mistake twice in one day even after the first incident was visible. The discipline-pin-alone-doesn't-fire pattern — what's needed is the substrate-side gate.
Sharpened root cause (per Surveyor's at-source diagnosis)
The bug isn't a missing validator — it's validator divergence:
changelog-assemble/main.go:60ACCEPTSdocumentationas a kindchangie/release-prep.shREJECTS it (accepts only added/changed/deprecated/removed/fixed/security/internal)So a
.documentation.mdfragment passes the per-PR-check(changelog-assemble says "well-formed") + fails at release-prep time. The two validators have DIFFERENT kind-lists.Updated fix scope
Original #271 framing: "add fragment-kind validation to per-PR gate". Sharper version: unify the kind-list across both validators. Either:
changelog-assemble/main.go:60to use the same accepted-kinds set as release-prep.sh — then the existing per-PR-checkbecomes the gate (no new workflow needed)Lean: (α) — substantively-simpler; the per-PR
-checkalready runs on every PR touching changelog.d/; just needs the kind-list tightened. The new reusable-workflow approach I originally proposed is unnecessary if the existing-checkbecomes the gate.Refs
.documentation.mdmistake; recovery PR #658).documentation.mdmistake; rename caught at REQUEST_CHANGES)quartermaster referenced this issue2026-07-02 01:13:42 +02:00