Gate build + release on the version bump #490
No reviewers
Labels
No labels
Kestra
bug
enhancement
someday
subtask
☁️ api
🎛️ infrastructure
🐞 sentry
📆 2025 Season
📝 pages
allpicks
📝 pages
picks
📝 pages
standings
🚀 performance
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
johnsturgeon/tgfp-web!490
Loading…
Reference in a new issue
No description provided.
Delete branch "gate-build-release-on-the-version-bump-488"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Makes releases deliberate: the version bump is the trigger. A merge whose
pyproject.tomlversion differs from the latest release cuts one release and builds one image; a merge that leaves the version untouched produces nothing.Changes
release-on-merge.yml— keeps the "release for this version already exists → no-op" check as the bump gate, then on a real bump aggregates notes across the whole span: every PR merged in(prev-release-target .. MERGE_SHA], each with its title/link and the issues it closed (reusing the close/fix/resolve keyword scan), plus a compare changelog link.build-image.yml— triggers onrelease: [published](chained off the release, which is created with the realFJ_TOKENPAT so the event isn't suppressed) plusworkflow_dispatchfor re-running a failed build against an existing tag. No longer builds on every push tomain.Note on this PR's own merge
The merge event runs
release-on-merge.ymlfrom the base branch (the old single-PR version), so this landing cuts an old-style single-PR release for 2.31.2. The aggregated span-notes flow takes effect from the next release onward.resolves #488
🤖 Generated with Claude Code
Both workflow files reviewed against the diff and the surrounding logic. Here's my review.
This PR cleanly inverts the release trigger so the version bump — not the merge — is what cuts a release and build, and the aggregated span-notes logic is well thought through (correct handling of the no-previous-release case, untrusted PR text kept out of shell interpolation via
jq -n, and the triggering PR always force-included even if the compare walk finds nothing). I found no blocking issues; a few robustness gaps in the notes aggregation are worth a look.Worth fixing
Intermediate PRs merged without a merge commit are dropped from the notes.
release-on-merge.yml:81filters the compare commits withgrep -E '^Merge pull request 'and pulls the number from(#N). That only matches Forgejo's merge-commit strategy; any PR in the span that was squash- or rebase-merged has no such commit and silently vanishes from the aggregated changelog. The triggering PR is safe (it's prepended from$PR_NUMBERatrelease-on-merge.yml:89), but unbumped PRs that landed since the last release are exactly the ones this feature is meant to surface. Since the repo currently uses merge commits this is latent, but worth a comment noting the dependency, or matching on the PR-number pattern more loosely.The compare walk may be paginated.
release-on-merge.yml:79reads.commits[]from a singlecompare/$base...$MERGE_SHAcall. If Forgejo's compare endpoint caps the returned commit list (Gitea/Forgejo default page sizes apply to several list endpoints), a release spanning many unbumped merges could quietly lose the older PRs. Worth verifying whether that endpoint returns the full range or needs?limit=/paging — a silent truncation reads as "complete notes" when it isn't.Nits
workflow_dispatchbuildsmain's current HEAD, not the dispatched tag.build-image.yml:62-63falls back to parsingpyproject.tomlfrom the checked-out tree, and the checkout atbuild-image.yml:47has no ref, so a manual re-run resolves to whatevermainpoints at now. The header comment (build-image.yml:11) calls this "rebuilds an existing tag," but ifmainhas advanced past that release the:<ver>and:<sha>tags won't match the release you meant to rebuild. Consider accepting aref/tagdispatch input, or softening the comment.:latestcan still be raced by two release builds. The concurrency group is nowbuild-image-${{ github.ref }}(build-image.yml:20), and on areleaseeventgithub.refis the tag — so two distinct releases publishing close together fall into different groups and could overlap on the:latestpush. Release creation is serialized upstream by therelease-on-mergeconcurrency group, so this is low-probability, but the old comment that explained the:latestrace was removed while the race isn't fully gone. A one-line note or a static group for the push step would preserve the rationale.PR-title numbers can leak into the issue/PR scan.
release-on-merge.yml:82-83greps every(#N)out of the merge message; if a PR title itself contains(#123)you'd pick up a spurious number. Cosmetic, and the per-PR lookup degrades to a bare- #Nline, so no crash — just noise.The version bump to
2.31.2and matchinguv.lockupdate are correct per the CLAUDE.md convention, and the CLAUDE.md Deployment section accurately reflects the new gated flow.