Skip to content
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

ref(feedback): release replay and feedback group types #79790

Merged
merged 5 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/sentry/issues/grouptype.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ class ReplayRageClickType(ReplayGroupTypeDefaults, GroupType):
category = GroupCategory.REPLAY.value
default_priority = PriorityLevel.MEDIUM
notification_config = NotificationConfig()
released = True


@dataclass(frozen=True)
Expand All @@ -580,6 +581,7 @@ class ReplayHydrationErrorType(ReplayGroupTypeDefaults, GroupType):
category = GroupCategory.REPLAY.value
default_priority = PriorityLevel.MEDIUM
notification_config = NotificationConfig()
released = True


@dataclass(frozen=True)
Expand All @@ -591,6 +593,7 @@ class FeedbackGroup(GroupType):
creation_quota = Quota(3600, 60, 1000) # 1000 per hour, sliding window of 60 seconds
default_priority = PriorityLevel.MEDIUM
notification_config = NotificationConfig(context=[])
released = True
in_default_search = False # hide from issues stream


Expand Down
2 changes: 1 addition & 1 deletion src/sentry/utils/mockdata/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1291,7 +1291,7 @@ def create_mock_user_feedback(project, has_attachment=True):
"event_id": str(uuid.uuid4()).replace("-", ""),
"timestamp": time.time(),
"received": "2024-4-27T22:23:29.574000+00:00",
"environment": "prod",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it! Seems like making an occurrence for a released group type will auto-create the environment if it doesn't exist. Not sure what it was doing before, since "prod" doesn't exist

"environment": next(ENVIRONMENTS),
"release": "frontend@daf1316f209d961443664cd6eb4231ca154db502",
"user": {
"ip_address": "72.164.175.154",
Expand Down
2 changes: 0 additions & 2 deletions tests/sentry/feedback/usecases/test_create_feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,6 @@ def test_create_feedback_spam_detection_set_status_ignored(
{
"organizations:user-feedback-spam-filter-actions": True,
"organizations:user-feedback-spam-filter-ingest": True,
"organizations:feedback-ingest": True,
}
):
event = {
Expand Down Expand Up @@ -798,7 +797,6 @@ def test_create_feedback_large_message_skips_spam_detection(
{
"organizations:user-feedback-spam-filter-actions": True,
"organizations:user-feedback-spam-filter-ingest": True,
"organizations:feedback-ingest": True,
}
),
set_sentry_option("feedback.message.max-size", 4096),
Expand Down
75 changes: 30 additions & 45 deletions tests/sentry/replays/unit/test_issue_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,21 +167,16 @@ def test_report_rage_click_issue_with_replay_event(mock_new_issue_occurrence, de
def test_report_rage_click_long_url(default_project):
replay_id = "b58a67446c914f44a4e329763420047b"
seq1_timestamp = datetime.now() - timedelta(minutes=10, seconds=52)
with Feature(
{
"organizations:replay-click-rage-ingest": True,
}
):
report_rage_click_issue_with_replay_event(
project_id=default_project.id,
replay_id=replay_id,
selector="div.xyz > a",
timestamp=seq1_timestamp.timestamp(),
url=f"https://www.sentry.io{'a' * 300}",
node={"tagName": "a"},
component_name="SmartSearchBar",
replay_event=mock_replay_event(),
)
report_rage_click_issue_with_replay_event(
project_id=default_project.id,
replay_id=replay_id,
selector="div.xyz > a",
timestamp=seq1_timestamp.timestamp(),
url=f"https://www.sentry.io{'a' * 300}",
node={"tagName": "a"},
component_name="SmartSearchBar",
replay_event=mock_replay_event(),
)

# test that the Issue gets created with the truncated url
assert Group.objects.get(message__contains="div.xyz > a")
Expand All @@ -195,21 +190,16 @@ def test_report_rage_click_no_environment(default_project):
seq1_timestamp = datetime.now() - timedelta(minutes=10, seconds=52)
replay_event = mock_replay_event()
del replay_event["environment"]
with Feature(
{
"organizations:replay-click-rage-ingest": True,
}
):
report_rage_click_issue_with_replay_event(
project_id=default_project.id,
replay_id=replay_id,
selector="div.xyz > a",
timestamp=seq1_timestamp.timestamp(),
url="https://www.sentry.io",
node={"tagName": "a"},
component_name="SmartSearchBar",
replay_event=mock_replay_event(),
)
report_rage_click_issue_with_replay_event(
project_id=default_project.id,
replay_id=replay_id,
selector="div.xyz > a",
timestamp=seq1_timestamp.timestamp(),
url="https://www.sentry.io",
node={"tagName": "a"},
component_name="SmartSearchBar",
replay_event=mock_replay_event(),
)

assert Group.objects.get(message__contains="div.xyz > a")

Expand All @@ -219,21 +209,16 @@ def test_report_rage_click_no_environment(default_project):
def test_report_rage_click_no_trace(default_project):
replay_id = "b58a67446c914f44a4e329763420047b"
seq1_timestamp = datetime.now() - timedelta(minutes=10, seconds=52)
with Feature(
{
"organizations:replay-click-rage-ingest": True,
}
):
report_rage_click_issue_with_replay_event(
project_id=default_project.id,
replay_id=replay_id,
selector="div.xyz > a",
timestamp=seq1_timestamp.timestamp(),
url="https://www.sentry.io",
node={"tagName": "a"},
component_name="SmartSearchBar",
replay_event=mock_replay_event(trace_ids=[]),
)
report_rage_click_issue_with_replay_event(
project_id=default_project.id,
replay_id=replay_id,
selector="div.xyz > a",
timestamp=seq1_timestamp.timestamp(),
url="https://www.sentry.io",
node={"tagName": "a"},
component_name="SmartSearchBar",
replay_event=mock_replay_event(trace_ids=[]),
)

# test that the Issue gets created
assert Group.objects.get(message__contains="div.xyz > a")
Expand Down
Loading