fix(ci): refetch PR before labeling new contributors - #3229
Merged
Conversation
TomCC7
requested review from
Dreamsorcerer,
leshy,
paul-nechifor and
spomichter
as code owners
July 27, 2026 21:57
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #3229 +/- ##
==========================================
- Coverage 74.90% 74.89% -0.01%
==========================================
Files 1114 1114
Lines 106086 106086
Branches 9665 9665
==========================================
- Hits 79459 79456 -3
- Misses 23817 23820 +3
Partials 2810 2810
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
TomCC7
enabled auto-merge
July 27, 2026 22:51
paul-nechifor
approved these changes
Jul 27, 2026
Collaborator
|
Not obvious to me this is the correct cause of that failure, but difficult to test without merging. |
Member
Author
yeah ci is so annoying to test orz |
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.
Contribution path
Small, safe change that does not need a tracking issue.
Problem
The
first-time-contributorjob trustedauthor_associationfrom thepull_request_target.openedpayload. For PR #3226, that snapshot reportedNONE, while a fresh pull request API response reportedFIRST_TIME_CONTRIBUTOR. The job returned early and skipped the label.Solution
Refetch the pull request with
pulls.getbefore evaluatingauthor_association. The job still runs only foropened, retains the label as a snapshot, executes no PR code, and keeps its existing narrow permissions.How to Test
uv run python -c 'import pathlib, yaml; assert "first-time-contributor" in yaml.safe_load(pathlib.Path(".github/workflows/pr-labels.yml").read_text())["jobs"]'Also compiled the embedded
github-scriptas an async function and exercisedFIRST_TIMER,FIRST_TIME_CONTRIBUTOR, andNONEwith a mocked stale opened-event payload.git diff --checkpasses. PR #3226 was backfilled with the label.AI assistance
Codex with GPT-5 diagnosed the CI failure, implemented the workflow change, and ran the validation harness. The author reviewed the requested fix and PR creation.
Checklist