fix(ci): fall back to collaborator permission API in e2e/functional gate - #2673
Conversation
The author_association field in pull_request_target event payloads misreports org members whose membership visibility is private — returning CONTRIBUTOR or NONE instead of MEMBER. This blocked e2e and functional tests for legitimate maintainers like maruiz93 on PR #2671. Add a has_write_permission fallback that uses the collaborator permission API (repos/{owner}/{repo}/collaborators/{user}/permission) when author_association is untrusted. This API correctly resolves org membership regardless of visibility and works with the existing GITHUB_TOKEN permissions (contents: read). The same approach was already adopted for agent dispatch authorization in PR #1688. Closes: #2671 Assisted-by: Claude Opus 4.6 <noreply@anthropic.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Ralph Bean <rbean@redhat.com>
PR Summary by QodoFix e2e/functional CI gate by falling back to collaborator permission API Description
Diagram
High-Level Assessment
Files changed (5)
|
Site previewPreview: https://6ae4b01b-site.fullsend-ai.workers.dev Commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
🤖 Finished Review · ✅ Success · Started 6:32 PM UTC · Completed 6:43 PM UTC |
Code Review by Qodo
1. Silent permission check failures
|
ReviewFindingsHigh
Labels: PR modifies CI e2e/functional authorization gate scripts and workflows. |
ifireball
left a comment
There was a problem hiding this comment.
nice that we can finally fix it.
|
Thanks for the reviews, all! |
|
🤖 Finished Retro · ❌ Failure · Started 5:29 PM UTC · Completed 5:36 PM UTC |
Summary
author_associationfield inpull_request_targetevent payloads misreports org members with private membership visibility — returningCONTRIBUTORorNONEinstead ofMEMBER. This blocked e2e and functional tests for maintainers like @maruiz93 on feat(sandbox): adopt provider-backed policy composition #2671.has_write_permissionfallback using the collaborator permission API (repos/{owner}/{repo}/collaborators/{user}/permission), which resolves correctly regardless of visibility. Works with existingGITHUB_TOKENpermissions (contents: read).Test plan
bash scripts/check-e2e-authorization-test.sh)🤖 Generated with Claude Code