Skip to content

ci: fix release-notes commit range for manual/backport releases - #370

Merged
Abhijeet Prasad (AbhiPrasad) merged 1 commit into
mainfrom
release-notes-commit-log-fixes
Sep 11, 2026
Merged

ci: fix release-notes commit range for manual/backport releases#370
Abhijeet Prasad (AbhiPrasad) merged 1 commit into
mainfrom
release-notes-commit-log-fixes

Conversation

@starfolkai

@starfolkai starfolkai Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #368, which merged before its automated review comments were addressed. Both Codex findings were valid P2 edge cases; this PR fixes them.

Fixes

1. End the commit range at the released tag (not the dispatch SHA)
On a manual workflow_dispatch where inputs.tag points at a different commit than the run's github.sha, the range previously ran to the branch tip. Now the endpoint is resolved from the tag when it already exists, and falls back to the release commit otherwise (the normal push flow, where the tag is created at that commit in the same job).

2. Pick the previous tag from the release ancestry
Re-publishing an older or backport release while a higher stable version exists previously selected that newer tag as previous_tag (yielding an empty/divergent newer..older log and an unrelated compare link). The candidate search is now restricted to git tag --merged <release commit>, so it picks the nearest preceding stable tag in the release's own history.

Also drops an unused range_heading variable.

Validation

Simulated both scenarios against the real repo history:

  • Normal push (v0.19.3): previous tag v0.19.2, lists v0.19.3's commits, compare v0.19.2...v0.19.3. ✅
  • Backport re-publish (v0.19.2 while v0.19.3 exists): previous tag correctly resolves to v0.19.1 (old logic wrongly picked v0.19.3), lists only v0.19.2's commits, compare v0.19.1...v0.19.2. ✅

Workflow YAML validated.

🤖 Generated with Claude Code

Created by Abhijeet Prasad (@AbhiPrasad)

Slack thread

Addresses two review findings from #368:

- Resolve the release endpoint from the tag when it already exists (e.g. a
  manual workflow_dispatch of an existing tag), instead of always using the
  dispatch ref's github.sha, which could list commits through the branch tip.
- Restrict the previous-tag search to the release commit's ancestry
  (`git tag --merged`), so re-publishing an older or backport release picks
  the nearest preceding stable tag rather than a newer, unrelated one.

Also drops an unused range_heading variable.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) merged commit 0bcd6fa into main Sep 11, 2026
19 checks passed
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.

2 participants