Skip to content

ci: Add workflow to close unvetted non-maintainer PRs#5895

Merged
stephanie-anderson merged 5 commits intomasterfrom
ci/close-unvetted-non-maintainer-prs
Mar 27, 2026
Merged

ci: Add workflow to close unvetted non-maintainer PRs#5895
stephanie-anderson merged 5 commits intomasterfrom
ci/close-unvetted-non-maintainer-prs

Conversation

@stephanie-anderson
Copy link
Copy Markdown
Contributor

Adds a GitHub Action that automatically closes PRs from non-maintainers (users without write+ repo access) that don't meet contribution requirements.

The workflow runs on pull_request_target: [opened] and checks three conditions, closing the PR with a specific message for each:

  1. No issue reference — PR body must reference a getsentry issue (#123, getsentry/repo#123, or full GitHub URL)
  2. No maintainer discussion — both the PR author and a maintainer must have participated in the referenced issue (opening the issue counts as participation)
  3. Issue assigned to someone else — if the issue has assignees and none of them are the PR author, the work is already claimed

If a PR references multiple issues, it stays open as long as ANY referenced issue passes all checks. Uses the SDK Maintainer Bot app token for API calls, consistent with the existing draft enforcement workflow.

All closures add the violating-contribution-guidelines label and link to CONTRIBUTING.md.

Automatically closes PRs from non-maintainers that don't meet
contribution requirements: must reference a getsentry issue with
prior discussion between the PR author and a maintainer, and the
issue must not be assigned to someone else.

Adds the 'violating-contribution-guidelines' label and posts a
reason-specific comment explaining next steps.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Langchain

  • Set gen_ai.operation.name and gen_ai.pipeline.name on LLM spans by ericapisani in #5849
  • Broaden AI provider detection beyond OpenAI and Anthropic by ericapisani in #5707
  • Update LLM span operation to gen_ai.generate_text by ericapisani in #5796

Bug Fixes 🐛

Ci

  • Use gh CLI to convert PR to draft by stephanie-anderson in #5874
  • Use GitHub App token for draft PR enforcement by stephanie-anderson in #5871

Openai

  • Always set gen_ai.response.streaming for Responses by alexander-alderman-webb in #5697
  • Simplify Responses input handling by alexander-alderman-webb in #5695
  • Use max_output_tokens for Responses API by alexander-alderman-webb in #5693
  • Always set gen_ai.response.streaming for Completions by alexander-alderman-webb in #5692
  • Simplify Completions input handling by alexander-alderman-webb in #5690
  • Simplify embeddings input handling by alexander-alderman-webb in #5688

Other

  • (google-genai) Guard response extraction by alexander-alderman-webb in #5869
  • (workflow) Fix permission issue with github app and PR draft graphql endpoint by Jeffreyhung in #5887

Internal Changes 🔧

Langchain

  • Add text completion test by alexander-alderman-webb in #5740
  • Add tool execution test by alexander-alderman-webb in #5739
  • Add basic agent test with Responses call by alexander-alderman-webb in #5726
  • Replace mocks with httpx types by alexander-alderman-webb in #5724
  • Consolidate span origin assertion by alexander-alderman-webb in #5723
  • Consolidate available tools assertion by alexander-alderman-webb in #5721

Openai

  • Replace mocks with httpx types for streaming Responses by alexander-alderman-webb in #5882
  • Replace mocks with httpx types for streaming Completions by alexander-alderman-webb in #5879
  • Move input handling code into API-specific functions by alexander-alderman-webb in #5687

Other

  • (ai) Rename generate_text to text_completion by ericapisani in #5885
  • (asyncpg) Normalize query whitespace in integration by ericapisani in #5855
  • Add workflow to close unvetted non-maintainer PRs by stephanie-anderson in #5895
  • Exclude compromised litellm versions by alexander-alderman-webb in #5876
  • Reactivate litellm tests by alexander-alderman-webb in #5853
  • Add note to coordinate with assignee before PR submission by sentrivana in #5868
  • Temporarily stop running litellm tests by alexander-alderman-webb in #5851

Other

  • ci+docs: Add draft PR enforcement by stephanie-anderson in #5867

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 2026

Codecov Results 📊

1728 passed | ⏭️ 221 skipped | Total: 1949 | Pass Rate: 88.66% | Execution Time: 2m 31s

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 12049 uncovered lines.


Generated by Codecov Action

stephanie-anderson and others added 2 commits March 27, 2026 09:42
Everyone at Sentry has write access to this repo, so write-level
permission is too broad for the maintainer bypass. Only users with
admin or maintain roles should skip the contribution validation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cache isMaintainer API results to avoid redundant permission checks
when the same users appear across multiple referenced issues.

Add null guards for issue.user and comment.user, which GitHub's API
returns as null for deleted or suspended accounts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@stephanie-anderson stephanie-anderson marked this pull request as ready for review March 27, 2026 08:58
@stephanie-anderson stephanie-anderson requested a review from a team as a code owner March 27, 2026 08:58
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

The GitHub API's permission field uses legacy values where the
maintain role is mapped to write, making it impossible to distinguish
maintainers from regular write-access users. The role_name field
provides the actual assigned role.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When a PR references a cross-repo issue, the discussion participants
should be checked for maintainer status on the PR's target repo, not
the issue's repo. A sentry-python maintainer commenting on a
getsentry/sentry issue should still count as vetting the work.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@stephanie-anderson stephanie-anderson merged commit 851e94c into master Mar 27, 2026
167 of 169 checks passed
@stephanie-anderson stephanie-anderson deleted the ci/close-unvetted-non-maintainer-prs branch March 27, 2026 09:29
stephanie-anderson added a commit that referenced this pull request Mar 27, 2026
…5896)

Restructures CONTRIBUTING.md to reflect the new automated PR validation
gates and improve navigability.

- Merges the previously separate "Submitting Changes" and "Pull
Requests" sections into a single "Submitting Changes" section with clear
subsections: "Before You Start", "Making Your Contribution", "Pull
Request Requirements", "AI Use", and "Automated Checks"
- Adds an "Automated Checks" subsection documenting the three gates
enforced by the new `close-unvetted-pr.yml` workflow (issue reference,
prior discussion, assignee check)
- Adds a table of contents for easier navigation

Companion to #5895.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants