Skip to content

Commit

Permalink
update release threshold api routes (#58177)
Browse files Browse the repository at this point in the history
rather than conflicting with the existing `/releases/` routes
opt to simply have a separate url to manage release thresholds

NOTE: none of these routes are being utilized atm
  • Loading branch information
nhsiehgit authored Oct 16, 2023
1 parent 6801cb7 commit 65b4f86
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def get(self, request: Request, organization: Organization | RpcOrganization) ->
) # maybe prefetch "deploy_set" as well?

# ========================================================================
# Step 3: flatten thresholds and compile projects/releases/thresholds by type
# Step 3: flatten thresholds and compile projects/release-thresholds by type
# ========================================================================
thresholds_by_type: DefaultDict[int, dict[str, list]] = defaultdict()
for release in queryset:
Expand Down
14 changes: 7 additions & 7 deletions src/sentry/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -1547,11 +1547,6 @@
OrganizationSessionsEndpoint.as_view(),
name="sentry-api-0-organization-sessions",
),
re_path(
r"^(?P<organization_slug>[^\/]+)/releases/thresholds/$",
ReleaseThresholdIndexEndpoint.as_view(),
name="sentry-api-0-organization-release-thresholds",
),
re_path(
r"^(?P<organization_slug>[^\/]+)/releases/(?P<version>[^/]+)/resolved/$",
OrganizationIssuesResolvedInReleaseEndpoint.as_view(),
Expand Down Expand Up @@ -1632,6 +1627,11 @@
OrganizationReleasesEndpoint.as_view(),
name="sentry-api-0-organization-releases",
),
re_path(
r"^(?P<organization_slug>[^\/]+)/release-thresholds/$",
ReleaseThresholdIndexEndpoint.as_view(),
name="sentry-api-0-organization-release-thresholds",
),
# TODO: also integrate release threshold status into the releases response?
re_path(
r"^(?P<organization_slug>[^\/]+)/release-threshold-statuses/$",
Expand Down Expand Up @@ -2186,12 +2186,12 @@
name="sentry-api-0-project-releases",
),
re_path(
r"^(?P<organization_slug>[^\/]+)/(?P<project_slug>[^\/]+)/releases/thresholds/$",
r"^(?P<organization_slug>[^\/]+)/(?P<project_slug>[^\/]+)/release-thresholds/$",
ReleaseThresholdEndpoint.as_view(),
name="sentry-api-0-project-release-thresholds",
),
re_path(
r"^(?P<organization_slug>[^\/]+)/(?P<project_slug>[^\/]+)/releases/thresholds/(?P<release_threshold>[^/]+)/$",
r"^(?P<organization_slug>[^\/]+)/(?P<project_slug>[^\/]+)/release-thresholds/(?P<release_threshold>[^/]+)/$",
ReleaseThresholdDetailsEndpoint.as_view(),
name="sentry-api-0-project-release-thresholds-details",
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function useFetchThresholdsListData({

return useApiQuery<Threshold[]>(
[
`/organizations/${organization.id}/releases/thresholds/`,
`/organizations/${organization.id}/release-thresholds/`,
{
query,
},
Expand Down

0 comments on commit 65b4f86

Please sign in to comment.