Repository navigation
docs(release): document the release-PR re-approval before promote - #1486
Merged
Merged
Conversation
c-vigo
force-pushed
the
docs/1474-release-pr-reapproval
branch
from
August 13, 2026 08:05
c058590 to
5c7afe1
Compare
A final release.yml run's finalize job pushes to release/X.Y.Z (CHANGELOG date stamp, regenerated docs, sync-issues commit), which dismisses the PR approval that same run required wherever stale-review dismissal is enabled. promote-release.yml re-checks approvals before merging, so re-approving is a mandatory step between the final and the promote dispatch. Documents that step in RELEASE_CYCLE.md (Phase 2 step 7, Phase 3 prerequisites, Phase 5 runbook, lifecycle diagram, release.yml reference) and mirrors the operator step into DOWNSTREAM_RELEASE.md, linking back for the reasoning. Both approval gates are kept: each guards a different irreversible act. No workflow or code change. TDD does not apply: documentation only, nothing testable. Refs: #1474
c-vigo
force-pushed
the
docs/1474-release-pr-reapproval
branch
from
August 13, 2026 08:20
5c7afe1 to
87000ac
Compare
This was referenced Aug 13, 2026
c-vigo
added a commit
that referenced
this pull request
Aug 13, 2026
…shing (#1490) Closes #1487 ## Problem Devkit's own `promote-release.yml` checked the release PR's draft status, approvals and CI **only in the `merge` job** — which runs *after* `promote` has already moved GHCR `:latest` and published the draft GitHub Release. An unapproved PR therefore failed the promote from an already-published state: the release is public, `main` does not contain the release commit, and the release PR is still open. Published releases are immutable org-wide, so that state cannot be walked back — only fixed forward. The scaffolded consumer template does not have this shape. It runs the same `Find and verify release PR` check in `validate` (fail-fast) *and* repeats it in `merge`. Only the upstream workflow was missing the early gate. **Latent, not fired.** Every promote to date succeeded, because the maintainer re-approves the release PR before dispatching. But #1474 established that a final `release.yml` run's `finalize` job *always* pushes to the release branch and so *always* dismisses the approval under the org-wide stale-review dismissal. The trigger condition is the **default state of every final release** — the only thing standing between it and a half-promoted release was an undocumented habit, documented only last commit in #1486. ## Change Mirror the consumer template rather than invent a third shape: the same `Find and verify release PR` step now runs in `validate`, and the `merge` copy **stays** — PR state can change between the two jobs, which is why the template keeps both deliberately. The check needs a repo-scoped App token: `validate`'s existing `smoke-check-token` is scoped `repositories: devkit-smoke-test` and cannot read this repository's PRs, and `github.token` there carries only `contents: write, packages: read`. Rather than guess at a `GITHUB_TOKEN` permission set that has never been exercised (a wrong guess fails closed and breaks the next promote), the new step mints the App token exactly as the `merge` job does — an identity proven on every promote run to date. ### One thing worth flagging Mirroring the template's step wholesale also brings the **mergeability gate** (#1132 — BEHIND / BLOCKED / DIRTY), which devkit's upstream workflow had never carried in *either* job. This is slightly beyond the literal title of #1487, and deliberate: it is the same defect class (approved + CI-green is not the same as mergeable, and finding out during `merge` means finding out after the publish), and carving those lines out of the step would produce exactly the divergent third variant the issue asks to avoid. It is fail-*earlier*, not fail-*more*: a BEHIND PR already failed the merge, just from a published state. ## Tests `tests/test_promote_release.py` is parametrized over both copies (`devkit`, `scaffold`) instead of pinning the scaffold alone — the divergence this issue is about was invisible precisely because the shape suite only ever looked at the template. RED before the fix on all four `[devkit]` cases: ``` FAILED test_validate_gates_release_pr_before_promote[devkit] FAILED test_validate_queries_pr_mergeability[devkit] FAILED test_validate_rejects_behind_pr[devkit] FAILED test_validate_requeries_unknown_mergeability[devkit] 4 failed, 13 passed ``` Green after: `17 passed`. Full suite `1307 passed, 20 skipped` (`tests/test_image.py` excluded — it checks a locally-pulled 1.8.0 image against dev's CHANGELOG and fails identically on clean `dev`; CI builds the image from the branch). `prek run --all-files` green. ## Verification owed The gate cannot be live-proven without deliberately dispatching a promote against an unapproved PR. The next 1.8.1 promote exercises the happy path — `validate` passing the new step is the proof it does not false-positive. Refs: #1487, #1474, #1132
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.
Description
vig-osdismisses PR approvals when new commits are pushed. Thefinalizejob ofa final
release.ymlrun always pushes to the release branch (the CHANGELOGdate stamp, plus the sync-issues commit), so the approval that authorises the
final release is destroyed by that very run — every time, in every repo consuming
the scaffolded release workflow.
promote-release.ymlthen re-checks approvalsindependently, making re-approval a mandatory, undocumented step between the final
and the promote dispatch.
Observed live on the 1.8.0 train: #1441 was
APPROVEDwhenvalidatepassed, andDISMISSED/REVIEW_REQUIREDimmediately afterfinalizepushed15abe1b3+7a07142d.Type of Change
docs-- Documentation onlyBoth approval gates are kept. Each guards a genuinely different irreversible act
— burning the immutable
X.Y.Ztag, and moving:latest+ merging tomain. Noworkflow or code file is touched by this PR.
Changes Made
docs/RELEASE_CYCLE.md:Re-approve PRnode between publish and mergedoes not survive it
plus a paragraph naming the pushes that dismiss it
the promote dispatch
release.ymlreference — one bullet in Key characteristicsdocs/DOWNSTREAM_RELEASE.md— mirrors the operator step only, linking toRELEASE_CYCLE.mdfor the reasoning (SSoT: no duplicated explanation).Three pre-existing sentences had to be reconciled rather than left contradicting the
new text. Notably, Phase 2 step 7's "the approval lands on the exact diff that
ships" now says the approval lands on the release content as it will ship, with
the mechanical finalization written on top. The issue's phrasing that "the approved
SHA is what gets tagged" was deliberately not reused — the tag points at
finalize_sha, i.e. the approved content plus the finalize commit, so thatsentence would have been false.
Changelog Entry
(full entry with sub-bullets is in
CHANGELOG.md)Testing
prek run --all-files(incl.pymarkdownon every changed file) -> onlycheck-expirationsfails;.vulnixignoreis byte-identical todevon thisbranch. Fixed by fix(security): renew the glibc exception block to 2026-09-02 #1482 — merge that first.
TDD does not apply: documentation only, nothing testable, as the repo's TDD rule allows.
Manual Testing Details
Verified the load-bearing claim against the code rather than the issue text: devkit's
own
promote-release.ymlchecks approval only in themergejob (:435), whichruns after
promotehas published the draft release and moved:latest— so adismissed approval leaves the release half-promoted. The consumer template checks in
both
validate(fails fast) andmerge. The two documents say the right thingfor their own audience.
Closes #1474
Refs: #1474