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(uptiem): Remove uptime-rule-api flag usage #78151

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
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,6 @@ def get(self, request: Request, organization) -> Response:
),
)

if not features.has("organizations:uptime-rule-api", organization):
uptime_rules = ProjectUptimeSubscription.objects.none()

if not features.has("organizations:performance-view", organization):
# Filter to only error alert rules
alert_rules = alert_rules.filter(snuba_query__dataset=Dataset.Events.value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,6 @@ def test_filter_by_project(self):
[
"organizations:incidents",
"organizations:performance-view",
"organizations:uptime-rule-api",
]
):
request_data = {"project": [self.project.id]}
Expand All @@ -467,7 +466,6 @@ def test_filter_by_project(self):
[
"organizations:incidents",
"organizations:performance-view",
"organizations:uptime-rule-api",
]
):
request_data = {"project": [self.project2.id]}
Expand Down Expand Up @@ -640,7 +638,6 @@ def test_team_filter(self):
[
"organizations:incidents",
"organizations:performance-view",
"organizations:uptime-rule-api",
]
):
request_data = {
Expand All @@ -660,7 +657,6 @@ def test_team_filter(self):
[
"organizations:incidents",
"organizations:performance-view",
"organizations:uptime-rule-api",
]
):
request_data = {
Expand Down Expand Up @@ -784,7 +780,6 @@ def test_name_filter(self):
[
"organizations:incidents",
"organizations:performance-view",
"organizations:uptime-rule-api",
]
):
request_data = {
Expand All @@ -806,7 +801,6 @@ def test_name_filter(self):
[
"organizations:incidents",
"organizations:performance-view",
"organizations:uptime-rule-api",
]
):
request_data = {
Expand All @@ -825,7 +819,6 @@ def test_name_filter(self):
[
"organizations:incidents",
"organizations:performance-view",
"organizations:uptime-rule-api",
]
):
request_data = {
Expand All @@ -844,7 +837,6 @@ def test_name_filter(self):
[
"organizations:incidents",
"organizations:performance-view",
"organizations:uptime-rule-api",
]
):
request_data = {
Expand All @@ -863,7 +855,6 @@ def test_name_filter(self):
[
"organizations:incidents",
"organizations:performance-view",
"organizations:uptime-rule-api",
]
):
request_data = {
Expand All @@ -882,7 +873,6 @@ def test_name_filter(self):
[
"organizations:incidents",
"organizations:performance-view",
"organizations:uptime-rule-api",
]
):
request_data = {
Expand Down Expand Up @@ -963,7 +953,6 @@ def test_status_and_date_triggered_sort_order(self):
[
"organizations:incidents",
"organizations:performance-view",
"organizations:uptime-rule-api",
]
):
request_data = {
Expand Down Expand Up @@ -995,7 +984,6 @@ def test_status_and_date_triggered_sort_order(self):
[
"organizations:incidents",
"organizations:performance-view",
"organizations:uptime-rule-api",
]
):
request_data = {
Expand All @@ -1022,7 +1010,6 @@ def test_status_and_date_triggered_sort_order(self):
[
"organizations:incidents",
"organizations:performance-view",
"organizations:uptime-rule-api",
]
):
request_data = {
Expand All @@ -1048,7 +1035,6 @@ def test_uptime_feature(self):
name="Other Uptime Monitor",
uptime_subscription=self.create_uptime_subscription(url="https://santry.io"),
)
# This should NOT be included in the results
self.create_project_uptime_subscription(
name="Onboarding Uptime monitor",
mode=ProjectUptimeSubscriptionMode.AUTO_DETECTED_ONBOARDING,
Expand All @@ -1060,14 +1046,6 @@ def test_uptime_feature(self):
path=self.combined_rules_url, data=request_data, content_type="application/json"
)
assert response.status_code == 200, response.content
assert [r["id"] for r in json.loads(response.content)] == []

with self.feature("organizations:uptime-rule-api"):
request_data = {"name": "Uptime", "project": [self.project.id]}
response = self.client.get(
path=self.combined_rules_url, data=request_data, content_type="application/json"
)
assert response.status_code == 200, response.content
result = json.loads(response.content)
assert [r["id"] for r in result] == [
f"{other_uptime_monitor.id}",
Expand All @@ -1087,11 +1065,10 @@ def test_uptime_feature_name_sort(self):
uptime_subscription=self.create_uptime_subscription(url="https://santry-iz-kool.io"),
)

with self.feature("organizations:uptime-rule-api"):
request_data = {"project": [self.project.id], "sort": "name"}
response = self.client.get(
path=self.combined_rules_url, data=request_data, content_type="application/json"
)
request_data = {"project": [self.project.id], "sort": "name"}
response = self.client.get(
path=self.combined_rules_url, data=request_data, content_type="application/json"
)
assert response.status_code == 200, response.content
result = json.loads(response.content)
assert [r["name"] for r in result] == [
Expand Down
Loading