Fix detect-changed-benchmarks: handle shallow base fetch (no merge base)#1595
Merged
ChrisRackauckas merged 1 commit intoMay 30, 2026
Conversation
detect-changed-benchmarks.sh fetches the PR base at --depth=1 and then runs a three-dot diff (origin/master...HEAD), which requires a merge base. Once master advances past the PR's branch point, the depth=1 base graft shares no ancestor with HEAD, so git aborts with "fatal: origin/master...HEAD: no merge base" (exit 128) and the Detect Changed Benchmarks job fails. This broke re-runs of e.g. SciML#1581 and SciML#1570. Suppress the three-dot error and fall back to diffing the PR merge commit against its first parent (HEAD~1 = base tip), which yields exactly the PR's changes without needing a merge base. This mirrors the existing robust pattern already used on the push path in the same script. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.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.
Problem
.github/scripts/detect-changed-benchmarks.shfails the Detect Changed Benchmarks job on PR re-runs with:The PR path does:
The three-dot range
origin/master...HEADdiffs from the merge base of the two commits, which requires a common ancestor to exist locally. But the base is re-fetched at--depth=1(an orphan graft with no ancestors). Oncemasteradvances past the PR's branch point, the depth=1 base tip shares no ancestor withHEAD, so git aborts with "no merge base" (exit 128). That line has no|| true, so underset -eo pipefailthe whole step fails.This is why it's intermittent: a freshly-dispatched PR (base == current master tip) finds a merge base, but a re-run after master moves on does not.
Observed
Both fail at this exact line; it is latent for the whole v7-refresh batch on any re-run.
Fix
Suppress the three-dot error and fall back to diffing the PR merge commit against its first parent (
HEAD~1= base tip), which yields exactly the PR's changes without needing a merge base. This mirrors the robust2>/dev/null || true+HEAD~1pattern already used on the push path in the same script.Verification
Reproduced the failure locally in a scratch repo recreating the CI condition (master advanced past the merge ref's base; base re-fetched at
--depth=1):fatal: origin/master...HEAD: no merge base(exit 128) — matches CI exactly.bash -npasses on the edited script.🤖 Generated with Claude Code