Skip to content

Commit aca2a85

Browse files
committed
feat(flags): Remove dead issue-search-allow-postgres-only-search flag (#108721)
## Summary Remove the `organizations:issue-search-allow-postgres-only-search` feature flag. It was disabled in flagpole and never enabled in production. ## Changes - Remove flag registration from `temporary.py` - Remove feature check in `snuba/executors.py` — default `allow_postgres_only_search` to `False` before the `if not end` block - Remove feature flag wrappers from `test_perf_issue` and `test_has_seer_last_run` tests ## Companion PRs - **sentry-options-automator**: flag-burner/dead/issue-search-allow-postgres-only-search (removes flagpole entry) Merge order: automator first → sentry
1 parent 3e2d940 commit aca2a85

File tree

3 files changed

+51
-31
lines changed

3 files changed

+51
-31
lines changed

src/sentry/features/temporary.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,6 @@ def register_temporary_features(manager: FeatureManager) -> None:
170170
manager.add("organizations:issue-details-streamline-enforce", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
171171
# Enables sorting spans for issue detection
172172
manager.add("organizations:issue-detection-sort-spans", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
173-
# Whether to allow issue only search on the issue list
174-
manager.add("organizations:issue-search-allow-postgres-only-search", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False)
175173
# Enable AI-generated titles for issue views
176174
manager.add("organizations:issue-view-ai-title", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
177175
# Enable Large HTTP Payload Detector Improvements

src/sentry/search/snuba/executors.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -771,13 +771,10 @@ def query(
771771
if end_params:
772772
end = min(end_params)
773773

774+
allow_postgres_only_search = False
774775
if not end:
775776
end = now + ALLOWED_FUTURE_DELTA
776777
allow_postgres_only_search = True
777-
else:
778-
allow_postgres_only_search = features.has(
779-
"organizations:issue-search-allow-postgres-only-search", projects[0].organization
780-
)
781778

782779
# TODO: Presumably we only want to search back to the project's max
783780
# retention date, which may be closer than 90 days in the past, but

tests/sentry/issues/endpoints/test_organization_group_index.py

Lines changed: 50 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from datetime import UTC, datetime, timedelta
77
from time import sleep
88
from typing import Any
9+
from unittest import mock
910
from unittest.mock import MagicMock, Mock, call, patch
1011
from uuid import uuid4
1112

@@ -23,9 +24,11 @@
2324
from sentry.integrations.models.organization_integration import OrganizationIntegration
2425
from sentry.issues.grouptype import (
2526
FeedbackGroup,
27+
NoiseConfig,
2628
PerformanceNPlusOneGroupType,
2729
PerformanceSlowDBQueryGroupType,
2830
)
31+
from sentry.issues.ingest import save_issue_occurrence
2932
from sentry.models.activity import Activity
3033
from sentry.models.apitoken import ApiToken
3134
from sentry.models.eventattachment import EventAttachment
@@ -500,39 +503,61 @@ def test_auto_resolved(self) -> None:
500503
assert response.data[0]["id"] == str(group2.id)
501504

502505
def test_perf_issue(self) -> None:
503-
perf_group = self.create_group(type=PerformanceNPlusOneGroupType.type_id)
504-
self.login_as(user=self.user)
505-
with self.feature(
506-
{
507-
"organizations:issue-search-allow-postgres-only-search": True,
508-
}
506+
event = self.store_event(
507+
data={
508+
"timestamp": before_now(seconds=1).isoformat(),
509+
},
510+
project_id=self.project.id,
511+
)
512+
occurrence = self.build_occurrence(
513+
event_id=event.event_id,
514+
fingerprint=["perf-issue-occurrence"],
515+
type=PerformanceNPlusOneGroupType.type_id,
516+
project_id=self.project.id,
517+
)
518+
with mock.patch.object(
519+
PerformanceNPlusOneGroupType,
520+
"noise_config",
521+
new=NoiseConfig(0, timedelta(minutes=1)),
509522
):
510-
response = self.get_success_response(query="issue.category:performance")
511-
assert len(response.data) == 1
512-
assert response.data[0]["id"] == str(perf_group.id)
523+
saved_occurrence, group_info = save_issue_occurrence(occurrence.to_dict(), event)
524+
assert group_info is not None
525+
perf_group = group_info.group
526+
self.login_as(user=self.user)
527+
response = self.get_success_response(query="issue.category:performance")
528+
assert len(response.data) == 1
529+
assert response.data[0]["id"] == str(perf_group.id)
513530

514531
def test_has_seer_last_run(self) -> None:
515532
"""Test filtering issues by whether they have seer_autofix_last_triggered set."""
516-
# Create two groups - one with seer_autofix_last_triggered and one without
517-
group_with_seer = self.create_group()
533+
event1 = self.store_event(
534+
data={
535+
"fingerprint": ["seer-group"],
536+
"timestamp": before_now(seconds=1).isoformat(),
537+
},
538+
project_id=self.project.id,
539+
)
540+
group_with_seer = event1.group
518541
group_with_seer.update(seer_autofix_last_triggered=timezone.now())
519-
group_without_seer = self.create_group()
542+
event2 = self.store_event(
543+
data={
544+
"fingerprint": ["no-seer-group"],
545+
"timestamp": before_now(seconds=1).isoformat(),
546+
},
547+
project_id=self.project.id,
548+
)
549+
group_without_seer = event2.group
520550

521551
self.login_as(user=self.user)
522-
with self.feature(
523-
{
524-
"organizations:issue-search-allow-postgres-only-search": True,
525-
}
526-
):
527-
# Query for issues that have seer_autofix_last_triggered set
528-
response = self.get_success_response(query="has:issue.seer_last_run")
529-
assert len(response.data) == 1
530-
assert response.data[0]["id"] == str(group_with_seer.id)
552+
# Query for issues that have seer_autofix_last_triggered set
553+
response = self.get_success_response(query="has:issue.seer_last_run")
554+
assert len(response.data) == 1
555+
assert response.data[0]["id"] == str(group_with_seer.id)
531556

532-
# Query for issues that do NOT have seer_autofix_last_triggered set
533-
response = self.get_success_response(query="!has:issue.seer_last_run")
534-
assert len(response.data) == 1
535-
assert response.data[0]["id"] == str(group_without_seer.id)
557+
# Query for issues that do NOT have seer_autofix_last_triggered set
558+
response = self.get_success_response(query="!has:issue.seer_last_run")
559+
assert len(response.data) == 1
560+
assert response.data[0]["id"] == str(group_without_seer.id)
536561

537562
def test_lookup_by_event_id(self) -> None:
538563
project = self.project

0 commit comments

Comments
 (0)