feat(slack): prompt to claim Commander on auto-raised incidents - #328
Open
juanjogarciatorres43 wants to merge 3 commits into
Open
feat(slack): prompt to claim Commander on auto-raised incidents#328juanjogarciatorres43 wants to merge 3 commits into
juanjogarciatorres43 wants to merge 3 commits into
Conversation
Incidents raised automatically have no human commander (the creator is the automated caller), so post a message in the incident channel asking an invited responder to claim the Commander role. It pings the responders from the incident category and carries its own Update Roles button (self-contained, so message ordering does not matter), reusing the existing role-claim flow. Gated on the incident having a dedup_key: automated sources always set one, while person-declared incidents leave it empty, so it reliably marks an incident with no human commander yet. Added via an incident_channel_done receiver alongside the roles message. Unit tests cover the gate (posts when auto-raised, skips when human-declared) and the message blocks (Update Roles action + category usergroup mentions).
juanjogarciatorres43
marked this pull request as ready for review
July 23, 2026 05:40
…message SlackMessageSurface requires get_text (notification fallback); the class only defined get_blocks, so it could not be instantiated. Add get_text.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #328 +/- ##
==========================================
+ Coverage 68.19% 68.22% +0.03%
==========================================
Files 218 218
Lines 10828 10848 +20
Branches 1228 1230 +2
==========================================
+ Hits 7384 7401 +17
- Misses 3100 3103 +3
Partials 344 344
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Incidents raised automatically have no human commander — the commander defaults to the automated creator (e.g. the Datadog→IMPACT receiver bot). This posts a message in the incident channel asking an invited responder to claim the Commander role, so a human takes command quickly.
What & where
A new
incident_channel_donereceiver (prompt_commander_when_auto_raised) postsSlackMessageIncidentAutoRaisedCommanderCallin the channel.incident.dedup_keybeing set. Automated sources always send adedup_key; person-declared incidents leave it empty, so it reliably marks "no human commander yet". (This is the "only when we're sure it's auto-raised" guard.)UpdateRolesModal.open_action), so it doesn't depend on the ordering of the other channel-creation messages.<!subteam^…>mentions of the Slack usergroups linked to the incident category (the same responders that get invited). Falls back to a generic prompt if the category has no usergroup.Wording is intentionally generic ("raised automatically") rather than Datadog-specific, to match the generic
dedup_keygate.Tests
tests/test_slack/test_auto_raised_commander_prompt.py(mocked): posts whendedup_keyset, skips when empty; message blocks carry the Update-Roles action and the category usergroup mentions.Notes
main.