-
-
Notifications
You must be signed in to change notification settings - Fork 18
feat: auto-assign SDK team reviewers on skill-drift PRs #92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| # Auto-assign SDK team reviewers on skill-drift PRs based on which skill | ||
| # files were modified. Hardcoded mapping — no agent involvement needed. | ||
|
|
||
| name: Assign SDK Team Reviewers | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened] | ||
| paths: | ||
| - "skills/sentry-*-sdk/**" | ||
|
|
||
| jobs: | ||
| assign-reviewers: | ||
| if: contains(github.event.pull_request.labels.*.name, 'skill-drift') | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| pull-requests: write | ||
| steps: | ||
| - name: Assign SDK team reviewers | ||
| uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inconsistent action version not in lock fileLow Severity The new workflow pins Reviewed by Cursor Bugbot for commit 01ca68b. Configure here. |
||
| with: | ||
| script: | | ||
| // Skill directory → team slug mapping | ||
| const SKILL_TEAMS = { | ||
| 'sentry-android-sdk': 'getsentry/team-mobile', | ||
| 'sentry-browser-sdk': 'getsentry/team-javascript-sdks', | ||
| 'sentry-cloudflare-sdk': 'getsentry/team-javascript-sdks', | ||
| 'sentry-cocoa-sdk': 'getsentry/team-mobile', | ||
| 'sentry-dotnet-sdk': 'getsentry/team-web-sdk-backend', | ||
| 'sentry-elixir-sdk': 'getsentry/team-web-sdk-backend', | ||
| 'sentry-flutter-sdk': 'getsentry/team-mobile-cross-platform', | ||
| 'sentry-go-sdk': 'getsentry/team-web-sdk-backend', | ||
| 'sentry-nestjs-sdk': 'getsentry/team-javascript-sdks', | ||
| 'sentry-nextjs-sdk': 'getsentry/team-javascript-sdks', | ||
| 'sentry-node-sdk': 'getsentry/team-javascript-sdks', | ||
| 'sentry-php-sdk': 'getsentry/team-web-sdk-backend', | ||
| 'sentry-python-sdk': 'getsentry/owners-python-sdk', | ||
| 'sentry-react-native-sdk': 'getsentry/team-mobile-cross-platform', | ||
| 'sentry-react-sdk': 'getsentry/team-javascript-sdks', | ||
| 'sentry-ruby-sdk': 'getsentry/team-web-sdk-backend', | ||
| 'sentry-svelte-sdk': 'getsentry/team-javascript-sdks', | ||
| }; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Team reviewer slugs include invalid org prefixHigh Severity The Additional Locations (1)Reviewed by Cursor Bugbot for commit 01ca68b. Configure here. |
||
|
|
||
| // Get changed files | ||
| const files = await github.paginate( | ||
| github.rest.pulls.listFiles, | ||
| { | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| pull_number: context.payload.pull_request.number, | ||
| } | ||
| ); | ||
|
|
||
| // Collect unique teams from changed skill paths | ||
| const teams = new Set(); | ||
| for (const file of files) { | ||
| const match = file.filename.match(/^skills\/(sentry-[\w-]+-sdk)\//); | ||
| if (match && SKILL_TEAMS[match[1]]) { | ||
| teams.add(SKILL_TEAMS[match[1]]); | ||
| } | ||
| } | ||
|
|
||
| if (teams.size === 0) { | ||
| console.log('No matching skill directories found in changed files'); | ||
| return; | ||
| } | ||
|
|
||
| const teamSlugs = [...teams]; | ||
| console.log(`Requesting review from: ${teamSlugs.join(', ')}`); | ||
|
|
||
| await github.rest.pulls.requestReviewers({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| pull_number: context.payload.pull_request.number, | ||
| team_reviewers: teamSlugs, | ||
| }); | ||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Label check on opened event will never match
High Severity
The workflow only triggers on
pull_request: opened, but the job'sifcondition checks for theskill-driftlabel. The GitHub REST API for creating pull requests doesn't support alabelsparameter — labels are added in a separate API call after creation. Theopenedwebhook event payload reflects PR state at creation time, before labels are attached. This meansgithub.event.pull_request.labelswill always be empty, thecontains(...)check will always be false, and the job will never run. Addinglabeledto thetypeslist would allow the workflow to also trigger when the label is applied.Reviewed by Cursor Bugbot for commit 01ca68b. Configure here.