Skip to content

ci: add community PR gates (CLA draft gate, linked issue sync, flood guard) - #3638

Merged
julian-risch merged 2 commits into
mainfrom
ci/community-pr-gates
Jul 28, 2026
Merged

ci: add community PR gates (CLA draft gate, linked issue sync, flood guard)#3638
julian-risch merged 2 commits into
mainfrom
ci/community-pr-gates

Conversation

@julian-risch

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

Copy link
Copy Markdown
Member

Related Issues

Part of https://github.com/deepset-ai/haystack-private/issues/461

Proposed Changes:

Bring the CLA/review/draft PR automations from deepset-ai/haystack#11995 (+ follow-ups) to this repo.

CI_cla_draft_gate.yml — reduces review load from first-time-contributor PRs without a signed CLA:

  • If a first-timer's PR is older than 1h and license/cla isn't green, convert it to draft, remove the requested reviewer (remembered in a hidden comment marker), label cla-pending, and explain why.
  • When the CLA is signed, mark it ready for review again and re-request the same reviewer — including when the contributor readies the PR themselves after signing.
  • Escalates while gated: reminder at 5 days, warning at 10 days, auto-close at 14 days.
  • Team members are never gated. author_association is unreliable (private org members show up as CONTRIBUTOR/NONE), so it checks effective repo permission (write/admin).
  • Opt out per-PR with the skip-cla-reminder label.

CI_linked_issue_review.yml — when a PR links an issue, assigns the requested reviewer to that issue (only if nobody is assigned yet) and moves it to :eyes: In review on project #5. An assigned issue signals other contributors that it's taken, preventing duplicate PRs.

CI_pr_flood_guard.yml — on newly opened external PRs, warns if another open PR already targets the same linked issue (duplicate) or the author has more than two open PRs, asking them to hold off until the queue clears.

How did you test it?

  • Behavior was tested in haystack repo

Notes for the reviewer

  • No new secrets are needed
  • Logic is identical to the haystack workflows (including the latest fixes: team-member exemption, reviewer re-assignment on self-ready, and pull-requests: write on the flood guard so it can post comments). Only the workflow name: fields and the CI_ filename prefix were changed.

Checklist

🤖 Generated with Claude Code

…guard)

Port the three reviewer-load automations from deepset-ai/haystack to this
repo. All three rely on infrastructure already present here: the `license/cla`
commit status, the org-level `HAYSTACK_BOT_TOKEN` and `GH_PROJECT_PAT` secrets,
and Open Source project #5.

- CI_cla_draft_gate.yml: drafts first-time contributor PRs whose CLA isn't
  signed within 1h, unassigns the reviewer, and restores both when it's signed;
  escalates (reminder/warning/close) over 14 days. Team members are exempt via
  effective repo permission (author_association is unreliable for private org
  members).
- CI_linked_issue_review.yml: assigns the requested reviewer to the linked
  issue (only if unassigned) and moves it to "In review" on project #5.
- CI_pr_flood_guard.yml: warns on duplicate PRs for the same issue or more than
  two open PRs from the same external author.

Files use the CI_ prefix so CI_comment_fork_prs.yml doesn't mistake them for
integration folders.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@julian-risch
julian-risch marked this pull request as ready for review July 23, 2026 07:29
@julian-risch
julian-risch requested a review from a team as a code owner July 23, 2026 07:29
@julian-risch
julian-risch requested review from davidsbatista and removed request for a team July 23, 2026 07:29

@davidsbatista davidsbatista left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks good!

@julian-risch
julian-risch merged commit 1d7214c into main Jul 28, 2026
7 checks passed
@julian-risch
julian-risch deleted the ci/community-pr-gates branch July 28, 2026 11:18
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