ci: anchor RC release notes at the previous tag in version order#54
Merged
Conversation
The previous baseline logic for `vX.Y.Z-rc1` only looked for an earlier RC of the same `X.Y.Z` base and otherwise fell back to the most recent production tag. When the RC1 came from a new patch line (e.g. v0.3.1-rc1 cut on top of v0.3.0-rcN), the fallback reached past every prior RC and anchored at the last production tag, dragging in every PR since then. The resulting release notes covered the wrong range. Drop the fallback and pick the tag immediately before the current ref in version order, regardless of whether that tag is an RC or production. Sort -V handles rc1/rc10 ordering. Awk walks the sorted list and remembers the line that precedes the current ref. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
v0.3.1-rc1was released with auto-generated notes covering every PR sincev0.2.2, not the PRs sincev0.3.0-rc1. The body has been edited manually but the bug stays inrelease.ymland would bite the next RC1 cut on a new patch line.Root cause
The "Determine previous tag for changelog" step had two branches for RC tags:
X.Y.Z.For
vX.Y.Z-rc1cut on a new patch line, branch 1 returned empty and the fallback reached pastv(X.Y-1).Z-rcNall the way to the last production tag.Fix
Drop the fallback. Pick the tag immediately before the current ref in version order (RC or production, whichever is closest). Verified locally with
sort -V | awkagainst:v0.3.1-rc1→v0.3.0-rc1✓ (was:v0.2.2)v0.4.0-rc1→v0.3.1-rc1✓v0.3.1-rc2→v0.3.1-rc1✓ (still routes through the same-base branch first)Test plan
v0.3.1-rc1release body viagh api releases/generate-notes+gh release edit(already done out-of-band).