Skip to content

Commit 68617f0

Browse files
authored
ref(feedback): use new flagpole flag for spam ingest (#92126)
Ref - getsentry/team-replay#582 Depends on getsentry/sentry-options-automator#3945
1 parent 24d0105 commit 68617f0

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

src/sentry/feedback/usecases/spam_detection.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,6 @@ def trim_response(text):
6363

6464

6565
def spam_detection_enabled(project: Project) -> bool:
66-
return (
67-
features.has("organizations:user-feedback-spam-filter-ingest", project.organization)
68-
and project.get_option("sentry:feedback_ai_spam_detection")
69-
and not features.has(
70-
"organizations:user-feedback-spam-ingest-blocklist", project.organization
71-
)
72-
)
66+
return features.has(
67+
"organizations:user-feedback-spam-ingest", project.organization
68+
) and project.get_option("sentry:feedback_ai_spam_detection")

tests/sentry/feedback/usecases/test_create_feedback.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ def test_create_feedback_spam_detection_produce_to_kafka(
547547
):
548548
with Feature({"organizations:user-feedback-spam-filter-actions": True}):
549549

550-
with Feature({"organizations:user-feedback-spam-filter-ingest": feature_flag}):
550+
with Feature({"organizations:user-feedback-spam-ingest": feature_flag}):
551551
event = {
552552
"project_id": default_project.id,
553553
"request": {
@@ -623,7 +623,7 @@ def test_create_feedback_spam_detection_project_option_false(
623623
):
624624
default_project.update_option("sentry:feedback_ai_spam_detection", False)
625625

626-
with Feature({"organizations:user-feedback-spam-filter-ingest": True}):
626+
with Feature({"organizations:user-feedback-spam-ingest": True}):
627627
event = {
628628
"project_id": default_project.id,
629629
"request": {
@@ -686,7 +686,7 @@ def test_create_feedback_spam_detection_set_status_ignored(
686686
with Feature(
687687
{
688688
"organizations:user-feedback-spam-filter-actions": True,
689-
"organizations:user-feedback-spam-filter-ingest": True,
689+
"organizations:user-feedback-spam-ingest": True,
690690
}
691691
):
692692
event = {
@@ -859,7 +859,7 @@ def test_create_feedback_filters_large_message(
859859
features = (
860860
{
861861
"organizations:user-feedback-spam-filter-actions": True,
862-
"organizations:user-feedback-spam-filter-ingest": True,
862+
"organizations:user-feedback-spam-ingest": True,
863863
}
864864
if spam_enabled
865865
else {}
@@ -899,7 +899,7 @@ def test_create_feedback_evidence_has_spam(
899899
monkeypatch.setattr("sentry.feedback.usecases.create_feedback.is_spam", lambda _: True)
900900
default_project.update_option("sentry:feedback_ai_spam_detection", True)
901901

902-
with Feature({"organizations:user-feedback-spam-filter-ingest": True}):
902+
with Feature({"organizations:user-feedback-spam-ingest": True}):
903903
event = mock_feedback_event(default_project.id)
904904
source = FeedbackCreationSource.NEW_FEEDBACK_ENVELOPE
905905
create_feedback_issue(event, default_project.id, source)

0 commit comments

Comments
 (0)