Skip to content

ci: fix CLA gate reviewer restore and exclude team members from gates#12088

Merged
julian-risch merged 1 commit into
mainfrom
ci/cla-gate-fixes
Jul 21, 2026
Merged

ci: fix CLA gate reviewer restore and exclude team members from gates#12088
julian-risch merged 1 commit into
mainfrom
ci/cla-gate-fixes

Conversation

@julian-risch

@julian-risch julian-risch commented Jul 20, 2026

Copy link
Copy Markdown
Member

Related Issues

Example 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-pending label rather than draft state, and drives any labeled PR to the correct state:

  • CLA signed → restore() (re-request the stored reviewer, remove the label), whether or not it's still a draft.
  • CLA unsigned & still draft → escalate (reminders / close).
  • CLA unsigned & readied anyway → put back to draft, then escalate.

restore() only runs the markPullRequestReadyForReview mutation when the PR is actually a draft, and the status-event path no longer requires the PR to still be a draft.

2. Never gate team members.
author_association was unreliable for excluding the team. Both workflows now also check the effective repository permission (getCollaboratorPermissionLevelwrite/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 requires pull-requests: write. That's the Resource not accessible by integration error in this run. Bumped to pull-requests: write.

How did you test it?

Notes for the reviewer

Checklist

  • I have read the contributors guidelines and the code of conduct.
  • I have updated the related issue with new insights and changes.
  • I have added unit tests and updated the docstrings.
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I have documented my code.
  • I have added a release note file, following the contributors guidelines.
  • I have run pre-commit hooks and fixed any issue.

🤖 Generated with Claude Code

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>
@vercel

vercel Bot commented Jul 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
haystack-docs Ignored Ignored Jul 20, 2026 4:37pm

Request Review

@julian-risch
julian-risch marked this pull request as ready for review July 21, 2026 08:00
@julian-risch
julian-risch requested a review from a team as a code owner July 21, 2026 08:00
@julian-risch
julian-risch requested review from anakin87 and removed request for a team July 21, 2026 08:00

@anakin87 anakin87 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try!

@julian-risch
julian-risch merged commit 4fed5ce into main Jul 21, 2026
24 checks passed
@julian-risch
julian-risch deleted the ci/cla-gate-fixes branch July 21, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants