Skip to content

Commit

Permalink
ref(uptiem): Swtich serialized status to ObjectStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
evanpurkhiser committed Jan 24, 2025
1 parent 00f7a93 commit a9e4488
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions src/sentry/uptime/endpoints/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ class ProjectUptimeSubscriptionSerializerResponse(TypedDict):
projectSlug: str
environment: str | None
name: str
# TODO(epurkhiser): status and uptimeStatus are currently the same thing.
# status will be repurposed to be the object status, which keeps things
# consistent with other APIs
status: int
uptimeStatus: int
mode: int
Expand Down Expand Up @@ -66,7 +63,7 @@ def serialize(
"projectSlug": obj.project.slug,
"environment": obj.environment.name if obj.environment else None,
"name": obj.name or f"Uptime Monitoring for {obj.uptime_subscription.url}",
"status": obj.uptime_status,
"status": obj.get_status_display(),
"uptimeStatus": obj.uptime_status,
"mode": obj.mode,
"url": obj.uptime_subscription.url,
Expand Down
6 changes: 3 additions & 3 deletions tests/sentry/uptime/endpoints/test_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def test(self):
"projectSlug": self.project.slug,
"name": uptime_monitor.name,
"environment": uptime_monitor.environment.name if uptime_monitor.environment else None,
"status": uptime_monitor.uptime_status,
"status": uptime_monitor.get_status_display(),
"uptimeStatus": uptime_monitor.uptime_status,
"mode": uptime_monitor.mode,
"url": uptime_monitor.uptime_subscription.url,
Expand All @@ -37,7 +37,7 @@ def test_default_name(self):
"projectSlug": self.project.slug,
"name": f"Uptime Monitoring for {uptime_monitor.uptime_subscription.url}",
"environment": uptime_monitor.environment.name if uptime_monitor.environment else None,
"status": uptime_monitor.uptime_status,
"status": uptime_monitor.get_status_display(),
"uptimeStatus": uptime_monitor.uptime_status,
"mode": uptime_monitor.mode,
"url": uptime_monitor.uptime_subscription.url,
Expand All @@ -59,7 +59,7 @@ def test_owner(self):
"projectSlug": self.project.slug,
"name": uptime_monitor.name,
"environment": uptime_monitor.environment.name if uptime_monitor.environment else None,
"status": uptime_monitor.uptime_status,
"status": uptime_monitor.get_status_display(),
"uptimeStatus": uptime_monitor.uptime_status,
"mode": uptime_monitor.mode,
"url": uptime_monitor.uptime_subscription.url,
Expand Down

0 comments on commit a9e4488

Please sign in to comment.