Skip to content

ci(release): cut the release branch when a new line ships - #963

Merged
TheMeinerLP merged 1 commit into
mainfrom
ci/release-branch-cut
Nov 20, 2026
Merged

TheMeinerLP merged 1 commit into
mainfrom
ci/release-branch-cut

Conversation

@TheMeinerLP

Copy link
Copy Markdown

Description

When a new release line ships, the line before it keeps receiving security fixes for 90 days. Those fixes need a branch, and that branch has to start at the last tag of the old line, not at main, which already holds the new line. Doing this by hand at release time is one more thing to forget or get subtly wrong.

This adds a cut-release-branch job to the release workflow. After a release on main whose patch number is 0 (a new minor or major), it asks the existing, tested release_branch.py what to do; the script gains a small command line that reads git ls-remote output. The job then:

  • creates release/<previous line>.x at the last tag of that line, with the release bot so a protection rule can allow only that actor. An existing branch at the same tag is left alone, and one that points elsewhere fails the job without being moved;
  • creates the backport:<line> label and a tracking issue "Window for ends on ";
  • opens a pull request that lists the new line in support-lines.json and re-renders the tables of SUPPORT.md and .github/SECURITY.md. The job never pushes to main.

Every patch release, which is what main produces today, skips the job. No release branch exists until the cut. The first release that would cut one is the next minor or major, i.e. release pull request #22, which this change does not touch. If it merges before this job, the manual cut from the runbook applies.

Part of add-release-branches-and-backports, task 9.1 (decision 2). The throwaway-repository rehearsal from the task's verify step has not been run.

Type of change

  • build / ci / chore - tooling, dependencies, pipelines

How was this tested?

  • Tests first: new tests in test_release_branch.py (reading ls-remote output with annotated tags, adding a line with its 90 day window, idempotence, the command line for create, exists and refuse, the file layout) and the new test_release_branch_cut_job.py (job gating, the branch is only created on a create decision, label, issue, pull request, no push to main, token scope) failed before the change.
  • python3 -m unittest discover -s .github/scripts/tests -t .github/scripts/tests: all pass (locally test_verify_sbom cannot import jsonschema, unrelated).
  • actionlint .github/workflows/release-please.yml: clean. The file layout written by add-line round-trips the current support-lines.json byte for byte.

Checklist

  • Commit messages follow the Conventional Commits convention documented in CLAUDE.md (English, imperative, one of feat, fix, docs, refactor, test, build, ci, chore, perf)
  • Tests cover the change, or the change is not testable and I explained why above
  • ./gradlew build passes locally (not run: only workflow and Python script changes)
  • Documentation and configuration samples are updated if the change is user-facing
  • Existing copyright headers are preserved; new files carry the appropriate header
  • No credentials, tokens or personal data are included in the diff

When a release with patch 0 ships on main, the line before it enters
its security window and needs a branch to receive backports. Cutting
that branch by hand from the right tag is easy to get wrong, because
main already holds the new line.

A cut-release-branch job now runs after such a release. It asks
release_branch.py, which gains a command line, for the decision: it
creates release/<line>.x at the last tag of the previous line, leaves
an existing branch at that tag alone and fails on one that points
elsewhere. It then creates the backport label and a tracking issue,
and opens a pull request that lists the new line in support-lines.json
and renders the tables, so main only changes through review. A patch
release changes nothing.

Signed-off-by: TheMeinerLP <github@themeinerlp.dev>
@github-actions

Copy link
Copy Markdown

Test results

  713 files    713 suites   8m 5s ⏱️
5 718 tests 5 706 ✅ 12 💤 0 ❌
5 781 runs  5 769 ✅ 12 💤 0 ❌

Results for commit 41c1d71.

@TheMeinerLP
TheMeinerLP added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit dfd2dde Nov 20, 2026
40 checks passed
@TheMeinerLP
TheMeinerLP deleted the ci/release-branch-cut branch November 20, 2026 18:54
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