Repository navigation
Fix phantom version bump in release-readiness - #1497
Merged
Mikola Lysenko (mikolalysenko) merged 1 commit intoOct 13, 2026
Merged
Conversation
github.event.pull_request.base.sha can lag behind the main commit that refs/pull/N/merge was actually built on. When a PR merges main across a release, the stale base still carries the old version, so the job sees a phantom version bump, runs --tag-check and fails because the new tag already exists (PR #1489, run 38444545888: base 285a5e8 at 5.0.0, merge built on d4af25a at 5.0.1). Read the base from the first parent of the checked-out merge commit instead; that is exactly the base the tested tree was merged onto. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LgS1BwdcQfkDYXqbXL8uUA
Collaborator
Author
|
bugbot run Generated by Claude Code |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 64211d4. Configure here.
Tanmay Singla (Tanmay182003)
approved these changes
Oct 13, 2026
Mikola Lysenko (mikolalysenko)
deleted the
ci-janitor/release-readiness-merge-base
branch
October 13, 2026 19:59
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.
Problem
release-readinessfailed falsely on PR #1489 after it merged main across the 5.0.1 release (run 38444545888):The PR didn't bump anything. The event's
pull_request.base.shawas285a5e8(main before the release, 5.0.0), but the tested merge commitc59161awas "Merge 36b49c6 into d4af25a" (current main, 5.0.1). That turnedci-okred for a version bump that wasn't real. The next push went green. The same thing can happen to any open PR that merges main after a release lands while the event payload's base lags.Root cause
github.event.pull_request.base.shaisn't guaranteed to be the commitrefs/pull/N/mergewas built on. It can lag behind the base branch.Fix
Read the base from the first parent of the checked-out merge commit (
git cat-file -p HEAD, which works in the depth-1 checkout) and drop theBASE_SHAenv. That parent is exactly the base the tested tree was merged onto. Real version-bump PRs (release/v*) still see main's old version as the parent and run--tag-check. Therelease-syncpath is unchanged.Proof
--depth 1as actions/checkout does, and the parsed first parent matched the moved base tip, which then fetched by SHA.d4af25a(5.0.1). That means no bump, so it runs--sync-only, which is what the following green run did.Where tests run
Nothing removed or moved. Job and check names are unchanged.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LgS1BwdcQfkDYXqbXL8uUA
Generated by Claude Code
Note
Low Risk
CI-only change to how the release-readiness gate picks the base commit; no runtime or release publish behavior changes.
Overview
Fixes false version-bump failures in the
release-readinessCI job when a PR mergesmainafter a release lands.The job used
github.event.pull_request.base.shato read the baseCargo.tomlversion, but that SHA can lag behind the commitrefs/pull/N/mergewas actually built on. That made merges-across-release look like5.0.0 → 5.0.1bumps and triggered--tag-checkeven though the PR did not change the version.Change: drop the
BASE_SHAworkflow env and set it from the first parent ofHEAD(the checked-out merge commit) viagit cat-file, then fetch that object for the version comparison. Real bump PRs and therelease-syncpath are unchanged.Reviewed by Cursor Bugbot for commit 64211d4. Configure here.