-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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(workflow-engine): add NewHighPriorityIssueConditionHandler
#82846
Conversation
@@ -6,6 +6,18 @@ | |||
from sentry.workflow_engine.types import DataConditionHandler, WorkflowJob | |||
|
|||
|
|||
def is_new_event(job: WorkflowJob) -> bool: |
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.
nice
comparison=True, | ||
condition_result=True, | ||
) | ||
self.group_event.group.priority = PriorityLevel.HIGH |
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.
should we use update()
for all of these? i feel like it would be better if the DB state reflected the class state
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.
like self.group_event.group.update(priority=PriorityLevel.HIGH)
|
||
# This will only pass for new issues | ||
self.group_event.group.update(priority=PriorityLevel.HIGH) | ||
self.job.update({"group_state": {"is_new_group_environment": True}}) |
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.
i think this needs to be self.job["group_state"]["is_new_group_environment"] = True
. you can call update()
because job
is a dictionary, but mypy is complaining that group_state
is missing some keys.
we should call update()
for self.group_event.group because it's a Django model and we want to save the changes to the db
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #82846 +/- ##
==========================================
+ Coverage 84.84% 84.88% +0.03%
==========================================
Files 9410 9410
Lines 536845 536563 -282
Branches 21049 21049
==========================================
- Hits 455508 455467 -41
+ Misses 80865 80624 -241
Partials 472 472 |
add
NewHighPriorityIssueConditionHandler