Repository navigation
ci: detect changed paths with git instead of the listFiles API - #1242
Merged
Merged
Conversation
`detect changes` called GitHub's pulls/{n}/files endpoint via
dorny/paths-filter to decide which jobs run. That endpoint is a single
point of failure for the whole pipeline: when it 503s this job dies in
8s, every downstream job reports `skipping`, and the `ci-success`
alls-green gate fails — a red PR in which nothing ever compiled.
Not hypothetical. It blocked #1237 today: GitHub served its "Unicorn!"
HTML error page for /pulls/{n}/files repo-wide, an already-merged PR
reproduced it identically (so it was not branch-specific), and the rate
limit was untouched at 4975/5000 (so it was not throttling). Re-running
the failed jobs reproduced it in 8s. No re-run could ever have cleared
it, because nothing was wrong with the code.
`token: ''` is the action's own documented switch for this — its warning
text reads "set token: '' to detect changes using git diff against
'base'". git kept working throughout the REST outage.
Semantics are unchanged, not merely close:
- `actions/checkout` leaves a PR on the merge commit, so paths-filter's
`git diff base..HEAD` is the PR's effective diff — exactly what
listFiles returned.
- Both sides decompose renames into add + delete: the API does it
explicitly to mimic rename detection being off, which the git path
passes literally as `--no-renames`.
- `ensureRefAvailable` self-fetches the base SHA (`fetch --depth=1
origin <sha>`), so the default shallow checkout still resolves it and
no fetch-depth bump is needed.
- The `push` path already used git; this makes both events agree rather
than diverge by trigger.
`pull-requests: read` existed solely for that API call, so it is dropped.
No CHANGELOG entry: CI-internal with no operator-facing surface, per
5cfbaea.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
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
detect changesasked GitHub'spulls/{n}/filesendpoint which paths changed, viadorny/paths-filter. That endpoint is a single point of failure for the entire pipeline: when it 503s, the job dies in 8s, every downstream job (clippy,test,rustfmt, the whole Solidity suite) reportsskipping, and theci-successalls-green gate fails — producing a red PR in which nothing ever compiled.This is live right now, and it is what blocked #1237:
/pulls/{n}/files— the action gets HTML where it expects JSON and logs##[error]<!DOCTYPE html>.No re-run could ever have cleared this, because nothing was wrong with the code.
Fix
token: ''— the action's own documented switch. Its warning text reads "settoken: ''to detect changes using git diff against 'base'". git kept working throughout the REST outage.Semantics are unchanged, not merely close
Verified against the action's source (
main.ts,git.ts):actions/checkoutleaves a PR on the merge commit, sogit diff base..HEADis the PR's effective diff — exactly whatlistFilesreturned.--no-renames.ensureRefAvailableself-fetches the base SHA (fetch --depth=1 origin <sha>), so the default shallow checkout still resolves it — nofetch-depthbump needed.pushpath already used git. This makes both event types agree rather than diverge by trigger.pull-requests: readexisted solely for that API call, so it is dropped.Verification
This PR is its own test. It was opened while the endpoint was still returning 503 — confirmed at push time. If
detect changesgoes green here, the fix is demonstrated against the exact outage it targets, not a simulation of one.The risk worth reviewing is silent under-triggering — a detector that wrongly reports "no rust changed" would skip
test/clippyand letalls-greenpass. Check thedetect changeslog below for the resolved filter outputs: this PR touches only.github/workflows/ci.yml, which therust,adr, andsolidityfilters all list, so all three must come outtrueand the full suite must run.No CHANGELOG entry: CI-internal, no operator-facing surface (cf. 5cfbaea).
🤖 Generated with Claude Code