-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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(metric-issues): Configure workflow notifications by group type #81609
Conversation
@@ -106,7 +106,7 @@ def test_unresolve_ignored_issue(self, issue_unignored: Any) -> None: | |||
self.projects, | |||
self.project_lookup, | |||
acting_user=self.user, | |||
is_bulk=True, | |||
is_bulk=False, |
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.
Here and below, the tests were set up incorrectly.
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #81609 +/- ##
==========================================
+ Coverage 80.36% 80.49% +0.12%
==========================================
Files 7275 7258 -17
Lines 321402 322162 +760
Branches 20962 20805 -157
==========================================
+ Hits 258306 259331 +1025
+ Misses 62685 62432 -253
+ Partials 411 399 -12 |
if "status" not in kwargs: | ||
kwargs["status"] = GroupStatus.UNRESOLVED | ||
kwargs["substatus"] = GroupSubStatus.NEW | ||
|
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.
This fixes any "incorrect substatus for unresolved group" errors that stem from stricter group status validation
…81609) Metric issues, and other detector-controlled issues, need the ability to disable workflow notifications for status changes (i.e. issue resolved/regressed/unresolved) while still sending workflow notifications for other changes to the issue such as assignments and comments. To support this cleanly, this PR adds a field to the GroupType dataclass to allow issue types to disable the status change workflow notifications. Issue activity notifications will continue to be sent for all issue types. For issue types that do not use the existing status change workflow notifications, the issue type will be responsible for sending these notifications. We use the new `enable_status_change_workflow_notifications` field to disable notifications for status-based activity types when activity.send_notification is called. Added a new test to confirm disables notifications for the MetricIssuePOC type and existing tests remain unaffected for error/other issue platform types.
Metric issues, and other detector-controlled issues, need the ability to disable workflow notifications for status changes (i.e. issue resolved/regressed/unresolved) while still sending workflow notifications for other changes to the issue such as assignments and comments.
To support this cleanly, this PR adds a field to the GroupType dataclass to allow issue types to disable the status change workflow notifications. Issue activity notifications will continue to be sent for all issue types. For issue types that do not use the existing status change workflow notifications, the issue type will be responsible for sending these notifications.
We use the new
enable_status_change_workflow_notifications
field to disable notifications for status-based activity types when activity.send_notification is called. Added a new test to confirm disables notifications for the MetricIssuePOC type and existing tests remain unaffected for error/other issue platform types.