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(uptime): Swtich serialized status to ObjectStatus #84013

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
7 changes: 2 additions & 5 deletions src/sentry/uptime/endpoints/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ 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
status: str
uptimeStatus: int
mode: int
url: str
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
Loading