Skip to content

fix(release): a release pull request rehearses the cut and the release job read-only, so a green pull request means the release job passes on merge #1425

Closed as not planned

Description

@dan-petty

Refreshed plan (2026-10-17, unblocking review)

This section supersedes any text below that conflicts with it.

Decisions

Scope

  • Workflow .github/workflows/release-rehearsal.yml with one job, Release Rehearsal.
    • It runs on pull_request into main with types opened, synchronize, reopened, ready_for_review, converted_to_draft, labeled, unlabeled, milestoned and demilestoned. actionlint 1.7.12 accepts all of them.
    • Its if limits it to heads release/v*. On any other pull request the job is skipped, which GitHub reports as success, so requiring the check blocks no other pull request.
  • A devops release subcommand holds the logic (for example devops release rehearse <pr>):
    • It reads the pull request (same repository, head release/vX.Y.Z, the release label, milestone vX.Y.Z), tag vX.Y.Z and every open issue in the milestone.
    • It reads the head's cut state from the checkout: pyproject.toml holds X.Y.Z, CHANGELOG.md holds a non-empty [X.Y.Z] section, and changelog.d/ holds nothing but README.md.
    • A ready pull request with an uncut head fails (D12).
    • A draft with an uncut head gets apply_cut(root, version, today) applied to its checkout, with the version taken from the branch name.
    • The composite action then runs devops release check --allow-dirty --skip-ci, uv build with SHA256SUMS, notes extraction (which must not be empty) and devops devcontainer validate.
  • apply_cut does the bump, the collection and the fragment deletion. It replaces cut_release's prepare block and _execute_release_prepare.
  • devops pr check-readiness refuses a pull request into release/vX.Y.Z once that release's pull request has merged.
  • Moved elsewhere:

Delivery

Acceptance criteria (these replace the three checklists below)

  • A release pull request whose milestone holds an open issue fails the check, naming each open issue. With every issue closed, the check passes. Pull requests in the milestone, the release pull request among them, are not counted.
  • A missing release label, a missing milestone vX.Y.Z, or an existing tag vX.Y.Z fails the check, naming which. Setting the missing label or milestone re-runs the check, which then passes with no new push.
  • Any failed GitHub read fails the check with the reason: the pull request, every page of the milestone's issues (not only the first 100), and the tag. Only a 404 on git/ref/tags/vX.Y.Z means the tag is absent. The milestone read does not reuse _fetch_raw_milestone_issue_numbers, which turns a failed read into an empty set.
  • A ready release pull request whose head is uncut fails, naming each reason: the version in pyproject.toml, a missing or empty section, or a fragment left in changelog.d/. The same branch, once cut, passes. feat(release): v0.2.30 #1473's case (no 0.2.30 section) is a regression test.
  • On a draft with an uncut head, the cut is applied before the checks. A fragment with a line outside a category (like changelog.d/419.md at 2f3ed2a) fails the check, naming the file and line, and so does a misnamed fragment. The same branch with the fragment fixed passes.
  • apply_cut is the only code that bumps and collects. The rehearsal, devops release prepare and cut_release produce byte-identical files for the same tree and date.
  • The verification steps exist once, in a composite action that both jobs call. Empty notes after the fallback fail both jobs. release.yml's triggers, its if, and its writing steps (tag, GitHub Release, milestone close, image pushes, attestation) are unchanged and never run on pull_request.
  • A test over the workflow file asserts that the rehearsal grants only contents: read, issues: read and pull-requests: read, checks out with persist-credentials: false, uses no secret but the job token, runs on pull_request only, and is skipped for heads outside release/v*.
  • devops pr check-readiness refuses a pull request into release/vX.Y.Z whose release pull request has merged. It names the merged release pull request and tells the author to retarget to the next release's branch. A failed read of the release pull request refuses too, naming the error. The rule is one more entry in _GROUNDING_CHECKS.
  • The logic lives in devops commands tested offline, with gh faked at the process edge and each test under 1 s.
  • actionlint and uv run devops ci pass. RELEASE_CYCLE.md §6-7 name the check, and a changelog.d/1425.md fragment exists.
  • Pending a person: the main ruleset requires Release Rehearsal, so a red or uncut ready release pull request cannot merge.

