Fix CI parallel mode detection for org members without team access#8182
Conversation
Signed-off-by: Yuri Shkuro <github@ysh.us>
There was a problem hiding this comment.
Pull request overview
Adjusts the CI Orchestrator’s “parallel vs sequential” mode selection logic to better identify trusted PR authors, aiming to reduce CI latency for maintainers while keeping external contributions on the safer sequential path.
Changes:
- Replaces
author_association-only logic with a GitHub API org membership check (with fallback toauthor_association). - Refines PR-specific mode determination messaging and flow (keeps bot + label-based parallel enablement).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8182 +/- ##
==========================================
+ Coverage 95.67% 95.70% +0.02%
==========================================
Files 317 317
Lines 16747 16747
==========================================
+ Hits 16023 16027 +4
+ Misses 571 568 -3
+ Partials 153 152 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Problem
The CI orchestrator determines whether to run stages in parallel (faster, ~10m) or sequentially (~30m) based on whether the PR author is a trusted contributor. For org members, it relied on
github.event.pull_request.author_associationfrom the event payload, expecting it to beMEMBER.However, GitHub sets
author_associationbased on the user's access to the repository, not org membership. Org members who don't belong to any team with repo access (e.g., external contributors added to the org specifically for CI benefits) getauthor_association: CONTRIBUTORinstead ofMEMBER. This caused their PRs to run in slow sequential mode despite being org members.Discovered on PR #8138 where user Manik2708 — a verified org member for months — was incorrectly classified as "not an org member" because they had no team assignments.
Fix
Replace the
author_associationcheck with a live GitHub API call (gh api orgs/jaegertracing/members/{user}) that directly verifies org membership regardless of team/repo access. If the API call fails (e.g., due to reduced token permissions on fork PRs), falls back to the originalauthor_associationcheck so behavior is no worse than before.AI Usage in this PR (choose one)
See AI Usage Policy.