Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
gregberge
force-pushed
the
fix/test-merge-parents-on-shallow-clone
branch
from
September 7, 2026 17:18
33e19b1 to
30bad01
Compare
4 tasks
…raft getCommitParents() read the parents with "git rev-list --parents", which honours the shallow graft: on the shallow clones CI uses, every commit at the boundary of the fetched history is reported as having no parent. That is exactly the commit we ask about - the test-merge commit HEAD sits on - so the answer came from a "git fetch --depth=2 origin <sha>" instead, once per build, over the network, for a commit the remote has to still be willing to serve. The commit object carries its parent SHAs whatever the graft says, so reading the object answers locally and cannot fail on the network, on lock contention, or on a remote that has stopped advertising the commit. Only the SHAs come back this way - the parent objects can still be absent - which is all the one caller needs, and is now written down. With the fetch gone the function is synchronous, and the deepening path it existed for is unreachable: getTestMergeBaseCommitSha only calls it after establishing that the commit is HEAD, so its object is always present. An explicit maxBuffer replaces the bound the old command got for free from printing nothing but SHAs. Reading the object and failing to read it are also reported apart now. Both used to log "is not a merge commit", which blames the commit's shape for a commit we never managed to look at. The existing tests build a full local repository, where the parents are readable whatever git is asked, so none of them covered the shallow checkout CI actually uses. The new one does, with the remote pointed at a path that does not exist. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
gregberge
force-pushed
the
fix/test-merge-parents-on-shallow-clone
branch
from
September 7, 2026 18:28
30bad01 to
2d598f8
Compare
jsfez
approved these changes
Sep 7, 2026
Member
Author
|
For the record: the "older baseline" report that started this was not caused by anything in the CLI — see argos-ci/argos#2586. The server sorted baseline candidates by position as text ( This PR's change is still worth having on its own terms: reading parents from the commit object removes a per-build network fetch and the graft dependency, and the shallow-checkout path finally has a test. But it should be reviewed as a cleanup, not as a fix for that report — the description already says so, and this confirms it. |
This branch was successfully deployed
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.
Description
getCommitParents()read the parents withgit rev-list --parents, which honours the shallow graft: on the shallow clones CI uses, every commit at the boundary of the fetched history is reported as parentless. That is exactly the commit we ask about — the test-merge commitHEADsits on — so the answer came from agit fetch --depth=2 origin <sha>instead: once per build, over the network, for a commit the remote has to still be willing to serve.The object carries the parent SHAs whatever the graft says, so reading it answers locally. Only the SHAs come back this way — the parent objects can still be absent — which is all the one caller needs, and is now written down in the JSDoc.
With the fetch gone the function is synchronous, and the deepening path it existed for is unreachable anyway:
getTestMergeBaseCommitShaonly calls it after establishing the commit isHEAD, so its object is always present. An explicitmaxBufferreplaces the bound the old command got for free from printing nothing but SHAs.Reading the object and failing to read it are now reported apart. Both used to log
is not a merge commit, which blames the commit's shape for a commit we never managed to look at.The existing tests build a full local repository, where the parents are readable whatever git is asked, so none of them covered the shallow checkout CI actually uses. The new one does, with the remote pointed at a path that does not exist; it fails without the change.
This is a robustness fix, not the fix for the "older baseline" reports. See below.
Type of changes
bugChecklist
Further comments
A
console.warnwas here and has been droppedAn earlier revision warned when a run on a merge ref could not identify its test merge. A review of it found the trigger was wrong in a way that made it net-negative, so it is gone:
checkRunsOnMergeRefinspectedGITHUB_REF, which the runner sets from the trigger, not from whatactions/checkoutchecked out. On apull_requestevent that is alwaysrefs/pull/<n>/merge, so the predicate reduced toGITHUB_EVENT_NAME === "pull_request"and fired on two fallbacks this file documents as correct: aref: ${{ github.event.pull_request.head.sha }}checkout, and a configuredreferenceBranch. The existing tests atgithub-actions.test.ts:103and:123assert those configs are right; they only stayed silent becausecreateContextleavesGITHUB_REFunset, an env real Actions never produces.oraowns stderr incli/src/commands/upload.ts, so it was partially overwritten by the next spinner frame.playwright/src/reporter.tsloopsupload()), so three times for a three-browser matrix.The diagnostic intent survives in the
debugchannel, which is where the per-guard detail already lives. Doing this properly means givingService.getMergeBaseCommitShaa way to say "this answer is a guess" — itsPromise<string | null>cannot — and warning once centrally, which also covers the sharedgit.tspath that degrades worse (no baseline at all) and silently. That touchestypes.tsand seven services, so it belongs in its own change.What the investigation ruled out
Chasing a reported build on a light-app project (GitHub Actions, 24 build names in one monorepo, a push to
masterevery ~2 minutes), against the production database and real runners in argos-ci/argos-test-repository#22:/baselinewas called." No — they had concluded more than five minutes before.refs/pull/<n>/mergewhen the base branch moves.mainwas advanced and the merge ref was unchanged 15 minutes later.git fetch --depth=2 origin $GITHUB_SHAreturned 0 and the resolver still resolved correctly atfetch-depth: 1.fetch-depthis a red herring.@argos-ci/core@6.8.3, with identicalbaseBranchandbaseBranchResolvedFrom.build_reviewsrows on any of the skipped baselines.The baseline walk is correct: run
34122664365is textbook, withdesign-system-kit— the one build name without a build at the nearer commit — correctly falling back further.The one thing that would settle it
In the failing run, two jobs resolved
400f4496/0344ca3eand the other 21 resolved65ec16f2, 85 minutes older. Whether that is a bug turns on a single fact the database cannot answer:getMergeBase()is returning different values for identical inputs in one run.65ec16f2was the correct answer, and the complaint is really that in a monorepo a package untouched for 90 minutes legitimately gets a 90-minute-old baseline.🤖 Generated with Claude Code