← Back to Pull requests

ci: close pull requests from high-volume accounts #7377

Closed
unknown closed this pull request without merging on Nov 04, 2026 15:56 UTC
View on GitHub
unknown unknown commented on Oct 31, 2026 18:21 UTC
Author

Which issue does this PR close?

Closes #7364.

Rationale for this change

The per-repository creation cap in .asf.yaml (github.pull_requests.creation_cap) limits how many PRs an account can have open here, but it cannot see activity in other repositories. Accounts that bulk-submit PRs across many repositories are a review burden we do not have capacity for.

What changes are included in this PR?

  • Adds .github/workflows/close_high_volume_prs.yml. On pull_request_target (opened, reopened) it looks up the author's open PRs across GitHub and, if they have at least 50 open PRs spread across at least 20 repositories, comments, applies the high-volume-account label and closes the PR.

  • Owners, members, collaborators, GitHub Apps (Bot accounts such as Dependabot) and logins in the allowlist are always skipped. Having a PR merged here does not exempt an author, because PRs from automated accounts have been merged before. A reopen by someone other than the author (a maintainer override) is also left alone.

  • The workflow never checks out or runs code from the pull request, which is what makes pull_request_target safe here. Untrusted values reach the script only through environment variables.

  • Optional repository variables tune it: HIGH_VOLUME_MAX_OPEN_PRS, HIGH_VOLUME_MAX_REPOS, HIGH_VOLUME_ALLOWLIST, HIGH_VOLUME_DRY_RUN.

  • A manual workflow_dispatch run scans PRs that are already open. It defaults to a dry run that only reports what it would close.

  • Lists the workflow in .github/workflows/README.md.

  • Adds docs/source/contributor-guide/ai-policy.md, adapted from the Apache DataFusion AI policy (apache/datafusion#24510). It also covers the 3-open-PR limit and the automatic closure of bulk submissions. It is linked from the contributor guide index, the getting started page, the development guide and AGENTS.md.
  • To observe before enforcing, set the repository variable HIGH_VOLUME_DRY_RUN to true.

    How are these changes tested?

  • actionlint passes on the new workflow, prettier --check passes on the new workflow and the docs, and dev/ci/check-ci-config.py passes.

  • I ran the extracted script locally in dry-run mode against real open PRs through the GitHub API. With the default thresholds, first-time contributors with a few open PRs were left alone. With the thresholds lowered, the script reported that it would close the PR. The allowlist and the MEMBER association both skipped the author.

  • The scan mode and the actual comment, label and close calls were not exercised before merge. The script was run on macOS bash 3.2 with two bash 4 expressions swapped out; the workflow runs on ubuntu-latest.
  • Diff: 344 lines (+258 / -86) across 4 files Reviewer: comphead Review duration: 5615m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 344 lines diff across 4 files
    0.42
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.350
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #7377"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.4% (MEDIUM) · Higher = larger blast radius
    42.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 16.7% · Safe to merge
    16.7%