Skip to content

Commit

Permalink
feat(slack): EA ⚪ for actions by adding to issue alert threads FF (#7…
Browse files Browse the repository at this point in the history
  • Loading branch information
cathteng committed May 7, 2024
1 parent 80ed536 commit 45d2d2e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions src/sentry/integrations/slack/message_builder/issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ def build_actions(
"""Having actions means a button will be shown on the Slack message e.g. ignore, resolve, assign."""
if actions and identity:
text = get_action_text(actions, identity)
if features.has("organizations:slack-improvements", project.organization):
if features.has("organizations:slack-thread-issue-alert", project.organization):
# if actions are taken, return True at the end to show the white circle emoji
return [], text, True
return [], text, False
Expand Down Expand Up @@ -608,7 +608,9 @@ def build(self, notification_uuid: str | None = None) -> SlackBlock:
if self.actions and self.identity and not action_text:
# this means somebody is interacting with the message
action_text = get_action_text(self.actions, self.identity)
if features.has("organizations:slack-improvements", self.group.project.organization):
if features.has(
"organizations:slack-thread-issue-alert", self.group.project.organization
):
has_action = True

blocks = [self.get_title_block(rule_id, notification_uuid, obj, has_action)]
Expand Down
2 changes: 1 addition & 1 deletion tests/sentry/integrations/slack/test_message_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,7 @@ def test_identity_and_action(self):
group, self.project, "test txt", [MessageAction(name="TEST")], MOCKIDENTITY
) == ([], "", False)

@with_feature("organizations:slack-improvements")
@with_feature("organizations:slack-thread-issue-alert")
def test_identity_and_action_has_action(self):
# returns True to indicate to use the white circle emoji
group = self.create_group(project=self.project)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def test_archive_issue_until_escalating_block_kit(self):
assert ":red_circle:" in update_data["blocks"][0]["text"]["text"]

@responses.activate
@with_feature("organizations:slack-improvements")
@with_feature("organizations:slack-thread-issue-alert")
def test_archive_issue_until_escalating_block_kit_improvements(self):
original_message = self.get_original_message_block_kit(self.group.id)
self.archive_issue_block_kit(original_message, "ignored:archived_until_escalating")
Expand Down Expand Up @@ -648,7 +648,7 @@ def test_assign_issue_block_kit(self):
"integration": ActivityIntegration.SLACK.value,
}

@with_feature("organizations:slack-improvements")
@with_feature("organizations:slack-thread-issue-alert")
def test_assign_issue_block_kit_improvements(self):
user2 = self.create_user(is_superuser=False)
self.create_member(user=user2, organization=self.organization, teams=[self.team])
Expand Down Expand Up @@ -995,7 +995,7 @@ def test_resolve_issue_block_kit(self):
assert ":red_circle:" in update_data["blocks"][0]["text"]["text"]

@responses.activate
@with_feature("organizations:slack-improvements")
@with_feature("organizations:slack-thread-issue-alert")
def test_resolve_issue_block_kit_improvements(self):
original_message = self.get_original_message_block_kit(self.group.id)
self.resolve_issue_block_kit(original_message, "resolved")
Expand All @@ -1012,7 +1012,7 @@ def test_resolve_issue_block_kit_improvements(self):
assert ":white_circle:" in update_data["blocks"][0]["text"]["text"]

@responses.activate
@with_feature("organizations:slack-improvements")
@with_feature("organizations:slack-thread-issue-alert")
def test_resolve_perf_issue_block_kit_improvements(self):
group_fingerprint = f"{PerformanceNPlusOneGroupType.type_id}-group1"

Expand Down

0 comments on commit 45d2d2e

Please sign in to comment.