Automated community request assignment - #5147
Conversation
|
/ok to test 62234ab |
|
/ok to test 33734ca |
|
/ok to test 3a7ae02 |
|
/ok to test cd43c6f |
|
/ok to test f1d4f7e |
|
/claude strict-review |
There was a problem hiding this comment.
Code Review Summary
PR: Automated community request assignment — Adds /claude assign command that uses Claude to analyze community issues and assign the best owner (or fall back to oncall), with Slack DM notifications. Also extracts shared GitHub-Slack utilities into github_slack_utils.py.
Findings
| Severity | Count |
|---|---|
| CRITICAL | 0 |
| IMPORTANT | 2 |
| SUGGESTION | 3 |
Key findings
-
[IMPORTANT Correctness] — Race condition between queued workflow runs. The
github.event.issue.assignee == nullguard uses the webhook payload snapshot, not live state. Withcancel-in-progress: false, two rapid/claude assigncomments both pass the guard and both assign (potentially different) users. Fix: add a live assignee check at the start of the assignment job. -
[IMPORTANT Correctness] —
GH_TOKENfallback togithub.tokenlacks org scope. Thesecrets.X || secrets.Y || github.tokenchain silently degrades to the default GITHUB_TOKEN, which cannot query org team membership (/orgs/{org}/teams/{slug}/members). The failure is loud (sys.exit), but a comment documenting the required token scopes would prevent setup confusion. -
[SUGGESTION Simplification] — Duplicate
get_headers()betweencommunity_request_assignee.py(Bearer auth, versioned API) andgithub_slack_utils.py(token auth, v3 API). Both are called in the same process. Could be unified. -
[SUGGESTION Simplification] — Hardcoded topic-to-user mapping in the Claude prompt will become stale; consider extracting to a data file.
-
[SUGGESTION Naming] —
is_service_accountrelies on an undocumentedsvcprefix heuristic.
Overall assessment
Low risk. The assignment logic is well-structured with clear separation of concerns (analysis parsing, candidate validation, oncall fallback, Slack notification). The shared utility extraction is clean and maintains backward compatibility for oncall_manager.py and sync_team_usergroups.py. Test coverage is thorough for the core decision logic.
The race condition (finding 1) is the most actionable item — a single live-state check would close it. The other findings are quality improvements, not blockers.
Signed-off-by: Philip Petrakian <ppetrakian@nvidia.com>
Signed-off-by: Philip Petrakian <ppetrakian@nvidia.com>
Signed-off-by: Philip Petrakian <ppetrakian@nvidia.com>
|
/ok to test 0e286dd |
Signed-off-by: Philip Petrakian <ppetrakian@nvidia.com>
Signed-off-by: Philip Petrakian <ppetrakian@nvidia.com>
Signed-off-by: Philip Petrakian <ppetrakian@nvidia.com>
|
/ok to test dc4f29a |
Signed-off-by: Philip Petrakian <ppetrakian@nvidia.com>
|
/ok to test d992e58 |
Signed-off-by: Philip Petrakian <ppetrakian@nvidia.com>
Signed-off-by: Philip Petrakian <ppetrakian@nvidia.com>
|
/ok to test efc75f7 |
chtruong814
left a comment
There was a problem hiding this comment.
Just had a question on permissions needed. But overall LGTM.
Signed-off-by: Philip Petrakian <ppetrakian@nvidia.com>
Signed-off-by: Philip Petrakian <ppetrakian@nvidia.com>
|
/ok to test a4794ca |
|
/claude review |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/28131126613 |
Summary
Adds a comment-triggered Claude workflow for triaging unassigned community issues:
/claude assign: asks Claude to determine the best issue assignee./claude assign @github-login: uses the requested GitHub user as the assignee while still generating issue context for the Slack notification./claude assign @Phlip79; GitHub@autocomplete should provide the right spellingmcore-engineers, the workflow commentsUser @... does not exist or is not part of mcore-engineersand stops instead of silently falling back to on-callThe workflow only runs for issue comments on issues, not pull requests, and only repository users with
write,maintain, oradminpermission can trigger it.Refactor
.github/scripts/github_slack_utils.py.community_request_assignee.py,oncall_manager.py, andsync_team_usergroups.pyinstead of duplicating GitHub username to Slack user resolution.Bearerauth and the versioned GitHub REST API header.GH_TOKEN, with noGITHUB_TOKENfallback for assignment.Slack fallback
ISSUE_BOT_SLACK_TOKENwhen the assigned user's GitHub account resolves to an@nvidia.comemail.@nvidia.com, the workflow does not attempt Slack lookup. It leaves a GitHub issue comment instead:The user was assigned to the issue, but I was unable to send the slack message.secrets.PATvia a separateISSUE_COMMENT_TOKEN; assignment still usessecrets.NVIDIA_MCORE_ONCALL_TOKEN.