Skip to content

Commit 8ae1821

Browse files
committed
minor cleanup / info from a bot review
1 parent bbb45b0 commit 8ae1821

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

src/sentry/workflow_engine/defaults/workflows.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ def create_priority_workflow(org: Organization) -> Workflow:
110110

111111

112112
def ensure_default_workflows(project: Project) -> list[Workflow]:
113-
workflows: list[Workflow] = []
114-
workflows.append(create_priority_workflow(project.organization))
113+
workflows = [create_priority_workflow(project.organization)]
115114
connect_workflows_to_issue_stream(project, workflows)
116115

117116
return workflows

tests/sentry/integrations/slack/tasks/test_tasks.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from sentry.testutils.cases import TestCase
2020
from sentry.testutils.helpers import install_slack
2121
from sentry.testutils.skips import requires_snuba
22-
from sentry.workflow_engine.defaults.workflows import DEFAULT_WORKFLOW_LABEL
22+
from sentry.workflow_engine.receivers.project_workflows import DEFAULT_RULE_LABEL
2323
from tests.sentry.integrations.slack.utils.test_mock_slack_response import mock_slack_response
2424

2525
pytestmark = [requires_snuba]
@@ -100,9 +100,7 @@ def test_task_new_rule(self, mock_set_value: MagicMock) -> None:
100100
with self.tasks():
101101
find_channel_id_for_rule(**data)
102102

103-
rule = Rule.objects.exclude(label__in=[DEFAULT_WORKFLOW_LABEL]).get(
104-
project_id=self.project.id
105-
)
103+
rule = Rule.objects.exclude(label__in=[DEFAULT_RULE_LABEL]).get(project_id=self.project.id)
106104
mock_set_value.assert_called_with("success", rule.id)
107105
assert rule.label == "New Rule"
108106
# check that the channel_id got added
@@ -146,9 +144,7 @@ def test_task_new_rule_project_id(self, mock_set_value: MagicMock) -> None:
146144
with self.tasks():
147145
find_channel_id_for_rule(**data)
148146

149-
rule = Rule.objects.exclude(label__in=[DEFAULT_WORKFLOW_LABEL]).get(
150-
project_id=self.project.id
151-
)
147+
rule = Rule.objects.exclude(label__in=[DEFAULT_RULE_LABEL]).get(project_id=self.project.id)
152148
mock_set_value.assert_called_with("success", rule.id)
153149
assert rule.label == "New Rule"
154150
# check that the channel_id got added
@@ -196,7 +192,7 @@ def test_task_new_rule_with_owner(self, mock_set_value: MagicMock) -> None:
196192
with self.tasks():
197193
find_channel_id_for_rule(**data)
198194

199-
rule = Rule.objects.exclude(label__in=[DEFAULT_WORKFLOW_LABEL]).get(
195+
rule = Rule.objects.exclude(label__in=[DEFAULT_RULE_LABEL]).get(
200196
project_id=self.project.id,
201197
)
202198
mock_set_value.assert_called_with("success", rule.id)

tests/sentry/receivers/test_onboarding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def test_project_created__default_workflow(self) -> None:
182182

183183
assert len(issue_stream_detectors) == 1
184184

185-
# Ensuer we have 1 connection to the issue stream, this triggers for both monitors above.
185+
# Ensure we have 1 connection to the issue stream, this triggers for both monitors above.
186186
result_connections = DetectorWorkflow.objects.filter(workflow=workflow)
187187
assert result_connections.count() == 1
188188
assert result_connections[0].detector_id == issue_stream_detectors[0].id

0 commit comments

Comments
 (0)