Skip to content

Commit fdb4eeb

Browse files
HazATclaude
andauthored
feat: auto-assign SDK team reviewers on skill-drift PRs (#92)
* feat: skill drift workflow opens PRs with fixes and assigns SDK teams Extend the weekly skill-drift-check workflow to directly fix straightforward drift by opening PRs instead of only creating issues. The agent now: - Prefers opening PRs for mechanical changes (new config options, version bumps, new integration entries) with the fix applied inline - Falls back to issues for complex/risky drift (breaking API removals, ambiguous behavior, coordinated rewrites) - Uses add_reviewer to assign the appropriate SDK team (from the mapping table) as reviewer on each PR - PRs are opened as ready-for-review (not draft) with auto-labels and 14-day expiry Frontmatter changes: - Added create-pull-request safe output (max 10, non-draft, protected supply-chain files fall back to issues) - Added add-reviewer safe output restricted to the 5 SDK team slugs - Recompiled lock.yml with gh-aw v0.64.2 (was v0.55.0) Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com> * feat: auto-assign SDK team reviewers on skill-drift PRs Add a lightweight workflow that triggers on PR open for skill-drift labeled PRs. It checks which skills/sentry-*-sdk/ directories were modified and requests review from the corresponding SDK team via a hardcoded mapping. This removes the dependency on the agentic workflow remembering to call add_reviewer — team assignment happens deterministically based on file paths regardless of how the PR was created. Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com> * fix: use org-prefixed team slugs for reviewer assignment The requestReviewers API needs the full org/team-slug format (e.g., getsentry/team-javascript-sdks) to resolve teams correctly. Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4 <noreply@anthropic.com>
1 parent d414035 commit fdb4eeb

1 file changed

Lines changed: 76 additions & 0 deletions

File tree

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Auto-assign SDK team reviewers on skill-drift PRs based on which skill
2+
# files were modified. Hardcoded mapping — no agent involvement needed.
3+
4+
name: Assign SDK Team Reviewers
5+
6+
on:
7+
pull_request:
8+
types: [opened]
9+
paths:
10+
- "skills/sentry-*-sdk/**"
11+
12+
jobs:
13+
assign-reviewers:
14+
if: contains(github.event.pull_request.labels.*.name, 'skill-drift')
15+
runs-on: ubuntu-latest
16+
permissions:
17+
pull-requests: write
18+
steps:
19+
- name: Assign SDK team reviewers
20+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
21+
with:
22+
script: |
23+
// Skill directory → team slug mapping
24+
const SKILL_TEAMS = {
25+
'sentry-android-sdk': 'getsentry/team-mobile',
26+
'sentry-browser-sdk': 'getsentry/team-javascript-sdks',
27+
'sentry-cloudflare-sdk': 'getsentry/team-javascript-sdks',
28+
'sentry-cocoa-sdk': 'getsentry/team-mobile',
29+
'sentry-dotnet-sdk': 'getsentry/team-web-sdk-backend',
30+
'sentry-elixir-sdk': 'getsentry/team-web-sdk-backend',
31+
'sentry-flutter-sdk': 'getsentry/team-mobile-cross-platform',
32+
'sentry-go-sdk': 'getsentry/team-web-sdk-backend',
33+
'sentry-nestjs-sdk': 'getsentry/team-javascript-sdks',
34+
'sentry-nextjs-sdk': 'getsentry/team-javascript-sdks',
35+
'sentry-node-sdk': 'getsentry/team-javascript-sdks',
36+
'sentry-php-sdk': 'getsentry/team-web-sdk-backend',
37+
'sentry-python-sdk': 'getsentry/owners-python-sdk',
38+
'sentry-react-native-sdk': 'getsentry/team-mobile-cross-platform',
39+
'sentry-react-sdk': 'getsentry/team-javascript-sdks',
40+
'sentry-ruby-sdk': 'getsentry/team-web-sdk-backend',
41+
'sentry-svelte-sdk': 'getsentry/team-javascript-sdks',
42+
};
43+
44+
// Get changed files
45+
const files = await github.paginate(
46+
github.rest.pulls.listFiles,
47+
{
48+
owner: context.repo.owner,
49+
repo: context.repo.repo,
50+
pull_number: context.payload.pull_request.number,
51+
}
52+
);
53+
54+
// Collect unique teams from changed skill paths
55+
const teams = new Set();
56+
for (const file of files) {
57+
const match = file.filename.match(/^skills\/(sentry-[\w-]+-sdk)\//);
58+
if (match && SKILL_TEAMS[match[1]]) {
59+
teams.add(SKILL_TEAMS[match[1]]);
60+
}
61+
}
62+
63+
if (teams.size === 0) {
64+
console.log('No matching skill directories found in changed files');
65+
return;
66+
}
67+
68+
const teamSlugs = [...teams];
69+
console.log(`Requesting review from: ${teamSlugs.join(', ')}`);
70+
71+
await github.rest.pulls.requestReviewers({
72+
owner: context.repo.owner,
73+
repo: context.repo.repo,
74+
pull_number: context.payload.pull_request.number,
75+
team_reviewers: teamSlugs,
76+
});

0 commit comments

Comments
 (0)