Skip to content

release train stage 2: automated backports #1730

Description

@ndizazzo

Stage 2 of #1724. Replace the by-hand cherry-pick flow from Stage 1 with a bot. Don't start until Stage 1 has carried a release. The bot automates the exact PR shape the release owner has been producing by hand, and one real release is how we find out whether that shape is right.

1. Backport bot

korthout/backport-action on pull_request_target: closed, where the label names the target branch. Pin by SHA like everything else in .github/workflows/. Both labels already exist from Stage 1, so this stage changes what happens when they're applied, not how anyone applies them.

The rules, with no self-reported confidence score anywhere in them:

  • Clean cherry-pick -x, the bot opens the PR and turns on auto-merge. CI is the only gate, no human.
  • Conflict, the bot opens a draft with no auto-merge. An agent can resolve it, but only if the resolved diff touches nothing outside the conflicted hunks and full CI is green. A human clicks merge, every time.

Who gets to enable auto-merge is what separates those two cases, rather than a model grading its own work. Ask a model for a confidence score and it'll say 100.

Bot-opened PRs use the same title ([backport <target>] <original title>) and -x trailer as the Stage 1 manual flow, so the forward-port check in the release skill doesn't need to know which one opened the PR.

2. Ruleset interaction

Auto-merging a clean pick into release/** still has to satisfy the 1-approval requirement from the Stage 1 ruleset. Pick one during implementation:

  • the bot's identity is a release manager and the workflow approves its own PR (weakest)
  • clean picks into release/** bypass the approval rule through a bypass actor scoped to the bot app (cleanest, needs a GitHub App identity instead of GITHUB_TOKEN)
  • keep 1 approval and accept that "auto-merge" means "merges the moment a release manager clicks approve"

Forward-ports into main have no approval requirement today, so those genuinely auto-merge on green.

3. stale-prs.yml exemption

Exempt bot-opened backport PRs from the 7-day close (PR_CLOSE_DAYS). Drafts are already exempt, so this mostly covers a clean pick sitting on CI or on an approval.

4. Skill and docs update

.agents/skills/release-train/ and RELEASE.md from Stage 1 describe the manual flow. Item 4 of that flow becomes "apply the label, watch for the bot's PR". Keep the manual commands in references/ for when the bot is down or the pick is too tangled.

Done when

  • A labeled PR merged to main produces a bot-opened cherry-pick PR against a release/* branch without anyone running git.
  • A clean pick has merged with no human click.
  • A conflicted pick has landed as a draft and been merged by a human after resolution.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions