Skip to content

ci: format CUOPT_SLACK_MENTION_ID as subteam when ID starts with S#1187

Merged
rgsl888prabhu merged 1 commit intoNVIDIA:mainfrom
rgsl888prabhu:ci/slack-subteam-mention
May 7, 2026
Merged

ci: format CUOPT_SLACK_MENTION_ID as subteam when ID starts with S#1187
rgsl888prabhu merged 1 commit intoNVIDIA:mainfrom
rgsl888prabhu:ci/slack-subteam-mention

Conversation

@rgsl888prabhu
Copy link
Copy Markdown
Collaborator

Summary

  • Detect user-group (subteam) IDs by their S prefix and emit <!subteam^S...> syntax.
  • User IDs (prefix U/W) continue to use <@U...>.
  • Update the contract comment to spell out both forms and warn that handle names alone will not ping.

Why

Today's nightly Slack post (2026-05-07) showed @cuopt-ci-team rendered as plain text — the message arrived but produced no notification. Root cause: ci/utils/generate_slack_payloads.py always wrapped CUOPT_SLACK_MENTION_ID as <@id>, which is user-only syntax. Slack requires <!subteam^SXXXXXXXX> to ping a user group. Passing the group's handle name (cuopt-ci-team) or its S... ID with the old formatter both fail silently.

Test plan

  • CUOPT_SLACK_MENTION_ID=SXXXXXXXX → next nightly with new failures pings the cuopt-ci-team group.
  • Sanity-check that a user ID (U...) still renders as <@U...> (no behavior change for that path).
  • Empty/unset CUOPT_SLACK_MENTION_ID produces no mention (existing behavior preserved).

Notes

Builds on #1182, which plumbs the CUOPT_SLACK_MENTION_ID secret through the workflow. Either order of merge works; this PR only touches the formatter.

Slack user and user-group mentions use different syntax: <@U...> for
users, <!subteam^S...> for user groups. The previous code always wrapped
the ID as <@...>, so passing a user-group ID rendered as plain text and
produced no notification.

Detect user-group IDs by their S prefix and emit the subteam syntax,
keeping the user-mention path unchanged. Update the contract comment to
spell out both forms and warn that handle names will not ping.
@rgsl888prabhu rgsl888prabhu requested a review from a team as a code owner May 7, 2026 18:47
@rgsl888prabhu rgsl888prabhu requested a review from jakirkham May 7, 2026 18:47
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: e1555182-ab98-49c8-96af-80f9b8013f2e

📥 Commits

Reviewing files that changed from the base of the PR and between b38e56d and 1e55ba9.

📒 Files selected for processing (1)
  • ci/utils/generate_slack_payloads.py

📝 Walkthrough

Walkthrough

The PR updates ci/utils/generate_slack_payloads.py to conditionally format Slack mentions based on the CUOPT_SLACK_MENTION_ID environment variable. The logic now supports subteam mentions (IDs starting with S) using <!subteam^{id}> format, user mentions for other non-empty values using <@{id}> , and disables mentions when the value is empty.

Changes

Slack Mention Format Enhancement

Layer / File(s) Summary
Conditional Mention Formatting
ci/utils/generate_slack_payloads.py
Slack mention tag generation updated with conditional logic: <!subteam^{id}> for IDs starting with S, <@{id}> for other non-empty values, empty for blank values.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title directly and clearly summarizes the main change: updating Slack mention formatting to use subteam syntax when the ID starts with 'S'.
Description check ✅ Passed The description is clearly related to the changeset, providing context about why the change is needed, what was changed, and how it will be tested.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@rgsl888prabhu rgsl888prabhu self-assigned this May 7, 2026
@rgsl888prabhu rgsl888prabhu added non-breaking Introduces a non-breaking change improvement Improves an existing functionality labels May 7, 2026
@rgsl888prabhu rgsl888prabhu removed the request for review from jakirkham May 7, 2026 18:50
@rgsl888prabhu rgsl888prabhu merged commit 90be081 into NVIDIA:main May 7, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improves an existing functionality non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants