Skip to content

fix(release): the cut opens as a pull request only after the release pull request's checks pass, so a fix for a failing check reaches the version's changelog #1544

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

  • Decision D1 (owner, 2026-10-17): "chore(service): the roadmap service stays at 0 replicas, and its development is blocked, while its machine account is suspended #1562 holds the roadmap Service's deployment only; Service code is built, tested offline and merged at 0 replicas (replicas: 0, its test, and the no-scale/no-restart/no-secret-push rules stay)." The code this item changes is the same for a person's devops roadmap close --confirm (src/devops_cli/commands/roadmap.py:468-495) and the Service's close job (src/devops_cli/roadmap/run.py:500-530). So it is built and tested now, and chore(service): the roadmap service stays at 0 replicas, and its development is blocked, while its machine account is suspended #1562 no longer blocks it. Below, "close" means either caller.
  • Decision D12 (owner, 2026-10-17): "fix(release): the cut opens as a pull request only after the release pull request's checks pass, so a fix for a failing check reaches the version's changelog #1544 gates the cut on every check run and status on the head except names in a new advisory list in .github/roadmap.toml, plus a required check that fails on an uncut ready release PR." This settles the body's first open point.
  • Decision D2 (owner, 2026-10-17): "in-cluster jobs act as an organization-owned GitHub App installation (organization takes the owner's current login after the personal account is renamed); appeal the suspension in parallel." Because the cut becomes a pull request (next bullet), that installation needs no release-ruleset bypass to run this flow.
  • The cut is a pull request, not a push. Once every gating check on head S is green, close opens chore/cut-vX.Y.Z, branched at S, into release/vX.Y.Z, and a person merges it. Reason: step 4's --force-with-lease push needs the release ruleset's bypass, which only the suspended account holds, and agents never merge.
  • The gating checks are read at S itself: check runs and commit statuses by SHA, never gh pr checks. Reason: gh pr checks reads whatever the head is at that moment, so a fix merged between the two reads could lend its checks to S.
  • The advisory list is a new advisory_checks key that holds exact check-run names and status contexts. It is read from the default branch, as the Service and a person's close without --ref read the rest of .github/roadmap.toml. Reason: neither a pattern nor a pull request into the release branch can then waive the gate the list narrows.
  • apply_cut and the rehearsed cut land with 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 part 1, as this body's Feasibility section already splits them; this item only calls apply_cut. Reason: the cut can't gate on a rehearsal that doesn't exist yet.
  • D12's check is a step in 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 part 1's separate read-only rehearsal job, never in release.yml's release job. Reason: the release job holds contents: write and checks out with persist-credentials: true, and the unblocking plan gives the release PR's rehearsal its own job with contents: read and persist-credentials: false.
  • The rehearsal job's workflow also runs on ready_for_review and converted_to_draft, while ci.yml keeps its deliberate exclusion of ready_for_review. Reason: GitHub's default pull_request types are only opened, synchronize and reopened. Without these two types, a draft marked ready by hand keeps the green it got as a draft. A PR returned to draft would also keep its uncut-ready failure, and that failure would then hold its own next cut.
  • A ready release PR whose head isn't cut returns to draft before close checks any hold. Reason: D12's check fails on that head while the PR is ready, so checking the holds first would hold the cut on that failure forever.

Scope