Current references (main 3dd7fa6)

  • .github/workflows/release.yml:3-13: the triggers (push to main, tags, dispatch).
  • .github/workflows/release.yml:32-36: the write scopes.
  • .github/workflows/release.yml:86-103: the check, the build, and notes extraction with its fallback.
  • .github/workflows/release.yml:105-142: tag, GitHub Release and milestone close.
  • .github/workflows/release.yml:144-145: devcontainer validate.
  • .github/workflows/ci.yml:7-10: the pull request types, which leave out ready_for_review.
  • .github/workflows/ci.yml:203-209: the Service Image job on every pull request into main.
  • src/devops_cli/release/cut.py:1068-1083: the cut's bump and collection.
  • src/devops_cli/commands/release.py:171-189: the prepare path's bump and collection.
  • src/devops_cli/release/cut.py:782-798: the milestone read that swallows failures.
  • src/devops_cli/commands/pr.py:1462-1469: _is_release_pr.
  • src/devops_cli/commands/pr.py:1657: _closes_an_item_of_its_release.
  • src/devops_cli/commands/pr.py:1691-1698: _GROUNDING_CHECKS.
  • RELEASE_CYCLE.md:199-210: Step 3, the release pull request's checks.
  • RELEASE_CYCLE.md:217: the hand edit of the section after the cut.
  • RELEASE_CYCLE.md:218: names fix(release): a release pull request rehearses the cut and the release job read-only, so a green pull request means the release job passes on merge #1425 for this check and for the readiness refusal.

Dependencies and order


Problem

