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

chore: Add session-replay-rage-click-issue-creation flagpole guard #78620

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 4 additions & 0 deletions src/sentry/features/temporary.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,10 @@ def register_temporary_features(manager: FeatureManager):
manager.add("organizations:session-replay-enable-canvas", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
# Enable canvas replaying
manager.add("organizations:session-replay-enable-canvas-replayer", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)

# Enable Hydration Error Issue Creation In Recording Consumer
manager.add("organizations:session-replay-hydration-error-issue-creation", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
Copy link
Member

Choose a reason for hiding this comment

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

does this need to be exposed in the api?


# Enable linking from 'new issue' email notifs to the issue replay list
manager.add("organizations:session-replay-issue-emails", OrganizationFeature, FeatureHandlerStrategy.INTERNAL, api_expose=False)
# Enable queries to materialized view from replay index endpoint
Expand Down
10 changes: 9 additions & 1 deletion src/sentry/replays/usecases/ingest/dom_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from hashlib import md5
from typing import Any, Literal, TypedDict

from sentry import features
from sentry.conf.types.kafka_definition import Topic
from sentry.models.project import Project
from sentry.replays.usecases.ingest.issue_creation import (
Expand Down Expand Up @@ -301,7 +302,14 @@ def _should_report_hydration_error_issue(project: Project) -> bool:
"""
Checks the project option, controlled by a project owner.
"""
return project.get_option("sentry:replay_hydration_error_issues")

# Killswitch
has_feature = features.has(
Copy link
Member

Choose a reason for hiding this comment

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

why do we need a feature and a killswitch? (on top of the ingest flag created by the issue platform for this issue type)

"organizations:session-replay-rage-click-issue-creation",
project.organization,
)

return has_feature and project.get_option("sentry:replay_hydration_error_issues")


def _should_report_rage_click_issue(project: Project) -> bool:
Expand Down
16 changes: 10 additions & 6 deletions tests/sentry/replays/unit/test_ingest_dom_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
log_canvas_size,
parse_replay_actions,
)
from sentry.testutils.helpers.features import Feature
from sentry.testutils.pytest.fixtures import django_db_all
from sentry.utils import json

Expand Down Expand Up @@ -384,8 +385,9 @@ def test_parse_replay_dead_click_actions(patch_rage_click_issue_with_replay_even
},
]

default_project.update_option("sentry:replay_rage_click_issues", True)
replay_actions = parse_replay_actions(default_project, "1", 30, events, mock_replay_event())
with Feature({"organizations:session-replay-rage-click-issue-creation": True}):
default_project.update_option("sentry:replay_rage_click_issues", True)
replay_actions = parse_replay_actions(default_project, "1", 30, events, mock_replay_event())
assert patch_rage_click_issue_with_replay_event.call_count == 2
assert replay_actions is not None
assert replay_actions["type"] == "replay_event"
Expand Down Expand Up @@ -537,8 +539,9 @@ def test_rage_click_issue_creation_no_component_name(
},
]

default_project.update_option("sentry:replay_rage_click_issues", True)
parse_replay_actions(default_project, "1", 30, events, mock_replay_event())
with Feature({"organizations:session-replay-rage-click-issue-creation": True}):
default_project.update_option("sentry:replay_rage_click_issues", True)
parse_replay_actions(default_project, "1", 30, events, mock_replay_event())

# test that 2 rage click issues are still created
assert patch_rage_click_issue_with_replay_event.call_count == 2
Expand Down Expand Up @@ -939,8 +942,9 @@ def test_parse_replay_rage_clicks_with_replay_event(
},
]

default_project.update_option("sentry:replay_rage_click_issues", True)
replay_actions = parse_replay_actions(default_project, "1", 30, events, mock_replay_event())
with Feature({"organizations:session-replay-rage-click-issue-creation": True}):
default_project.update_option("sentry:replay_rage_click_issues", True)
replay_actions = parse_replay_actions(default_project, "1", 30, events, mock_replay_event())
assert patch_rage_click_issue_with_replay_event.call_count == 2
assert replay_actions is not None
assert replay_actions["type"] == "replay_event"
Expand Down
Loading