-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
feat(aci): Set up resolution condition for use in UI #105156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(aci): Set up resolution condition for use in UI #105156
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #105156 +/- ##
===========================================
- Coverage 80.72% 80.62% -0.11%
===========================================
Files 9418 9417 -1
Lines 406044 403988 -2056
Branches 25662 25662
===========================================
- Hits 327783 325716 -2067
- Misses 77792 77803 +11
Partials 469 469 |
| group = event_data.group | ||
| return group.status == comparison | ||
| is_resolved = group.status == GroupStatus.RESOLVED | ||
| return is_resolved == comparison |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, i don't think we'll be able to just modify the existing condition. This data is also stored in the DB and would require a migration to change, and i think we'd still need this condition for some legacy alerts as well.
Instead, i was thinking maybe we could just reuse the ISSUE_RESOLUTION_CHANGE condition and hardcode the info, but not sure how we'd be able to tell the difference between them in the UI to show w/o a new condition type now that i think about that...
So instead, I think it'll probably need to be a fully new data condition.
Maybe something like this:
# src/sentry/workflow_engine/handlers/condition/issue_resolved_trigger_condition.py
@condition_handler_registry.register(Condition.ISSUE_RESOLVED_TRIGGER)
class IssueResolvedTriggerCondition(DataConditionHandler[WorkflowEventData]):
group = DataConditionHandler.Group.WORKFLOW_TRIGGER
@staticmethod
def evaluate_value(event_data: WorkflowEventData, _: Any) -> bool:
group = event_data.group
return group.status == GroupStatus.RESOLVEDThis should also be automatically added to the correct API with the group = DataConditionHandler.Group.WORKFLOW_TRIGGER being set, so it'd just be this file + the new Condition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm are you sure this condition is in use? I queried for it in the database and couldn't find any instances of it: https://redash.getsentry.net/queries/10176/source
Happy to make a new one as well, just thought that this one was dangling unused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh, we'll need this for: https://linear.app/getsentry/issue/ISWF-821/data-condition-issue-priority-resolution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@saponifi3d ah okay gotcha - added the new data condition and reverted this one
Adds a new condition which triggers on the resolution of an issue.