Skip to content

fix(ci): refetch PR before labeling new contributors - #3229

Merged
TomCC7 merged 2 commits into
mainfrom
cc/fix/newbie-label-ci
Jul 28, 2026
Merged

fix(ci): refetch PR before labeling new contributors#3229
TomCC7 merged 2 commits into
mainfrom
cc/fix/newbie-label-ci

Conversation

@TomCC7

@TomCC7 TomCC7 commented Jul 27, 2026

Copy link
Copy Markdown
Member

Contribution path

Small, safe change that does not need a tracking issue.

Problem

The first-time-contributor job trusted author_association from the pull_request_target.opened payload. For PR #3226, that snapshot reported NONE, while a fresh pull request API response reported FIRST_TIME_CONTRIBUTOR. The job returned early and skipped the label.

Solution

Refetch the pull request with pulls.get before evaluating author_association. The job still runs only for opened, 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-script as an async function and exercised FIRST_TIMER, FIRST_TIME_CONTRIBUTOR, and NONE with a mocked stale opened-event payload. git diff --check passes. 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

  • I have read and approved the CLA.

@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

@@            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              
Flag Coverage Δ
OS-ubuntu-24.04-arm 68.50% <ø> (-0.01%) ⬇️
OS-ubuntu-latest 70.51% <ø> (-0.01%) ⬇️
Py-3.10 70.51% <ø> (-0.01%) ⬇️
Py-3.11 70.51% <ø> (-0.01%) ⬇️
Py-3.12 70.51% <ø> (-0.01%) ⬇️
Py-3.13 70.51% <ø> (-0.01%) ⬇️
Py-3.14 70.51% <ø> (-0.01%) ⬇️
Py-3.14t 70.51% <ø> (-0.01%) ⬇️
SelfHosted-Large 29.33% <ø> (+<0.01%) ⬆️
SelfHosted-Linux 35.93% <ø> (ø)
SelfHosted-macOS 35.02% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@TomCC7
TomCC7 enabled auto-merge July 27, 2026 22:51
@Dreamsorcerer

Copy link
Copy Markdown
Collaborator

Not obvious to me this is the correct cause of that failure, but difficult to test without merging.

@TomCC7

TomCC7 commented Jul 27, 2026

Copy link
Copy Markdown
Member Author

Not obvious to me this is the correct cause of that failure, but difficult to test without merging.

yeah ci is so annoying to test orz

@TomCC7
TomCC7 added this pull request to the merge queue Jul 28, 2026
@github-actions github-actions Bot added the ready-to-merge Required CI checks have passed on this PR label Jul 28, 2026
Merged via the queue into main with commit 68bb0bd Jul 28, 2026
33 checks passed
@TomCC7
TomCC7 deleted the cc/fix/newbie-label-ci branch July 28, 2026 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Required CI checks have passed on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants