-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
chore(ACI): Remove workflow engine UI flag on the backend #120712
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
Open
ceorourke
wants to merge
2
commits into
master
Choose a base branch
from
ceorourke/remove-workflow-engine-ui-flag-backend
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,7 +51,6 @@ | |
| assert_last_analytics_event, | ||
| ) | ||
| from sentry.testutils.helpers.datetime import before_now | ||
| from sentry.testutils.helpers.features import with_feature | ||
| from sentry.testutils.silo import assume_test_silo_mode | ||
| from sentry.testutils.skips import requires_snuba | ||
| from sentry.types.activity import ActivityType | ||
|
|
@@ -560,68 +559,6 @@ def test_notify_users_does_email(self, mock_logger, mock_func) -> None: | |
| self.assertEqual(notification.reference, group) | ||
| assert notification.get_subject() == "BAR-1 - hello world" | ||
|
|
||
| assert notification.get_context()["snooze_alert"] is True | ||
|
|
||
| assert group | ||
| mock_logger.info.assert_called_with( | ||
| "mail.adapter.notify", | ||
| extra={ | ||
| "target_type": "IssueOwners", | ||
| "target_identifier": None, | ||
| "group": group.id, | ||
| "project_id": group.project.id, | ||
| "organization": group.organization.id, | ||
| "fallthrough_choice": "ActiveMembers", | ||
| "notification_uuid": mock.ANY, | ||
| }, | ||
| ) | ||
|
|
||
| @mock_notify | ||
| @mock.patch("sentry.notifications.notifications.rules.logger") | ||
| @with_feature("organizations:workflow-engine-ui") # snooze | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this the only test we had for workflow_engine + email? if so, instead of removing it, should we update the test to only use the workflow models / calls to ensure the email is sent? |
||
| def test_notify_users_does_email_workflow_engine_ui(self, mock_logger, mock_func) -> None: | ||
| self.create_user_option(user=self.user, key="timezone", value="Europe/Vienna") | ||
| event_manager = EventManager({"message": "hello world", "level": "error"}) | ||
| event_manager.normalize() | ||
| event_data = event_manager.get_data() | ||
| event_type = get_event_type(event_data) | ||
| event_data["type"] = event_type.key | ||
| event_data["metadata"] = event_type.get_metadata(event_data) | ||
|
|
||
| event = event_manager.save(self.project.id) | ||
| group = event.group | ||
|
|
||
| self.create_notification_settings_provider( | ||
| user_id=self.user.id, | ||
| scope_type="user", | ||
| scope_identifier=self.user.id, | ||
| provider="slack", | ||
| type="alerts", | ||
| value="never", | ||
| ) | ||
| ProjectOwnership.objects.create(project_id=self.project.id, fallthrough=True) | ||
| rule = self.create_project_rule( | ||
| project=self.project, action_data=[{"workflow_id": "1234567890"}] | ||
| ) | ||
| with self.tasks(): | ||
| AlertRuleNotification( | ||
| Notification(event=event, rules=[rule]), | ||
| ActionTargetType.ISSUE_OWNERS, | ||
| fallthrough_choice=FallthroughChoiceType.ACTIVE_MEMBERS, | ||
| ).send() | ||
|
|
||
| assert mock_func.call_count == 1 | ||
|
|
||
| args, kwargs = mock_func.call_args | ||
| notification = args[1] | ||
|
|
||
| recipient_context = notification.get_recipient_context(Actor.from_orm_user(self.user), {}) | ||
| assert recipient_context["timezone"] == zoneinfo.ZoneInfo("Europe/Vienna") | ||
|
|
||
| self.assertEqual(notification.project, self.project) | ||
| self.assertEqual(notification.reference, group) | ||
| assert notification.get_subject() == "BAR-1 - hello world" | ||
|
|
||
| # Because we are using the workflow engine, the snooze_alert context should be False | ||
| # This is because a user cannot snooze a workflow for themselves | ||
| assert notification.get_context()["snooze_alert"] is False | ||
|
|
||
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
Oops, something went wrong.
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.
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.
maybe we don't even need this going forward since there is no snoozing?
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.
yeah! I think we'll be able to start removing this stuff. 🎉