Skip to content

chore: Add PR validation workflow#1334

Closed
stephanie-anderson wants to merge 2 commits intomasterfrom
chore/add-validate-pr-workflow
Closed

chore: Add PR validation workflow#1334
stephanie-anderson wants to merge 2 commits intomasterfrom
chore/add-validate-pr-workflow

Conversation

@stephanie-anderson
Copy link
Copy Markdown
Contributor

Summary

  • Adds a validate-pr.yml workflow to automatically validate non-maintainer PRs
  • Checks that PRs reference a GitHub issue with prior discussion between the author and a maintainer
  • Closes PRs that don't meet contribution guidelines (no issue reference, no maintainer discussion, or issue assigned to someone else)
  • Enforces that all PRs start as drafts

Rollout of getsentry/sentry-python#4233 across all SDK repos.

Test plan

  • Verify workflow file is valid YAML
  • Confirm SDK_MAINTAINER_BOT_APP_ID var and SDK_MAINTAINER_BOT_PRIVATE_KEY secret are available to this repo
  • Test with a non-maintainer PR that has no issue reference (should be closed)
  • Test with a maintainer PR (should be skipped)

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

Automatically validates non-maintainer PRs by checking:
- Issue reference exists in PR body
- Referenced issue has discussion between author and maintainer
- Referenced issue is not assigned to someone else

Also enforces that all PRs start as drafts.

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 ✨

  • Update Sentry SDKs to v10.46.0 by github-actions in #1330
  • Update Sentry SDKs to v10.45.0 by github-actions in #1325
  • Update Sentry SDKs to v10.43.0 by github-actions in #1321

Internal Changes 🔧

  • Add PR validation workflow by stephanie-anderson in #1334
  • New Electron versions by github-actions in #1326
  • New Electron versions by github-actions in #1324
  • Migrate to oxlint by timfish in #1323
  • New Electron versions by github-actions in #1322

🤖 This preview updates automatically when you update the PR.

@stephanie-anderson stephanie-anderson marked this pull request as ready for review March 27, 2026 14:10
@dingsdax dingsdax self-requested a review March 27, 2026 14:34
@timfish
Copy link
Copy Markdown
Collaborator

timfish commented Mar 27, 2026

Sorry, the Ubuntu e2e tests have started being really flakey this week. Something must have changed in a new GHA runner release?

Working on it but for now will keep bashing Re-run failed tests to get this PR passing 😂

@stephanie-anderson
Copy link
Copy Markdown
Contributor Author

Oh damn, thank you @timfish !

@stephanie-anderson stephanie-anderson enabled auto-merge (squash) March 27, 2026 15:01
@timfish
Copy link
Copy Markdown
Collaborator

timfish commented Mar 27, 2026

Every minute it's getting worse and worse so I suspect it might be a GHA issue. Low disk space warnings and crazy stuff getting logged!

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.


for (const user of usersToCheck) {
if (user === prAuthor) continue;
if (await isMaintainer(repo.owner, repo.repo, user)) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Maintainer check uses PR repo instead of issue repo

Medium Severity

The isMaintainer call at the discussion-validation step passes repo.owner, repo.repo (the PR's repository) instead of ref.owner, ref.repo (the referenced issue's repository). The comment on line 193 confirms the intent was to check "on the issue's repo." For cross-repo references (e.g., a PR on sentry-electron referencing an issue in sentry), a maintainer of sentry who discussed the approach in the issue would not be recognized if they lack maintain access on sentry-electron, causing valid PRs to be incorrectly closed.

Fix in Cursor Fix in Web

@stephanie-anderson
Copy link
Copy Markdown
Contributor Author

Closing in favor of rolling this out via the shared composite action in getsentry/github-workflows#153

auto-merge was automatically disabled March 27, 2026 17:35

Pull request was closed

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.

2 participants