A critical fix admitted to a cut release (#1294) can still be open when someone merges the release pull request. release.yml then closes the milestone on publish, and no job moves an item out of a shipped release (reprioritize.py: "the job moves no item out of a shipped release"). So the fix sits in a closed milestone that no job plans again. #1362 closes only items that a merged pull request delivered, so an undelivered fix stays open there.

devops pr check-readiness exempts release pull requests from grounding (pr.py) and runs in no workflow, so nothing stops this merge. RELEASE_CYCLE.md §7 (since #1294) tells a person to merge the release pull request only once its milestone has no open item, but nothing enforces it.

Proposed remedy

A required ci.yml status check on release/* → main pull requests. It reads the release's milestone and fails while any issue in it is open, naming each one. It also fails when the read fails, so a GitHub error never passes the check.

Acceptance criteria

  • A release pull request whose milestone holds an open issue gets a failing check naming that issue; with every issue closed, the check passes.
  • A failed milestone read fails the check with the reason.
  • The check's logic lives in a devops command tested offline, with gh faked at the process edge, each test under 1 s.
  • RELEASE_CYCLE.md §7 names the check; uv run devops ci passes.

Found while delivering #1294. Related: #1294, #1362, #1020, #1414.

Update 2026-10-09: owner requirement — a green PR into main means the release succeeds

Owner, 2026-10-09: "the checks on a pull request targeting main, should tell me if a merge is going to succeed" and "if something fails during the release workflow, it should have also failed on the pull request checks for the branch targeting main."

What happened: the Service cut v0.2.30 and opened #1473 with green checks; it merged, and Release Orchestration failed on main (run 37887128320) at devops release check: CHANGELOG.md's newest section was 0.2.29 while pyproject.toml was 0.2.30. Release Orchestration runs only on push to main, tags and dispatch, so none of its steps ran on the PR. Recovery took a second PR into main (#1474).

This item's check is therefore widened to that requirement. Simplest form, so the PR and the merge can't drift: Release Orchestration's release job also runs on pull_request into main, and every step that tags, publishes, closes the milestone or pushes an image is skipped on that event. So the PR runs the same steps the merge runs: devops release check, notes extraction (non-empty), uv build, devops devcontainer validate, and a check that tag vX.Y.Z does not exist yet. Add the checks the merge relies on that no step makes today:

Acceptance criteria to add:

  • A release PR whose branch lacks the CHANGELOG section, lacks the label or milestone, pins a missing image, or whose milestone holds an open item, fails its PR check with a message naming what is missing; the same branch fixed passes.
  • The job's publishing steps run only on push to main, tags and dispatch, and the workflow has one copy of each verification step.
  • Person step: the main ruleset requires this check, so a red release PR cannot merge.

Update 2026-10-09 (later): every release and distribution step is rehearsed read-only on the release PR

Owner, 2026-10-09: "It is standard practice to do read-only validation of all release steps in a release pr, and that is what I expect to happen for all workflows around release and distribution." This widens the update above from Release Orchestration to every workflow that releases or distributes on a merge to main.

Inventory at main (8598e79), what each does after the merge, and what a PR into main runs today:

Path After the merge On a release PR today
release.yml job release devops release check, uv build + SHA256SUMS, notes extraction, tag vX.Y.Z, GitHub Release, milestone close, devops devcontainer validate, devcontainer image vX.Y.Z + latest nothing (push, tags and dispatch only)
release.yml job service-image the publication plan (reuse the image the release branch published when its inputs label matches, else build), build, push, attest nothing; ci.yml's service-image build skips release PRs (!startsWith(github.head_ref, 'release/v'))
GitHub Pages legacy build of main:/docs (Jekyll) nothing
Argo CD syncs the deploy overlay, which pins service:vX.Y.Z nothing checks the render or that the pinned image exists
ci.yml job devcontainer — builds (and publishes a PR-tagged) devcontainer image: already rehearsed

Required (one PR; the same steps on both events, so the rehearsal and the release can't drift):

  • release.yml also runs on pull_request into main. Every step runs on the PR except those that write: the tag push, the GitHub Release, the milestone close, image pushes and the attestation. Those are gated on push, tags and dispatch. On the PR, the release job also fails when tag vX.Y.Z already exists, the PR lacks the release label or milestone vX.Y.Z, or the milestone holds an open item.
  • The service-image job runs its publication plan on the PR read-only: it fails when the image the overlay pins doesn't exist with matching inputs and would need a build it can't make, and it builds without pushing whenever the plan would build.
  • A docs-site job builds docs/ with GitHub's Pages Jekyll build on the PR (no deploy), so a site build failure fails the PR.
  • A deploy-render job runs kustomize build on the Argo CD overlay and checks every image it pins exists in its registry.
  • Release PR feat(release): v0.2.30 #1473's case is a regression test: a branch without the version's CHANGELOG section fails the PR check that the merge would have failed.
  • Person step: the main ruleset requires these checks, so a red release PR cannot merge.

Activity

  1. added
    type/bug
    scope/ci
    scope/release
    source/agent
    on Oct 8, 2026
  2. dan-petty-bot commented on Oct 8, 2026

    @dan-petty-bot
    Collaborator

    Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.

    • Priority: P2-Medium. It prevents a real operational failure (items permanently stuck in a closed milestone) but requires a specific sequence of events and can be worked around manually by reopening the milestone.
    • Value: Medium. It closes a gap that silently drops work from the planning pipeline, but only in the narrow case where an undelivered fix is still open at release-PR merge time.
    • Effort: Medium. Requires a new devops command with offline tests faking gh, a ci.yml workflow entry, RELEASE_CYCLE.md documentation, and acceptance-criteria verification.
  3. dan-petty commented on Oct 8, 2026

    @dan-petty
    OwnerAuthor

    Scope addition from the review of #1294: devops pr check-readiness should also refuse a pull request into release/vX.Y.Z once that release's pull request has merged. Today _closes_an_item_of_its_release (commands/pr.py, around lines 1612-1641) compares only the closed issue's milestone. A fix still open when the release PR merges can therefore merge into the dead release branch, and #1362's closure then closes it as delivered from that shipped branch, although its change never reaches main.

    Acceptance criterion to add: a PR into a release branch whose release PR has merged fails readiness, naming the merged release PR and telling the author to retarget it to the next release's branch. Test it offline with gh faked at the process edge.

  4. dan-petty commented on Oct 9, 2026

    @dan-petty
    OwnerAuthor

    Finding: v0.2.29 Service gap assessment (2026-10-09)

    The v0.2.29 release PR (#1455) was opened by hand with the release label but no milestone. release_state finds release PRs only through milestone(number){pullRequests(labels:[release])}, so the Service read v0.2.29 as started, not shipped, and its first round after the ship (21:52:56Z, 4 min after the GitHub Release) started nothing. That round still stamped reprioritize, so the ship was older than the cutoff and nothing retried; v0.2.30 started only after a person set the milestone and ran reprioritize (00:16Z).

    Proposed criterion for this check (no new mechanism): it also fails when the release PR lacks milestone vX.Y.Z or the release label, and names which one is missing. Until then, open release PRs only with devops release pr, which passes --milestone vX.Y.Z.

  5. changed the title [-]fix(release): a release pull request's check fails while its release's milestone holds an open item[/-] [+]fix(release): a release pull request rehearses every release and distribution step read-only, so a green PR means the merge publishes[/+] on Oct 9, 2026
  6. dan-petty commented on Oct 9, 2026

    @dan-petty
    OwnerAuthor

    Note (2026-10-09): the Service image is moving to Argo CD Image Updater on service:latest by digest (#1485 in v0.2.31; #1486 in v0.2.32 removes the release-branch publication plan, the pin and its check). Once #1486 lands, this item's Service-image criterion is simply "ci.yml builds, smoke-tests and scans the release PR's image without pushing", and the overlay image-existence check skips the Image Updater-managed service:latest. The other criteria stand.

  7. added this to the v0.2.38 milestone on Oct 17, 2026
  8. changed the title [-]fix(release): a release pull request rehearses every release and distribution step read-only, so a green PR means the merge publishes[/-] [+]fix(release): a release pull request rehearses the cut and the release job read-only, so a green pull request means the release job passes on merge[/+] on Oct 18, 2026
  9. removed this from the v0.2.38 milestone on Oct 20, 2026
  10. dan-petty commented on Oct 22, 2026

    @dan-petty
    OwnerAuthor

    Superseded by ADR 0012 (docs/adr/0012-releases-are-derived-by-release-please-from-trunk-and-milestones-are-planning-buckets.md). The cut, the fragments or the hand-built release pull request that this issue concerns are deleted by the new release model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope/ciscope/releasesource/agenttype/bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions