Skip to content

feat(release): arm auto-merge for the release PR and record the decision #5249

Open

Description

@dan-petty

Problem or Motivation

Child 11 of the ADR modernization (#5233). Decision (owner decision 1). It waits for the owner. Agents change the release workflow only through an ordinary PR such as this one.

The review of each record that this item changes:

  • ADR 0013 (supersede after owner decision 1 (release record)): It is in force and mostly true, but it has no options (no rejected release tool reaches the check). 'There is no schedule' contradicts its own 6-hour merge, and that merge merged 0 of 20 runs.
  • ADR 0011 (retire): It is superseded by 0012 and then by 0013. No towncrier, version milestone, Release Gate or tag deploy exists. It stays frozen as the evidence record of docs(adr): decide the release model: branches and cuts, versioning and changelog, and testing the release tip #1751, and its rejections go into the release record.
  • ADR 0012 (retire): It is superseded by 0013, and it got two notes after the supersession. Its live points move: the squash settings and the release-please keys to the release record, the required checks to the merge-gate record, and its Pages note to Status History.

Proposed Solution & Architectural Design

release-merge.yml runs gh pr merge --auto --squash --match-head-commit after the static guards. A required-job step refuses a release-please head that changes a file outside the 4 release files. hold-release turns auto-merge off. Delete the check and mergeable guards and their tests. A contract test checks that the 3 required jobs never skip on pull_request. If the owner turns on immutable releases: set draft and force-tag-creation, add a publish job, then remove the image grace code. A new record supersedes 0013, with Considered Options, Confirmation and a revisit condition (the action bundles release-please 17.6.0). Prove the fix first with devops ci fail-to-pass.

Owner decision 1 of 2026-11-12: Option A, with immutable releases on. At the 6-hour tick, the job checks the static guards and arms GitHub auto-merge with --match-head-commit. release-please makes a draft and its tag, and a last job publishes the release after the assets and images.

Rules of the ADR process (docs/adr/README.md, #5225) that apply:

  • Supersession: the new record sets 'supersedes', and the same PR sets status and 'superseded-by' on the old record. The test fails on a link that goes only one way. The new record restates each rule and each rejected option that still holds, because the alternatives check drops superseded records. Never amend a superseded record. After a third amendment, or when a body contradicts the code, the next change is a supersession.
  • Length: the body of a new record has 1,000 words or fewer, its title has 10 words or fewer, and its slug has 60 characters or fewer. Designs, catalogues, row tables, cutover plans, caps and measurements go to OpenSpec changes and specs, to settings or to docs, with a link under More Information.
  • Use one Considered Options section. Each bullet ends with 'chosen.', 'rejected, because .' or 'deferred until .'. 'Deferred' does not match the rejected regex (adr.py:49), so the check stops refusing on a premise that changed. Each record has a Confirmation section that names its test, CI row or metric, and an optional tracker key.
  • Code, tests and workflows cite the record in force. A test fails on a citation of a superseded record in src/, tests/ and .github/ (archived changes and CHANGELOG.md are history). Each superseding PR moves the citations of the records that it supersedes. Rename sweeps do not change docs/adr/.
  • Merge ADR changes in batches. Each change of the ADR set changes adr_hash (alternatives.py:634-644, 1006) and makes every checked item due again. So all pure status changes go in docs(adr): add MADR front matter, a Status History and the ADR rules #5225, and the record PRs merge one at a time in the planned order.
  • Keep the fix(roadmap): the ADRs in force fill the alternatives ADR budget #5049 budget test. A new record must fit in the tokens that the records it supersedes free. Short option bullets keep the budget, because options are 6,883 of the 8,464 tokens today.

Keep these constraints on purpose. The review found a reason for each one:

  • ADR 0013, agents never merge or label the release PR and never edit release files; the tool derives the version; Argo CD tracks main.

The owner merges this pull request.

Target Subsystem

.github/workflows/release-merge.yml, .github/workflows/release.yml, release-please-config.json, docs/adr/.

Existing Tool Considered

GitHub auto-merge (gh pr merge --auto --squash --match-head-commit), the release-please options draft and force-tag-creation (17.6.0) and GitHub immutable releases. No new tool.

Acceptance Criteria

  • The pull request cites its devops ci fail-to-pass run first: the release-merge job refuses a release pull request whose checks still run before the fix, and arms auto-merge after it.
  • release-merge.yml runs gh pr merge --auto --squash --match-head-commit after the static guards. The check and mergeable guards and their tests go.
  • A required-job step refuses a release-please head that changes a file outside the 4 release files. The label hold-release turns auto-merge off.
  • A contract test checks that the 3 required jobs never skip on pull_request.
  • Immutable releases: release-please sets draft and force-tag-creation, a last job publishes the release after the assets and images, and then the image grace code goes. The owner turns on immutable releases after the merge (tracker owner step 1).
  • A new record supersedes ADR 0013, with Considered Options, Confirmation and a revisit condition (the action bundles release-please 17.6.0).
  • The index and link tests of docs(adr): add MADR front matter, a Status History and the ADR rules #5225 pass, and the fix(roadmap): the ADRs in force fill the alternatives ADR budget #5049 budget test passes: the alternatives check fits every record in force under its cap.

Dependencies

Owner decision 1 of 2026-11-12 is made. This item and the alarm item both change ci.yml.

Related

Source: #5233

Alternatives check of 2026-11-29: none.
Tool: none found.
Reason: Searches found auto-merge actions (peter-evans, pascalgn) and release-please, but none supplies the release-file guard, hold-release handling, required-job contract test or ADR supersession; those are repository-specific workflow controls, so no tool covers the need.

Lacks:

  • No release-please head guard on the four release files
  • No hold-release label that turns auto-merge off
  • No required-jobs contract test or ADR supersession record

Proposed design

Problem statement

The release-merge workflow merges the release pull request directly, so the run fails when a required check still runs. The workflow must arm GitHub auto-merge with --match-head-commit after the static guards. The check and mergeable guards in devops_cli.release.merge_candidate must go. A contract test must stop the three required jobs from skipping on pull_request. A new ADR must supersede ADR 0013 and record owner decision 1.

The release workflow already sets draft and force-tag-creation, publishes after the assets and images, and has immutable releases on. The hold-release label stops the scheduled job, but the push-triggered reusable workflow re-arms auto-merge and reads no label. That fix waits on the upstream library and is deferred.

Acceptance criteria

Requirement: Release auto-merge after static guards

The release-merge workflow SHALL run gh pr merge --auto --squash --match-head-commit only after the pick step's static guards pass.

Scenario: Auto-merge waits for static guards

  • WHEN uv run devops ci fail-to-pass runs the release-merge job on a release pull request whose static guards pass and whose checks still run before the fix
  • THEN The command shows the job refuses the pull request before the fix and arms auto-merge after the fix.

Requirement: Redundant release guards removed

devops_cli.release.merge_candidate MUST remove the check guard, the mergeable guard, the checks: read permission and their tests.

Scenario: Release merge arms with a running check and a not-clean merge state

  • WHEN uv run devops ci fail-to-pass runs the release-merge job on a release pull request whose static guards pass, whose check still runs, and whose merge state is not clean
  • THEN The command shows the job arms auto-merge.

Requirement: Hold label stops scheduled auto-merge

The release-merge workflow MUST not arm auto-merge when the release pull request has the label hold-release.

Scenario: Hold label applied at the 6-hour tick

  • WHEN uv run devops ci fail-to-pass runs the release-merge job on a release pull request with hold-release
  • THEN The command shows auto-merge is off.

Requirement: Required jobs never skip on pull_request

The workflow contract test MUST fail when any of the three required jobs can skip on a pull_request event.

Scenario: Required jobs run on a pull request

  • WHEN uv run devops ci fail-to-pass runs the contract test on a pull_request event after the change
  • THEN The command shows the test fails before the fix and passes after it for Static Analysis, Tests & Coverage and Semantic PR title.

Requirement: Changed release workflows pass validators

The changed release workflows MUST pass actionlint and zizmor.

Scenario: Workflow validators pass

  • WHEN uv run devops ci --check --only actionlint,zizmor runs on the changed workflows
  • THEN The command passes.

Requirement: New release record supersedes ADR 0013

A new ADR MUST supersede ADR 0013, record owner decision 1, and become the citation in src/, tests/ and .github/.

Scenario: ADR supersession and citation tests pass

  • WHEN uv run devops ci test tests/invariants/test_adr_records.py tests/invariants/test_adr_superseded_citations.py runs
  • THEN The tests pass and show the two-way supersession link, owner decision 1, and no citation of ADR 0013 in src/, tests/ or .github/.

Requirement: New release record content

The new ADR MUST restate each rule and rejected option that still holds, hold the release-please keys and squash settings from ADR 0012, and include Considered Options, Confirmation, a revisit condition and the publish order.

Scenario: ADR content tests pass

  • WHEN uv run devops ci test tests/invariants/test_adr_records.py runs
  • THEN The tests pass and show the required sections, the release-please 17.6.0 revisit condition, the publish order, and the release-please keys and squash settings.

Requirement: ADR length and budget

The new ADR MUST stay under the length limits of docs/adr/README.md and fit in the tokens that the records it supersedes free, under CONST_ROADMAP_ALTERNATIVES_MAX_ADR_TOKENS.

Scenario: ADR docs and budget tests pass

  • WHEN uv run devops docs check and uv run devops ci test tests/roadmap/test_roadmap_adr.py tests/roadmap/test_roadmap_alternatives.py run
  • THEN Both commands pass and the alternatives check fits every record in force under its cap.

Requirement: Pending a person after the merge

The owner SHALL merge the pull request after its checks pass.

Scenario: Owner merges the pull request

  • WHEN The owner merges the pull request
  • THEN The next release shows the draft release, its tag, and the publish job after the assets and images.

Existing Tool Considered

gh pr merge --auto (GitHub CLI) covers the auto-merge, and release-please 17.6.0 covers draft and force-tag-creation; GitHub immutable releases cover immutability. The alternatives check of 2026-11-29 found no tool for the release-file guard, the hold-release label, the required-jobs contract test, or the ADR supersession, and its block lists those lacks. The release-file guard already exists in src/devops_cli/release/release_files.py. The repository builds the remaining small controls itself: about 1,000 tokens to write, 500 tokens to keep and fix, and under one day.

Key questions

  • Which release auto-merge option did the owner choose?: Option A, with immutable releases on. The 6-hour job checks the static guards and arms GitHub auto-merge with --match-head-commit. release-please makes a draft and its tag, and a last job publishes the release after the assets and images. (best practice) [sources: RELEASE_CYCLE.md:3, RELEASE_CYCLE.md:62, RELEASE_CYCLE.md:64]
    • Chosen: Option A, with immutable releases on. Owner decision 1 of 2026-11-12 records this option in the issue body.
    • Rejected: Keep the current guards and mutable releases. The owner decision replaces this option.
  • Should the release-merge workflow arm auto-merge after the static guards and remove the check and mergeable guards?: Yes. release-merge.yml runs gh pr merge --auto --squash --match-head-commit after the pick step. devops_cli.release.merge_candidate removes the check and mergeable guards, the checks: read permission and their tests. (best practice) [sources: .github/workflows/release-merge.yml:75-84, src/devops_cli/release/merge_candidate.py:142-145, src/devops_cli/release/merge_candidate.py:164-180, openspec/specs/release-scheduled-merge/spec.md:16, openspec/specs/release-scheduled-merge/spec.md:30, openspec/specs/release-scheduled-merge/spec.md:43-48]
    • Chosen: Arm auto-merge and remove the guards. The required checks gate the merge, and --auto waits for them without a failed run.
    • Rejected: Keep the check and mergeable guards. They duplicate the required checks and fail a run while a check still runs.
  • Should a required-job step refuse a release-please head that changes a file outside the four release files?: Yes. The Tests on Main job already runs python -m devops_cli.release.release_files from the base commit and refuses such a head. No new step is needed. (best practice) [sources: .github/workflows/ci.yml:359-403, src/devops_cli/release/release_files.py:16, tests/release/test_release_files.py:1]
    • Chosen: Keep the existing Tests on Main step. It already reads the compare of the base commit and the head, and it refuses a fifth file.
    • Rejected: Add a second release-file guard. It duplicates the Tests on Main step and adds no protection.
  • Should the workflow contract test require that the three required jobs never skip on pull_request?: Yes. Add the check to tests/invariants/test_workflow_contracts.py for Static Analysis, Tests & Coverage and Semantic PR title. (best practice) [sources: .github/workflows/ci.yml:50-51, .github/workflows/ci.yml:253-255, .github/workflows/pr-checks.yml:37-39, docs/adr/0043-required-checks-and-main-ruleset-gate-merges.md:42]
    • Chosen: Add the contract test. A skipped job reports success, so the ruleset cannot see that the required check did not run.
    • Rejected: Rely on the ruleset alone. The ruleset cannot see a job that skips before it reports.
  • Should immutable releases use release-please draft and force-tag-creation, with the publish job after the assets and images?: Yes. The repository already sets draft and force-tag-creation in release-please-config.json, and publish.yml runs the assets job after each image job. Immutable releases are on. No change is needed. (best practice) [sources: release-please-config.json:8-9, .github/workflows/publish.yml:43-48, RELEASE_CYCLE.md:62-64]
    • Chosen: Keep the draft release and the publish order. The assets job waits for each image job, so the release publishes after the assets and images.
    • Rejected: Publish as soon as release-please creates the release. It would publish before the assets and images are ready.
  • Should a new ADR supersede ADR 0013 instead of amending it?: Yes. A new record supersedes ADR 0013. It restates each rule and rejected option that still holds, with Considered Options, Confirmation, a revisit condition, and the publish order. (best practice) [sources: docs/adr/README.md:64-71, docs/adr/0013-releases-use-release-please-as-it-ships-and-agents-stay-out.md:44, docs/adr/0043-required-checks-and-main-ruleset-gate-merges.md:7]
    • Chosen: Supersede ADR 0013. The body contradicts the code and ADR 0013 has no Considered Options section, so the ADR process requires a supersession.
    • Rejected: Amend ADR 0013 in place. The ADR process forbids an edit of the body of an accepted record and requires a supersession after a contradiction.
  • Should the new record keep the ADR token budget?: Yes. The new record must fit in the tokens that the records it supersedes free, under CONST_ROADMAP_ALTERNATIVES_MAX_ADR_TOKENS, which is 10,700 tokens. The README line 77 still says 8,192 tokens; correct it to 10,700 in the same pull request. (best practice) [sources: docs/adr/README.md:73-77, src/devops_cli/config/constants.py:3993-3997, src/devops_cli/roadmap/alternatives.py:1782]
    • Chosen: Keep the budget test. The alternatives check drops records that exceed the cap, so the new record must fit.
    • Rejected: Remove the budget test. The check would then drop a record that the project needs in force.
  • Should the release workflow read the hold-release label before it arms auto-merge?: Yes, but the step is in the reusable workflow of dan-petty/github-workflows at v0.5.1, and this repository must not edit release.yml by hand. Defer the fix until the upstream library reads the label and this repository updates the pin. (best practice) [sources: RELEASE_CYCLE.md:20, RELEASE_CYCLE.md:56, .github/workflows/release.yml:28, .copier-answers.yml:2]
    • Chosen: Wait for the upstream library to read the label. The push run re-arms auto-merge after a local disable, so only the upstream step can keep the label held.
    • Rejected: Add a repository workflow that disables auto-merge on the label. The next push to main turns auto-merge on again.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#5246, #5247

Activity

  1. added
    source/agent
    on Nov 12, 2026
  2. added
    type/feature
    scope/release
    status/new
    value/medium
    effort/medium
    on Nov 12, 2026
  3. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor
  4. added
    priority/p2-medium
    on Nov 12, 2026
  5. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at 8cf9935 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.

  6. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.

    Searches (9)

    Tools considered:

    Searches run:

    • GitHub action enable auto-merge pull request label hold maintained, results: 5
    • release-please immutable releases draft force-tag-creation auto-merge release PR, results: 5
    • peter-evans enable-pull-request-automerge GitHub Action, results: 5
    • googleapis release-please-action configuration draft force-tag-creation, results: 5
    • Kodiak GitHub merge bot auto merge label, results: 5
    • release-please GitHub releases immutable draft release publish assets after upload, results: 5
    • gh pr merge --auto match-head-commit workflow, results: 5
    • release-please-action, results: 5
    • release please pull request auto merge feature issue, results: 5

    Sources:

  7. devops-cli-service commented on Nov 27, 2026

    @devops-cli-service
    Contributor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.

  8. dan-petty commented on Nov 27, 2026

    @dan-petty
    OwnerAuthor

    PR #7463 (issue #7444) delivers one step of owner decision 1: the job Upload Release Assets of release.yml now needs each image job, so it publishes the release only after each image has its release tag.

    Two steps of this item stay open:

    • The image grace of the row release_comments (CONST_ROADMAP_RELEASE_IMAGE_GRACE_MINUTES, src/devops_cli/roadmap/release_roll.py) can go after a real release shows published_at later than each Attest & Tag job.
    • ADR 0013 still says "There is no draft release and no extra publish order". fix(release): publish a release only after its images #7463 adds no status line, because the line of 2026-11-26 stays true. The new record of this item must state the order: draft and tag, images, files, publication.
  9. devops-cli-service commented on Nov 27, 2026

    @devops-cli-service
    Contributor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.

  10. dan-petty commented on Dec 1, 2026

    @dan-petty
    OwnerAuthor

    From the source on main on 2026-11-30: the step "Enable auto-merge on the release pull request" of .github/workflows/release.yml runs gh pr merge --auto --squash for each update of the release pull request and reads no label. So the label hold-release does not hold a release: the next push to main turns auto-merge on again. This is a reading of the code; no run showed it.

  11. devops-cli-service commented on Dec 1, 2026

    @devops-cli-service
    Contributor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.

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

    effort/mediumpriority/p2-mediumscope/releasesource/agentstatus/newtype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions