Draft
Conversation
Applied via @cursor push command
0c34b6e to
3270b58
Compare
a82b97d to
4b4b2b8
Compare
4b4b2b8 to
1d8dc3c
Compare
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}") |
There was a problem hiding this comment.
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
b5c8cc4 to
01aa167
Compare
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.
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.