Repository navigation
Conversation
…too early to see A release's notes are assembled once, when the release pull request is built, and nothing reads changelog.d/ again before the tag is written. Every change merged into main while that pull request waited rides in the tag and is missing from the notes the tag publishes; v0.4.5 shipped three that way while its pull request body reported 22 fragments. The publish run now reads changelog.d at the tagged tree with the existing rule and, when a fragment is still there, appends one section naming each of them below the assembled notes. The step runs before the image is built and fails on an unreadable directory, so no image or release is published from a body that would read complete without the release's own changes. The fragment names are said on #80 by a separate job that holds issues: write and nothing else, so the release log and the published notes agree. test/releaseStrandedFragments.test.ts drives the real step body out of release.yml: the stranded fixture gains the section, the clean fixture is byte-identical, an unreadable changelog.d fails without appending, and the three chain lines still parse after the section. At the base the step does not exist, so all six fail. Written-by: Fledge Platform Dev-2
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Written-by: Fledge Platform Dev-2
Fixes #1207
What changed
scripts/release-stranded-notes.mjs+scripts/lib/stranded-fragments.mjs(new). The publish run readschangelog.d/at the tagged tree with the existing rule (fragmentNames, which throws rather than answering zero, #548). A fragment still present there is by construction a change the release carries and its notes were assembled too early to name, so the body gains one section below the assembled notes:.github/workflows/release.ymlid: stranded), after the existing-release guard and before Build the image, gated onpublished != 'true'. It fails the run on an unreadablechangelog.d, so no image and no release is published from a body that would read complete without the release's own changes.${RUNNER_TEMP}/release-notes.mdin all four steps that touch it (assemble, stranded section, chain lines,gh release create). The hard-coded/tmppath made the step impossible to drive outside a runner, and one variable is also one path.needs: release,if: needs.release.outputs.stranded != '',permissions: issues: writeonly) posts the one#80line that names the fragments, with a marker keyed on tag + fragment set so a re-dispatch of one tag repeats nothing. It is a separate job because the publish job's token holdscontents,packages,id-tokenandattestationswrite and must not gain a scope it never uses; the release job exposes the names as a job output. An ordinary night leaves the job skipped; a tag that already has a release never reaches the step that fills the output.test/releasePublishGuard.test.ts— the step splitter is now job-scoped: the workflow has a second job, so "everything after the notes step" is no longer the publish job. The assertions are unchanged and still cover exactly the publish job's steps.docs/deploy.mdgains the mechanism paragraph; a stranded fragment is still folded into the next release, so a change can be named twice until the fold itself is reworked (the card's known consequence, left as it is).Red first, at the base
test/releaseStrandedFragments.test.tsdrives the real step body out ofrelease.yml, the waytest/releasePublishGuard.test.tsdrives the guard. At the base044c7515a6111560bf96cdd20e8c724535cefc0a, with only the new test file on an otherwise clean tree (scripts/and the workflow untouched):changelog.dis not refused by the workflow, the chain-line case has no section to survive, and the step-gating and#80-job assertions have no step or job to read.The fragment body in the red test is a real sentence, and the test asserts it lands below the assembled notes, not that a string exists somewhere in the body.
At the tip
7557fb618290637279cb78b63b6976f37d93a741, treed0eccc52a2b01d8a21913204cdfd0478b5eaf71b, parent044c7515a6111560bf96cdd20e8c724535cefc0a, 7 files+453/−5.npm run checkat the tip: lint11 warning(s) in 8 entries match the baseline, typecheck clean,# tests 3299 / # pass 3299 / # fail 0, build clean.node scripts/changelog.mjs check→ every fragment ok.The four cases the card asks for
changelog.d/holdsREADME.mdplus999.fixed.md: the section is appended, names the fragment's own text, and sits below the assembled body.README.mdis never a fragment.README.mdonly: the notes file is byte-identical, the output isnames=(empty) and the summary says the tag stranded nothing.changelog.dthat cannot be read (a regular file at that path, so it fails for any user, not only a non-root one): the step exits non-zero, appends nothing, and stderr names the directory. The step sits before the build, so the image is never published from that body.Image: …@sha256:…-shaped string is appended first, then the real chain step runs, andpublishedChainFromBodyfromscripts/verify-release.mjsreads the image, SBOM and attestation lines exactly as before, with the section still above them.Risk tier
node scripts/risk-gate.mjs --base 044c7515at the shipping tree, verbatim:T3, so this needs a seat PASS at this tip plus green
ci-ok, and the Gate Security read on the same tip: the diff addsissues: writeto a new job that does nothing but post one comment, and adds no scope to the publish job.Alternatives considered
#80line from the publish job. Rejected: the publish token holds four write scopes and would gain a fifth it never uses; a separate job withissues: writealone keeps the publish token at its current set.CHANGELOG.md. Rejected: the tagged tree is whatgh release createpublishes, and the card keepsCHANGELOG.mduntouched.Uncertainty and residual risk
#80line runs after the release job; if it fails, the release is already published (correct notes) and the run is red. It is a comment, not a gate.Rollback
Revert the commit. The publish path returns to assembling
CHANGELOG.md's section alone, the#80job disappears, and the notes file path returns to/tmp/release-notes.md. Nothing is persisted; the step only appends to a file inside the run.UI surface
None — a workflow step and its CLI. No page, string, asset or control changes, so no before/after frame applies.
Docs and changelog
docs/deploy.mdgains the mechanism paragraph.changelog.d/1207.fixed.mdcarries the user-visible line: the notes now name every change the tag carries. NoDocs-not-needed:claim.Ran:
npx tsx --test test/releaseStrandedFragments.test.tsat the base044c7515withscripts/and the workflow untouched —# tests 6 / # pass 0 / # fail 6(the red above)npx tsx --test test/dailyRelease.test.ts test/releasePublishGuard.test.ts test/changelogFragments.test.ts test/supplyChain.test.ts test/releasePublishToken.test.ts test/releaseChain.test.ts test/releaseStrandedFragments.test.tsat the tip — 89 passed, 0 failednpm run checkat the tip — exit 0 (# tests 3299 / # pass 3299 / # fail 0, lint at baseline, typecheck and build clean)node scripts/changelog.mjs checkat the tip — every fragment oknode scripts/risk-gate.mjs --base 044c7515—risk-tier: T3; basis: .github/workflows/release.ymld0eccc52a2b01d8a21913204cdfd0478b5eaf71b, identicalNot run:
actionlint/ the workflow-lint job locally: the YAML is exercised by the suite's step-body drivers and bytest/supplyChain.test.ts, but the pinned actionlint binary is a CI step#80comment itself against the live API: the job body is syntax-checked (bash -n) and its marker/dedupe shape is asserted, but no comment is posted by this PR