Skip to content

docs(release): document the release-PR re-approval before promote - #1486

Merged
c-vigo merged 1 commit into
devfrom
docs/1474-release-pr-reapproval
Aug 13, 2026
Merged

c-vigo merged 1 commit into
devfrom
docs/1474-release-pr-reapproval

Conversation

@c-vigo

@c-vigo c-vigo commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Description

vig-os dismisses PR approvals when new commits are pushed. The finalize job of
a final release.yml run always pushes to the release branch (the CHANGELOG
date 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.yml then re-checks approvals
independently, making re-approval a mandatory, undocumented step between the final
and the promote dispatch.

Observed live on the 1.8.0 train: #1441 was APPROVED when validate passed, and
DISMISSED / REVIEW_REQUIRED immediately after finalize pushed 15abe1b3 +
7a07142d.

Type of Change

  • docs -- Documentation only

Both approval gates are kept. Each guards a genuinely different irreversible act
— burning the immutable X.Y.Z tag, and moving :latest + merging to main. No
workflow or code file is touched by this PR.

Changes Made

docs/RELEASE_CYCLE.md:

  • lifecycle diagram — approval node relabelled as authorising the final dispatch; new
    Re-approve PR node between publish and merge
  • Release Phases item 2, Phase 2 step 7 — the approval authorises the dispatch and
    does not survive it
  • Phase 3 prerequisites — "PR has required approvals (consumed by this run)",
    plus a paragraph naming the pushes that dismiss it
  • Phase 5 — new step 4 "Re-approve the release PR" with the concrete commands, before
    the promote dispatch
  • release.yml reference — one bullet in Key characteristics

docs/DOWNSTREAM_RELEASE.md — mirrors the operator step only, linking to
RELEASE_CYCLE.md for 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 that
sentence would have been false.

Changelog Entry

### Changed

- **Release docs: the release PR must be re-approved before promote**
  ([#1474](https://github.com/vig-os/devkit/issues/1474))

(full entry with sub-bullets is in CHANGELOG.md)

Testing

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.yml checks approval only in the merge job (:435), which
runs after promote has published the draft release and moved :latest — so a
dismissed approval leaves the release half-promoted. The consumer template checks in
both validate (fails fast) and merge. The two documents say the right thing
for their own audience.

Closes #1474

Refs: #1474

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
c-vigo force-pushed the docs/1474-release-pr-reapproval branch from 5c7afe1 to 87000ac Compare August 13, 2026 08:20
@c-vigo
c-vigo merged commit 1ac09c5 into dev Aug 13, 2026
12 checks passed
@c-vigo
c-vigo deleted the docs/1474-release-pr-reapproval branch August 13, 2026 08:31
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant