This repository was archived by the owner on Sep 3, 2025. It is now read-only.
feat(snooze): limit entities in snooze to only those in case#5901
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
src/dispatch/plugins/dispatch_slack/case/interactive.py:731
- When subject.type is Case, ensure that the retrieved case has at least one associated signal instance before accessing case.signal_instances[0]. This prevents a potential index error in cases where no signal instance is linked.
elif subject.type == CaseSubjects.case:
aliciamatsumoto
approved these changes
Apr 18, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This pull request enhances the entity selector in the Slack snooze modal by only showing entities from signal instances associated with the given case.
Key Changes:
Service Layer Enhancements:
get_all_desc_by_signalfunction insrc/dispatch/entity/service.pyto accept an optionalcase_idparameter. This allows the function to filter entities not only by signal but also by case, if provided.Slack Plugin Modifications:
snooze_button_clickfunction insrc/dispatch/plugins/dispatch_slack/case/interactive.pyto pass thecase_idwhen retrieving entities, ensuring that only relevant entities are displayed.create_action_buttons_messagefunction insrc/dispatch/plugins/dispatch_slack/case/messages.pyto usecase_button_metadatafor button actions, aligning with the new case-based filtering logic.entity_selectfunction insrc/dispatch/plugins/dispatch_slack/fields.pyto include thecase_idparameter, filtering the dropdown to show entities from only signals in the case.Testing:
tests/entity/test_entity_service.pyto verify the behavior ofget_all_desc_by_signalwith and without thecase_idparameter. These tests ensure that the function correctly filters entities based on the provided case.