🐛 fix(ci): a skipped coverage upload failed the gate on every fork PR - #815
Merged
Merged
Conversation
`upload-coverage-python` does not run for a pull request from a fork: it needs `code-quality: write`, which a fork's token does not carry, so its `if:` gates on `head.repo.full_name == github.repository`. But it is listed unconditionally in the `CI Pass` gate's `needs`, and `alls-green` counts a skipped required job as a failure. So every fork PR went red with all seven real jobs green -- GalacticDynamics#812 merged that way, and GalacticDynamics#813 is sitting on the same red now. A permanently failing gate is worse than no gate: it stops carrying information about the runs that do matter. `allowed-skips` excuses the skip and nothing else. The job stays in `needs`, so on a same-repo push, where it does run, a failure still fails the gate. `allowed-failures` would have been the wrong knob -- it would have excused a genuine upload failure too. The other seven required jobs carry no `if:`, so this is the only one that can skip. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The change is narrowly scoped, matches the stated CI failure mode, and uses a supported allowed-skips input on the pinned alls-green action version.
Pull request overview
Fixes the CI Pass gate incorrectly failing on fork pull requests when upload-coverage-python is intentionally skipped due to missing code-quality: write permissions on fork tokens.
Changes:
- Configures the
re-actors/alls-greengate to treatupload-coverage-pythonas an allowed skip (while still failing the gate if that job runs and fails on same-repo PRs/pushes).
File summaries
| File | Description |
|---|---|
.github/workflows/ci.yml |
Allows the gate to accept a skipped upload-coverage-python job, preventing false-red CI on fork PRs while keeping same-repo enforcement intact. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #815 +/- ##
=======================================
Coverage 96.91% 96.91%
=======================================
Files 272 272
Lines 9433 9433
=======================================
Hits 9142 9142
Misses 291 291 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
CI Passhas been failing on every pull request from a fork, with all seven real jobs green:Why
upload-coverage-pythonneedscode-quality: write, which a fork's token does not carry, so it is correctly gated:But it is listed unconditionally in the gate's
needs, andalls-greencounts a skipped required job as a failure. The two are individually right and wrong together.Nothing was wrong with the coverage job or with the PRs. #812 merged showing
FAILUREon a run where format, smoke, tests_linux, tests_nonlinux, tests_subprocess, check_oldest and docs all passed, and #813 is sitting on the same red now. That is the real cost here: a gate that is always red stops carrying information about the runs that do matter, and a genuine failure would look identical.The fix
allowed-skips: upload-coverage-python— one line, and it excuses the skip and nothing else.The job stays in
needs, so on a same-repo push, where it does run, a failure still fails the gate.allowed-failureswas the wrong knob for exactly that reason: it would have excused a genuine upload failure too. Verified against the action'saction.ymlat the pinned SHA rather than from memory — both inputs exist and the semantics differ as described.The other seven required jobs carry no
if:, soupload-coverage-pythonis the only one that can skip; this is the whole fix, not one instance of a pattern.Verification
prek run --all-filesclean, including the workflow-schema hook. Parsed the result to confirm the gate still requires the job while excusing only its skip, and that noallowed-failurescrept in. The behaviour this changes is only observable in CI: this PR is itself a fork PR, so its ownCI Passis the test — red before, green after.🤖 Generated with Claude Code