Skip to content

Automated community request assignment - #5147

Merged
Phlip79 merged 28 commits into
NVIDIA:mainfrom
Phlip79:philip/community-request-assignee
Jun 24, 2026
Merged

Automated community request assignment#5147
Phlip79 merged 28 commits into
NVIDIA:mainfrom
Phlip79:philip/community-request-assignee

Conversation

@Phlip79

@Phlip79 Phlip79 commented Jun 4, 2026

Copy link
Copy Markdown
Member
  • I, the PR author, have personally reviewed every line of this PR.

Summary

Adds a comment-triggered Claude workflow for triaging unassigned community issues:

  • /claude assign: asks Claude to determine the best issue assignee.
    • only assigns to a member of mcore-engineers
  • /claude assign @github-login: uses the requested GitHub user as the assignee while still generating issue context for the Slack notification.
    • the explicit login must match the GitHub username exactly, e.g. /claude assign @Phlip79; GitHub @ autocomplete should provide the right spelling
    • if the requested user does not exist or is not part of mcore-engineers, the workflow comments User @... does not exist or is not part of mcore-engineers and stops instead of silently falling back to on-call

The workflow only runs for issue comments on issues, not pull requests, and only repository users with write, maintain, or admin permission can trigger it.

Refactor

  • Extracts shared GitHub-to-Slack user lookup helpers into .github/scripts/github_slack_utils.py.
  • Reuses those helpers from community_request_assignee.py, oncall_manager.py, and sync_team_usergroups.py instead of duplicating GitHub username to Slack user resolution.
  • Consolidates GitHub API auth header construction through the shared helper, using Bearer auth and the versioned GitHub REST API header.
  • Keeps the issue-assignment path explicit about requiring GH_TOKEN, with no GITHUB_TOKEN fallback for assignment.

Slack fallback

  • Sends Slack DMs through ISSUE_BOT_SLACK_TOKEN when the assigned user's GitHub account resolves to an @nvidia.com email.
  • If the resolved email does not end with @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.
  • The fallback issue comment uses secrets.PAT via a separate ISSUE_COMMENT_TOKEN; assignment still uses secrets.NVIDIA_MCORE_ONCALL_TOKEN.

@copy-pr-bot

copy-pr-bot Bot commented Jun 4, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@Phlip79

Phlip79 commented Jun 4, 2026

Copy link
Copy Markdown
Member Author

/ok to test 62234ab

@Phlip79

Phlip79 commented Jun 4, 2026

Copy link
Copy Markdown
Member Author

/ok to test 33734ca

@Phlip79

Phlip79 commented Jun 4, 2026

Copy link
Copy Markdown
Member Author

/ok to test 3a7ae02

@Phlip79

Phlip79 commented Jun 4, 2026

Copy link
Copy Markdown
Member Author

/ok to test cd43c6f

@Phlip79

Phlip79 commented Jun 12, 2026

Copy link
Copy Markdown
Member Author

/ok to test f1d4f7e

@Phlip79

Phlip79 commented Jun 12, 2026

Copy link
Copy Markdown
Member Author

/claude strict-review

Comment thread .github/workflows/community-request-assignee.yml
Comment thread .github/scripts/community_request_assignee.py Outdated
Comment thread .github/workflows/community-request-assignee.yml
Comment thread .github/scripts/community_request_assignee.py Outdated
Comment thread .github/scripts/community_request_assignee.py
Comment thread .github/workflows/community-request-assignee.yml

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

  1. [IMPORTANT Correctness]Race condition between queued workflow runs. The github.event.issue.assignee == null guard uses the webhook payload snapshot, not live state. With cancel-in-progress: false, two rapid /claude assign comments both pass the guard and both assign (potentially different) users. Fix: add a live assignee check at the start of the assignment job.

  2. [IMPORTANT Correctness]GH_TOKEN fallback to github.token lacks org scope. The secrets.X || secrets.Y || github.token chain 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.

  3. [SUGGESTION Simplification] — Duplicate get_headers() between community_request_assignee.py (Bearer auth, versioned API) and github_slack_utils.py (token auth, v3 API). Both are called in the same process. Could be unified.

  4. [SUGGESTION Simplification] — Hardcoded topic-to-user mapping in the Claude prompt will become stale; consider extracting to a data file.

  5. [SUGGESTION Naming]is_service_account relies on an undocumented svc prefix 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.

Phlip79 added 3 commits June 14, 2026 00:36
Signed-off-by: Philip Petrakian <ppetrakian@nvidia.com>
Signed-off-by: Philip Petrakian <ppetrakian@nvidia.com>
Signed-off-by: Philip Petrakian <ppetrakian@nvidia.com>
@Phlip79

Phlip79 commented Jun 14, 2026

Copy link
Copy Markdown
Member Author

/ok to test 0e286dd

Phlip79 added 3 commits June 14, 2026 01:10
Signed-off-by: Philip Petrakian <ppetrakian@nvidia.com>
Signed-off-by: Philip Petrakian <ppetrakian@nvidia.com>
Signed-off-by: Philip Petrakian <ppetrakian@nvidia.com>
@Phlip79

Phlip79 commented Jun 14, 2026

Copy link
Copy Markdown
Member Author

/ok to test dc4f29a

Signed-off-by: Philip Petrakian <ppetrakian@nvidia.com>
@Phlip79

Phlip79 commented Jun 14, 2026

Copy link
Copy Markdown
Member Author

/ok to test d992e58

Phlip79 added 2 commits June 23, 2026 23:42
Signed-off-by: Philip Petrakian <ppetrakian@nvidia.com>
Signed-off-by: Philip Petrakian <ppetrakian@nvidia.com>
@Phlip79

Phlip79 commented Jun 23, 2026

Copy link
Copy Markdown
Member Author

/ok to test efc75f7

@chtruong814 chtruong814 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just had a question on permissions needed. But overall LGTM.

Comment thread .github/workflows/community-request-assignee.yml Outdated
Phlip79 added 2 commits June 24, 2026 18:06
Signed-off-by: Philip Petrakian <ppetrakian@nvidia.com>
Signed-off-by: Philip Petrakian <ppetrakian@nvidia.com>
@Phlip79

Phlip79 commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

/ok to test a4794ca

@Phlip79

Phlip79 commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

/claude review

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started!

You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/28131126613

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved All necessary approvals have been made complexity: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants