Skip to content

cmd/release: don't read pr-body file in post-release step - #423

Merged
aanm merged 1 commit into
mainfrom
pr/fix-minor-release-body
Jul 29, 2026
Merged

cmd/release: don't read pr-body file in post-release step#423
aanm merged 1 commit into
mainfrom
pr/fix-minor-release-body

Conversation

@aanm

@aanm aanm commented Jul 29, 2026

Copy link
Copy Markdown
Member

The 4-post-release step failed for v1.20.0 with "v1.20.0-pr-body.txt file not found, it needs to be present to create a release on GitHub for minor releases" (https://github.com/cilium/cilium/actions/runs/30454869041/job/90589118380). That file is a local scratch file written by PushPullRequest.generateSummaryFile() during 2-prepare-release. It is never committed, and release.yaml passes nothing between steps via artifacts, so 4-post-release runs in a separate job with a fresh actions/checkout — a day later in this case — and the file can never exist there. Only minor releases are affected: 85cd002 added a minor-release-only branch that reads it, while patches and pre-releases keep generating the body from CHANGELOG.md, and v1.20.0 is the first .0 release since that commit landed. The failed run produced nothing durable, since the digests commit was made locally but never pushed, so there is no pr/v1.20.0-digests branch, no digests PR and no draft v1.20.0 release.

The file only ever contains a single static line, so this writes that line inline instead of reading it back from disk, and shares it as a constant between the two call sites so the PR body and the release body cannot drift apart. The resulting draft release body for a minor release is the instruction comment, then "See the included CHANGELOG.md for a full list of changes.", then the digests. That matches the intent of 85cd002: the full changelog of a minor release exceeds GitHub's release body limit, with the v1.19.0 section measuring roughly 141 KB against a 125,000 character cap, so maintainers replace the stub with the Slack announcement by hand.

gofmt, go build ./... and go vet ./cmd/... are clean and go test ./... passes. Patch releases are untouched, verified against the shipped v1.19.6 release whose 12,221 character body is generated from CHANGELOG.md by the unchanged else branch. One pre-existing caveat this does not address: the patch path assumes "## v" is the topmost heading in CHANGELOG.md, so re-running 4-post-release before step 2's changelog commit has merged into the stable branch would silently carry the previous patch's changelog rather than failing loudly.

Once this merges, re-dispatching release.yaml with step 4-post-release and version v1.20.0 should complete the release. No cilium-side change is needed, because the workflow checks out cilium/release at main on every run, and no backport is needed as this repository has no stable branches.

The 4-post-release step was failing for minor releases with:

  v1.20.0-pr-body.txt file not found, it needs to be present to create a
  release on GitHub for minor releases

The '<version>-pr-body.txt' file is a local scratch file written by the
2-prepare-release step into the cilium checkout. It is never committed,
and 4-post-release runs in a separate job with a fresh checkout, often
days later, so the file can never exist there.

Since the file only ever contains a single static line, write that line
inline instead of reading it back from disk. Share it as a constant with
the 2-prepare-release step so the two cannot drift apart.

Patch releases are unaffected as they keep generating the release body
from CHANGELOG.md.

Fixes: 85cd002 ("cmd/release: fix GH release creation for minor releases")
Signed-off-by: André Martins <andre@cilium.io>
@aanm
aanm force-pushed the pr/fix-minor-release-body branch from 496e1e7 to 2c4233b Compare July 29, 2026 13:51
@aanm
aanm merged commit 66cbbe8 into main Jul 29, 2026
1 check passed
@aanm
aanm deleted the pr/fix-minor-release-body branch July 29, 2026 13:52
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