Repository navigation
Conversation
…ere built from A release PR carries release-please's next boundary (last-release-sha) in its branch. Both checks compared it with a commit that keeps moving, so one docs, test, or chore commit on main turned a correct release PR red, and no step of the pipeline could repair it. - anchor-check: last-release-sha must be the main commit release-please built the branch on, read from the branch's own first-parent chain. It was main's tip at check time. - boundary-check: last-release-sha must be the newest release merge or a commit of the cycle that merge closed. It was the merge or its parent. - The hook stamps the commit the branch is built on when that is the run's commit, wherever main's tip is by then. It no longer stands down when main moved, and it refuses a checkout with uncommitted changes to tracked files. - The anchor-check job checks out the release PR's head with its history: the merge ref at depth 1 does not hold the branch's chain. - Each refusal names its repair: for the release PR the anchor command with the commit filled in, for main the value to set by PR. A hand stamp at main's tip no longer passes anchor-check. With a changelog-visible commit that landed after the notes were built and was never refreshed for, that boundary drops the commit from every changelog.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the history-based release-anchor validation changes.
No open issues 🎉
What changed in this PR
This PR updates release-boundary validation to use the main commit the release PR was built on, rather than main's current tip. This keeps valid anchors accepted when later commits land and main is merged into the release branch.
Changes:
- Derive the release PR anchor from its history and validate main's boundary against the cycle the newest release merge closed.
- Check out the release PR's head with full history for anchor validation.
- Add regression tests for moving main, incorrect anchors, branch shapes, shallow history, and repair commands.
| File | Description |
|---|---|
test/scripts/release-pipeline.test.ts |
Adds anchor, boundary, refusal, and repair regression tests. |
.github/workflows/update-release-pr.yml |
Clarifies the comment about restarting checks after anchoring. |
.github/workflows/checks.yml |
Uses full PR-head history and updates validation descriptions. |
.github/scripts/release-pipeline/anchor.ts |
Implements history-based anchor checks, cycle validation, and actionable repair messages. |
Review effort: Balanced
…s anchor, and name the newest listed commit as main's boundary Two repairs the checks printed could drop a changelog entry when followed as printed. Each now names a repair that drops and repeats nothing. - anchor-check and the anchor command read one state for a release PR that is not anchored. No anchor commit on the branch, or a value that is neither main's own nor an older commit: the stamp at the commit the branch is built on repairs it, as before. An anchor older than that commit means the release commit moved after it was stamped (a rebase onto a newer commit) or the value was edited back: the notes may lack the commits between the two, so the check names the rebuild alone, and the command refuses and pushes nothing. A shallow checkout that would have to tell an older commit from another one is refused. - boundary-check keeps its verdict and changes the value its refusal names: the newest commit the merged release's notes list, read from the commit links the merge added to CHANGELOG.md, inside the cycle the merge closed. It named the merge's parent, which drops a visible commit that landed after the notes were built. With no readable link it names no sha and says where to read the notes. - The anchor command checks the release PR branch out without --force and with --no-overwrite-ignore, so git refuses to overwrite a file of the operator's, untracked or ignored, at a path the branch tracks. - Every refusal of the two checks and the hook has one shape: what is wrong on the first line, then one repair per line, a command alone on its own line. The refusal of a release commit that is not on origin/main says "as fetched here" and puts the fetch first.
Vivswan
marked this pull request as ready for review
November 12, 2026 21:29
Owner
Author
|
Closing in favor of a simpler design: release-please will find its previous release by a marker tag on |
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.
Before
After
How
log,rev-list,diff, andmerge-base: these scripts run beforebun install.Proof
bun run build:schema && bun test test/scripts test/workflowsgives 679 pass, 0 fail.anchor.ts.Technical details
M0 -> N (feat) -> V (feat), a release PR built and anchored on N (f522029e), then rebased onto V (4502d0d3).M0 -> N (feat) -> V (feat) -> the release merge, the notes listing N (6860276d) alone.Set by a commit, that value passes the check and leaves V after the boundary, so the next cycle lists it.
The merge's parent is V: it passes the check too, and no cycle would list V.
With no readable commit link in the release's changelog diff, the refusal names no sha and prints
git show <the merge> -- CHANGELOG.md.Repeat the red run: the committed tests against main's
anchor.ts, in a scratch copy, give 63 pass and 33 fail.Still refused, each beside a control that passes
origin/mainas fetched.Left unstamped by the hook, exit 0
Recorded, not built
origin/main, so anchor-check cannot run there.git rev-listthat boundary-check reads, and the check then fails naming that command.with:block: a droppedfetch-depthorreffails on the next release PR, naming the cause.Other facts
fetch-depth: 0, so it runs the branch's copy of the script.CONTRIBUTING.mdandtest/workflows/checks-workflow.test.tsstate neither rule.git diff --stat origin/main...HEAD -- srcprints nothing..github/scripts/release-pipeline/anchor.ts,.github/workflows/{checks.yml,update-release-pr.yml},test/scripts/release-pipeline.test.ts.