ci: fix CLA gate reviewer restore and exclude team members from gates#12088
Merged
Conversation
Two fixes plus a related permissions bug: 1. Re-assign the reviewer when a contributor marks a gated PR ready for review themselves after signing the CLA (e.g. #12037). The sweep now drives any cla-pending PR to the right state regardless of draft status, and the status-event path no longer requires the PR to still be a draft. restore() only runs the ready-for-review mutation when the PR is actually a draft. 2. Never gate team members. author_association is unreliable here: private org members appear as CONTRIBUTOR/NONE in webhook and API payloads (this is why the flood guard fired for a maintainer on #12074). Both workflows now check effective repository permission (write/admin) instead of, and in addition to, the association. 3. pr_flood_guard commented on the PR with only pull-requests: read, which yields "Resource not accessible by integration" (a PR comment needs pull-requests: write, not issues: write). It had never successfully posted a warning. Fixed the permission scope. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
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.
Related Issues
properties(create_tool_from_function, @tool, ComponentTool) #12037exit_reasonto Agent #12074Example PR where commenting worked (but not the flood guard) #12037
Proposed Changes:
1. Re-assign the reviewer when a contributor self-readies a gated PR after signing.
The sweep now keys off the
cla-pendinglabel rather than draft state, and drives any labeled PR to the correct state:restore()(re-request the stored reviewer, remove the label), whether or not it's still a draft.restore()only runs themarkPullRequestReadyForReviewmutation when the PR is actually a draft, and thestatus-event path no longer requires the PR to still be a draft.2. Never gate team members.
author_associationwas unreliable for excluding the team. Both workflows now also check the effective repository permission (getCollaboratorPermissionLevel→write/admin), which is reliable regardless of membership visibility. The association check is kept as a fast path.3. Fix pr_flood_guard comment permission
The flood guard declared
pull-requests: read+issues: write, but a comment on a PR requirespull-requests: write. That's theResource not accessible by integrationerror in this run. Bumped topull-requests: write.How did you test it?
Notes for the reviewer
Checklist
fix:,feat:,build:,chore:,ci:,docs:,style:,refactor:,perf:,test:and added!in case the PR includes breaking changes.🤖 Generated with Claude Code