Repository navigation
Fail Patch provenance with a message when git can't read - #9233
Merged
Merged
Conversation
A failed git ls-remote or fetch fails the check with git's message and the usual summary, instead of ending the job with a stack trace. hasFile reads trees with git ls-tree, which fails on a failed read, so a failed read fails the check instead of reading as a missing path. Both git ls-tree calls read paths literally, as git rev-parse <commit>:<path> did. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dmerand
approved these changes
Dec 4, 2026
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.
WHY are these changes introduced?
Two follow-ups from the review of #9228:
git ls-remoteor fetch failed, the job ended with a stack trace and no summary. It failed closed, but didn't say why.hasFileread any git error as a missing path. A missing oclif manifest, for example, skips that file's version check, so a failed read of a tree has to fail the check, as a failed read of a file's text already does. With every commit and tree fetched that shouldn't happen, but the check shouldn't depend on it.WHAT is this pull request doing?
git ls-remoteor fetch fails the check with git's message, for example "Fetching stable/5.2, the pull request and main failed: …", and writes the usual summary.hasFileusesgit ls-tree, which prints nothing for a missing path and fails on a failed read. A failed read fails the check with its message.git ls-treecalls read paths literally (--literal-pathspecs), asgit rev-parse <commit>:<path>did.Nothing else changes. Checked locally: the 35 cases from earlier reviews give the same results and messages as the current file, with every
ghcall refused. Four new cases fail with a message: a failed read of a tree for a Version Packages bump that leaves both oclif manifests behind (the current file passes it), the same for a backport's changeset, and a failed fetch andls-remote(the current file ends without a message). The same file goes tostable/5.2in its own pull request.How to manually test your changes?
Run the check against a repository that doesn't exist (needs git and Node):
It fails at once with "Reading the head of stable/5.2 failed: remote: Repository not found. …", and the summary says the same. With the current file, the same command ends with a stack trace and an empty summary.
🤖 Generated with Claude Code