Repository navigation
Fail fast on bad inputs and harden PR metadata fetching - #3
Merged
Merged
Conversation
A shallow source checkout could silently resolve dependencies against terminal branches, and a dependency lacking the root branch aborted the whole run even though its evidence was optional. The PR metadata fetch also degraded silently on network errors or missing token permissions. Fail fast when the source is a shallow clone, reject duplicate output prefixes, skip evidence from dependencies without the root branch, and retry PR fetches with a timeout while reporting the HTTP status. Ambiguity errors now list the required stack levels, terminal fallbacks log why, and CI runs shellcheck. Tests cover the shallow, no-root and duplicate-prefix cases.
With curl --retry, the bodies of failed attempts remain concatenated in captured stdout, so a successful retry parsed as HTTP 200 with a body jq could not read and PR evidence was discarded. curl truncates the -o output file on every attempt, so capture the body there and the final status code on stdout.
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.
Same changes as #2, which was accidentally merged into the stale
t3code/fix-stacked-branch-resolverbranch instead ofmain; this PR targetsmaindirectly.The resolver had several silent failure modes: a shallow source checkout (missing
fetch-depth: 0) made it quietly resolve dependencies against terminal branches, a dependency repository lacking the root branch aborted the entire run even though its evidence was optional, duplicate output prefixes silently overwrote each other, and a failed PR metadata fetch (network blip, missing tooling, restricted token) degraded without explanation and surfaced later as a confusing ambiguity error.This makes the resolver fail loudly and cheaply instead:
pull-requests: readpermission.