Skip to content

feat: Add incbot command handlers#134

Draft
spalmurray wants to merge 31 commits intomainfrom
spalmurray/RELENG-517
Draft

feat: Add incbot command handlers#134
spalmurray wants to merge 31 commits intomainfrom
spalmurray/RELENG-517

Conversation

@spalmurray
Copy link
Copy Markdown
Contributor

Adds the remaining /ft command handlers for incident management from Slack channels: mitigated, resolved, reopen, severity, and subject. Also adds a shared get_incident_from_channel helper, an on_title_changed hook, and updates bolt.py routing + help text. Integration-specific side effects (PagerDuty, Notion, etc.) are left as TODOs for their respective PRs.

@linear-code
Copy link
Copy Markdown

linear-code bot commented Mar 25, 2026

@spalmurray spalmurray force-pushed the spalmurray/RELENG-464 branch from 0c34b6e to 3270b58 Compare March 25, 2026 15:13
@spalmurray spalmurray force-pushed the spalmurray/RELENG-517 branch from a82b97d to 4b4b2b8 Compare March 25, 2026 15:18
@spalmurray spalmurray force-pushed the spalmurray/RELENG-517 branch from 4b4b2b8 to 1d8dc3c Compare March 25, 2026 17:44
Comment on lines +126 to +138
def on_title_changed(incident: Incident, old_title: str) -> None:
try:
channel_id = _get_channel_id(incident)
if not channel_id:
return

_slack_service.post_message(
channel_id,
f"Title changed: {old_title} -> {incident.title}",
)
_slack_service.set_channel_topic(channel_id, _build_channel_topic(incident))
except Exception:
logger.exception(f"Error in on_title_changed for incident {incident.id}")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

New on_title_changed hook lacks unit tests

The new on_title_changed function follows the same pattern as on_status_changed and on_severity_changed, which both have dedicated test classes in test_hooks.py. However, on_title_changed is not imported in the test file and has no corresponding tests. While it's mocked in test_channel_commands.py, this only verifies callers don't crash—it doesn't test the hook's actual behavior (posting messages, updating topics, handling missing Slack links).

Identified by Warden [code-review] · HUE-HPX

@spalmurray spalmurray force-pushed the spalmurray/RELENG-464 branch 5 times, most recently from b5c8cc4 to 01aa167 Compare April 2, 2026 17:26
Base automatically changed from spalmurray/RELENG-464 to main April 3, 2026 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants