Skip to content

Commit 31c7269

Browse files
ref(uptime): Remove unused uptimeSubscriptionId from serializer (#96672)
1 parent dcb42e8 commit 31c7269

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

src/sentry/uptime/endpoints/project_uptime_alert_checks_index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ def _transform_row(
353353

354354
return EapCheckEntry(
355355
uptime_check_id=uptime_check_id,
356-
uptime_subscription_id=uptime_subscription.id,
356+
uptime_monitor_id=uptime_subscription.id,
357357
timestamp=datetime.fromtimestamp(row_dict["timestamp"].val_double),
358358
scheduled_check_time=scheduled_check_time,
359359
check_status=cast(CheckStatus, row_dict["check_status"].val_str),

src/sentry/uptime/endpoints/serializers.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ def serialize(
104104

105105
class EapCheckEntrySerializerResponse(TypedDict):
106106
uptimeCheckId: str
107-
uptimeSubscriptionId: int
108107
projectUptimeSubscriptionId: int
109108
timestamp: str
110109
scheduledCheckTime: str
@@ -137,8 +136,7 @@ def serialize(
137136

138137
return {
139138
"uptimeCheckId": obj.uptime_check_id,
140-
"uptimeSubscriptionId": obj.uptime_subscription_id,
141-
"projectUptimeSubscriptionId": obj.uptime_subscription_id,
139+
"projectUptimeSubscriptionId": obj.uptime_monitor_id,
142140
"timestamp": obj.timestamp.strftime("%Y-%m-%dT%H:%M:%SZ"),
143141
"scheduledCheckTime": obj.scheduled_check_time.strftime("%Y-%m-%dT%H:%M:%SZ"),
144142
"checkStatus": check_status,

src/sentry/uptime/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class EapCheckEntry:
112112
"""
113113

114114
uptime_check_id: str
115-
uptime_subscription_id: int
115+
uptime_monitor_id: int
116116
timestamp: datetime
117117
scheduled_check_time: datetime
118118
check_status: CheckStatus

tests/sentry/uptime/endpoints/test_project_uptime_alert_check_index.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def test_get(self) -> None:
7777
assert len(response.data) == 6
7878
most_recent = response.data[0]
7979
for key in [
80-
"uptimeSubscriptionId",
80+
"projectUptimeSubscriptionId",
8181
"uptimeCheckId",
8282
"scheduledCheckTime",
8383
"timestamp",
@@ -93,7 +93,7 @@ def test_get(self) -> None:
9393
assert key in most_recent, f"{key} not in {most_recent}"
9494

9595
assert most_recent["uptimeCheckId"]
96-
assert most_recent["uptimeSubscriptionId"] == self.project_uptime_subscription.id
96+
assert most_recent["projectUptimeSubscriptionId"] == self.project_uptime_subscription.id
9797
assert most_recent["regionName"] == "Default Region"
9898
assert most_recent["checkStatusReason"] == "failure"
9999

0 commit comments

Comments
 (0)