Repository navigation
ci(release): cut the release branch when a new line ships - #963
Merged
Merged
Conversation
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>
Test results 713 files 713 suites 8m 5s ⏱️ Results for commit 41c1d71. |
5 of 7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-branchjob to the release workflow. After a release onmainwhose patch number is 0 (a new minor or major), it asks the existing, testedrelease_branch.pywhat to do; the script gains a small command line that readsgit ls-remoteoutput. The job then:release/<previous line>.xat 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;backport:<line>label and a tracking issue "Window for ends on ";support-lines.jsonand re-renders the tables ofSUPPORT.mdand.github/SECURITY.md. The job never pushes tomain.Every patch release, which is what
mainproduces 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, pipelinesHow was this tested?
test_release_branch.py(readingls-remoteoutput 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 newtest_release_branch_cut_job.py(job gating, the branch is only created on a create decision, label, issue, pull request, no push tomain, token scope) failed before the change.python3 -m unittest discover -s .github/scripts/tests -t .github/scripts/tests: all pass (locallytest_verify_sbomcannot importjsonschema, unrelated).actionlint .github/workflows/release-please.yml: clean. The file layout written byadd-lineround-trips the currentsupport-lines.jsonbyte for byte.Checklist
CLAUDE.md(English, imperative, one offeat,fix,docs,refactor,test,build,ci,chore,perf)./gradlew buildpasses locally (not run: only workflow and Python script changes)