What close does each round (this replaces the body's table; rows are checked in this order):

Situation Step
Release due, no release PR open the draft release PR, no commit
Release PR ready, head not cut return it to draft
Cut PR open hold, naming it; replace it if it no longer starts at the tip
Head S not cut, a gating check on S pending, failing or unread hold, naming each check
Head S not cut, every gating check green open chore/cut-vX.Y.Z at S into release/vX.Y.Z
Head cut, release PR a draft mark it ready and write its body
Head cut, release PR ready nothing

Delivery

  1. PR 1 (S), "Part of fix(release): the cut opens as a pull request only after the release pull request's checks pass, so a fix for a failing check reaches the version's changelog #1544", after 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 part 1: D12's required check.
  2. PR 2 (M), "Closes fix(release): the cut opens as a pull request only after the release pull request's checks pass, so a fix for a failing check reaches the version's changelog #1544", after PR 1 and the cut-as-pull-request item:

Acceptance criteria

The body's first criterion (draft PR, tip unchanged), second criterion (holds and advisory) and last criterion (offline tests, devops ci, actionlint) stand. The criteria below replace the others.

Current references (checked at 3dd7fa6)

  • cut_release: src/devops_cli/release/cut.py:1024.
    • Tip fetch: :1065.
    • Bump and collection: :1068-1083.
    • Commit and --force-with-lease push: :736-762, called at :1092.
    • Release PR body: :928; the PR is opened at :1119.
  • Second collection path: _execute_release_prepare at src/devops_cli/commands/release.py:171-189; release_check at :467.
  • Close: _plan_current at src/devops_cli/roadmap/close.py:437-499. An open or merged release PR ends the round at :476-489. Hold is at :82, Cut at :103 and ChecksReader at :69.
  • Check reads: fetch_pr_check_verdicts at src/devops_cli/github/check_verdict.py:469.
    • gh pr checks at :483 reads the PR's current head.
    • head_sha reaches only the REST fallback (:505-512), which reads check runs (:344) and statuses (:370) at that SHA.
  • ReleaseState.CUT: src/devops_cli/roadmap/reprioritize.py:231-240, set while a release PR is open (:686).
  • fix(release): the Service's cut commit collects the changelog fragments into the version's CHANGELOG.md section #1450's exception: _leaves_release_files_to_the_cut at src/devops_cli/commands/pr.py:1622-1654, with _BaseChangelog at :1537, _base_changelog_was_read at :1613, _edits_the_changelog at :1723 and _read_base_changelog at :1731-1758.
  • Release-process heads: _is_release_process_pr at src/devops_cli/commands/pr.py:1472-1482 exempts a chore/open-* PR from grounding whatever it changes; fix(github): pr readiness exempts a chore/open release-process pull request only when it changes release-process files #1344 narrows that.
  • RoadmapConfig is at src/devops_cli/roadmap/config.py:38-41 with extra="forbid", so advisory_checks is a new field. .github/roadmap.toml has no such key. The Service reads the file at the default branch (read_roadmap_config(store, ref=None), src/devops_cli/roadmap/run.py:508). A person's close reads it at --ref, which defaults to the default branch (src/devops_cli/commands/roadmap.py:460, src/devops_cli/roadmap/config.py:88-90).
  • .github/workflows/release.yml:3-13 runs only on push to main, on tags and on dispatch; devops release check is at :87. Its release job holds contents: write (:32-36) and checks out with persist-credentials: true (:51).
  • .github/workflows/ci.yml:7-10 deliberately leaves ready_for_review out of its pull_request types.
  • no-commit-to-branch on release/*: .pre-commit-config.yaml:8-9.

Dependencies and order


Problem

Owner, 2026-10-10: "the other thing about the cut commit is that it should not happen until after the pr checks run and pass" and "then we can fix issues with the pr and the get into the changelog as expected".

Checked at release/v0.2.33 (pre-cut tip 2f3ed2a, cut commit 5c5df79):

  • The cut commit comes before any check runs.
    • The release lane's close job calls cut_release(is_prepare=True, draft=False) (src/devops_cli/roadmap/run.py:482-529, call at :518) as soon as the current release holds no open item and has no release pull request (src/devops_cli/roadmap/close.py:476-500).
    • cut_release bumps the version, collects changelog.d/ into the version's CHANGELOG.md section (fix(release): the Service's cut commit collects the changelog fragments into the version's CHANGELOG.md section #1450), commits, and force-pushes release/vX.Y.Z (src/devops_cli/commands/release.py:1386-1422, push at :1048-1074).
    • Only then does it open the release pull request (:1424-1444). The PR's checks run for the first time on the cut commit.
  • A fix for a failing check misses the changelog.
  • A cut that can't collect fails where nobody sees it.
    • I replayed the cut's collection (release.py:1393-1408) on a scratch copy of 2f3ed2a. It stops with "changelog.d/419.md:1 is outside a category … Nothing was written." (src/devops_cli/release/changelog_fragments.py:114). changelog.d/419.md and changelog.d/873.md hold a bare title line.
    • No check parses the repository's fragments before the cut. The close plan only checks that a fragment exists (close.py:316-330), so devops roadmap close --plan promises a collection that the cut then refuses.
    • In the Service, close would fail at every poll, with no release pull request to show why.
    • With the two fragments moved under ### Added, the same replay writes ## [0.2.33] - 2026-10-10, deletes all 12 fragments, and devops release check --allow-dirty --skip-ci passes.
  • The release PR's checks don't rehearse the release (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, open). On feat(release): v0.2.33 #1537's head 5c5df79, devops release check --allow-dirty --skip-ci exits 1 ("Version mismatch: CHANGELOG.md (0.2.32) does not match pyproject.toml (0.2.33)"), and no check on feat(release): v0.2.33 #1537 fails for it.
  • Each release is cut by the previous release's Service.

Owner decisions

Proposed design

The release PR opens first. The cut commit is the last change before the merge.

  1. Open, with no commit.
  2. Rehearse.
    • The release PR's checks include 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's release job on pull_request. When the head isn't cut yet, the job first applies the cut to its own checkout, with the version taken from the branch name.
    • It uses the same function the Service's cut uses. A single apply_cut(root, version, today) does the bump, the collection and the fragment deletion. cut_release, devops release prepare and the rehearsal all call it, replacing today's two paths (release.py:1393-1408 and _execute_release_prepare at :754).
    • Then the read-only steps run: devops release check --allow-dirty --skip-ci, non-empty notes, uv build, devops devcontainer validate, tag vX.Y.Z absent, label and milestone present, and no open item in the milestone.
    • A malformed or misnamed fragment, a missing version section, or any other step the merge would fail now fails a PR check, where it can be fixed.
  3. Fix.
    • A failure is fixed by a pull request into release/vX.Y.Z that adds its own changelog.d/<issue>.md. The file is named after the issue number (src/devops_cli/config/constants.py:65), so each fix has an issue.
    • Its merge re-runs the release PR's checks on the new head.
  4. Cut.
    • Each release-lane round, close reads the release PR's head and its checks (fetch_pr_check_verdicts, src/devops_cli/github/check_verdict.py:450, with the head SHA).
    • When the head isn't cut and every gating check on that SHA has passed, the Service runs the cut against that SHA: apply_cut, the docs/ROADMAP.md render, one commit.
    • The push uses --force-with-lease=release/vX.Y.Z:<sha>. If a fix merged in between, the push is refused and the cut waits for the new head's checks.
    • After the push, the Service marks the PR ready (gh pr ready) and rewrites its body with the collected notes (fix(release): the release pull request's description is regenerated whenever its release branch changes #1346).
    • A pending, failing or unread check holds the cut, and close --plan names each one.
  5. Re-run on the cut commit.
    • The cut commit re-runs the checks. The rehearsal ran the same function on the same tree, so the cut commit's files are the ones the rehearsal checked. Only the section's date can differ, if the day changes in between.
    • On a ready PR, the release job also fails when the head isn't cut (version, section, no fragment left), so a PR marked ready by hand can't merge uncut.
    • Before the cut, the draft state is the merge gate: GitHub doesn't merge a draft.
  6. A critical fix after the cut (fix(roadmap): a critical fix joins the current release while its release pull request is open, so the release branch holds every change before it merges #1294).
    • It adds a fragment like any other fix. fix(release): the Service's cut commit collects the changelog fragments into the version's CHANGELOG.md section #1450's hand edit of CHANGELOG.md goes, along with its check-readiness exception (pr.py:1607-1660, :1725-1760), so only the cut ever writes CHANGELOG.md.
    • The fragment makes the head uncut again, so the Service returns the PR to draft (gh pr ready --undo).
    • The rehearsal collects the fragment into the section the cut wrote; collect_changelog_fragments already joins an open section (changelog_fragments.py:231-250).
    • Once the checks are green, the Service pushes a second cut commit (the bump is a no-op) and marks the PR ready again.

Whether the head is "cut" is read from the branch tip and never stored: pyproject.toml holds X.Y.Z, CHANGELOG.md holds a non-empty [X.Y.Z] section, and changelog.d/ holds no fragment.

What close does each round:

Situation Step
Release due, no release PR open the draft PR
PR open, head not cut, checks not all green hold, naming the checks
Head not cut, all checks green cut at that SHA, mark ready
Ready PR whose head is no longer cut return to draft
Head cut, PR ready nothing

Proposed answers to open points

Acceptance criteria

  • A current release that is due gets a draft release PR with the release label and milestone, and the tip of release/vX.Y.Z is unchanged. Tested on a real git repository in tmp_path, with gh faked at the process edge.
  • With the head not cut, a failing, pending or unread gating check holds the cut, and the plan names each one. An advisory check's failure doesn't hold it.
  • With every gating check green on SHA S, the cut commit's parent is S. The commit holds the bump, the version's CHANGELOG.md section, the deleted fragments and docs/ROADMAP.md, and the PR is marked ready. If the branch has moved past S, the push is refused and the PR stays a draft.
  • apply_cut is the only code that bumps and collects. The rehearsal step, devops release prepare and the Service's cut produce byte-identical files for the same tree and date.
  • The release job on a PR rehearses the cut. A branch holding a fragment like changelog.d/419.md at 2f3ed2a (a line outside a category) fails the PR check, naming the file and line, and the same branch with the fragment fixed passes. A misnamed fragment fails the same way.
  • A fragment merged after the cut returns the PR to draft. Once the checks are green, the next cut joins it into the existing section and marks the PR ready.
  • devops pr check-readiness refuses a CHANGELOG.md edit in any PR into a release branch.
  • devops roadmap close --plan names the step that is due (open, hold with the checks, cut at SHA, back to draft), and --dry-run makes no request.
  • RELEASE_CYCLE.md §6–7, changelog.d/README.md, AGENTS.md's changelog rule and CONTEXT.md's cut entry describe this flow.
  • Tests are offline, each phase under 1 s, and uv run devops ci and actionlint pass.

Feasibility

The Service side fits one pull request, because it reuses existing pieces:

Its gate assumes the rehearsal job exists. That job is #1425's scope (release.yml on pull_request); this item adds one step to it: apply the cut before devops release check.

If #1425 isn't merged first, split the work in two, merged in this order:

  1. 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, including the cut step in its rehearsal.
  2. This item's Service flow.

Otherwise the Service would cut on checks that still skip the release steps, which is the gap today.

Related: #1425, #1450, #1294, #1346, #1103, #1533, #1537.

Activity

  1. added
    type/feature
    scope/release
    scope/roadmap
    on Oct 10, 2026
  2. dan-petty-bot commented on Oct 10, 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 causes silent changelog loss on every release where a post-cut check fails, but a manual workaround (editing CHANGELOG.md) exists and no data is corrupted.
    • Value: Medium. Release changelogs are the primary record of what changed for users, and missing entries undermine trust in the release process, though the impact is limited to documentation accuracy.
    • Effort: Medium. Requires reordering the close job to open the release PR before cutting, waiting for checks to pass, then performing the cut, plus handling the case where checks fail and the cut must be deferred or redone.
  3. added
    status/blocked
    on Oct 11, 2026
  4. dan-petty commented on Oct 11, 2026

    @dan-petty
    OwnerAuthor

    Blocked by #1562: the roadmap Service's machine account is suspended, and the Service is held at 0 replicas. This item develops the Service or can only be checked on it, so it waits until the account is reinstated or the jobs act as a GitHub App.


    Generated by Claude Code

  5. changed the title [-]fix(release): the Service pushes the cut commit only after the release pull request's checks pass, so a fix for a failing check reaches the version's changelog[/-] [+]fix(release): the cut opens as a pull request only after the release pull request's checks pass, so a fix for a failing check reaches the version's changelog[/+] on Oct 18, 2026
  6. 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.

  7. removed
    status/blocked
    on Oct 30, 2026
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/releasescope/roadmaptype/feature

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions