diff --git a/src/sentry/api/urls.py b/src/sentry/api/urls.py index 0e7ce0fffd3784..2e72830157bf80 100644 --- a/src/sentry/api/urls.py +++ b/src/sentry/api/urls.py @@ -1118,7 +1118,7 @@ def create_group_urls(name_prefix: str) -> list[URLPattern | URLResolver]: name="sentry-api-0-organizations", ), re_path( - r"^(?P[^\/]+)/$", + r"^(?P[^\/]+)/$", OrganizationDetailsEndpoint.as_view(), name="sentry-api-0-organization-details", ), @@ -1138,7 +1138,7 @@ def create_group_urls(name_prefix: str) -> list[URLPattern | URLResolver]: name="sentry-api-0-organization-alert-rule-available-actions", ), re_path( - r"^(?P[^\/]+)/alert-rules/(?P[^\/]+)/$", + r"^(?P[^\/]+)/alert-rules/(?P[^\/]+)/$", OrganizationAlertRuleDetailsEndpoint.as_view(), name="sentry-api-0-organization-alert-rule-details", ), @@ -1294,12 +1294,12 @@ def create_group_urls(name_prefix: str) -> list[URLPattern | URLResolver]: name="sentry-api-0-organization-dashboard-visit", ), re_path( - r"^(?P[^\/]+)/shortids/(?P[^\/]+)/$", + r"^(?P[^\/]+)/shortids/(?P[^\/]+)/$", ShortIdLookupEndpoint.as_view(), name="sentry-api-0-short-id-lookup", ), re_path( - r"^(?P[^\/]+)/eventids/(?P(?:\d+|[A-Fa-f0-9-]{32,36}))/$", + r"^(?P[^\/]+)/eventids/(?P(?:\d+|[A-Fa-f0-9-]{32,36}))/$", EventIdLookupEndpoint.as_view(), name="sentry-api-0-event-id-lookup", ), @@ -1774,17 +1774,17 @@ def create_group_urls(name_prefix: str) -> list[URLPattern | URLResolver]: name="sentry-api-0-organization-sent-first-event", ), re_path( - r"^(?P[^\/]+)/repos/$", + r"^(?P[^\/]+)/repos/$", OrganizationRepositoriesEndpoint.as_view(), name="sentry-api-0-organization-repositories", ), re_path( - r"^(?P[^\/]+)/repos/(?P[^\/]+)/$", + r"^(?P[^\/]+)/repos/(?P[^\/]+)/$", OrganizationRepositoryDetailsEndpoint.as_view(), name="sentry-api-0-organization-repository-details", ), re_path( - r"^(?P[^\/]+)/repos/(?P[^\/]+)/commits/$", + r"^(?P[^\/]+)/repos/(?P[^\/]+)/commits/$", OrganizationRepositoryCommitsEndpoint.as_view(), name="sentry-api-0-organization-repository-commits", ), @@ -1799,12 +1799,12 @@ def create_group_urls(name_prefix: str) -> list[URLPattern | URLResolver]: name="sentry-api-0-organization-plugins-configs", ), re_path( - r"^(?P[^\/]+)/releases/$", + r"^(?P[^\/]+)/releases/$", OrganizationReleasesEndpoint.as_view(), name="sentry-api-0-organization-releases", ), re_path( - r"^(?P[^\/]+)/release-thresholds/$", + r"^(?P[^\/]+)/release-thresholds/$", ReleaseThresholdIndexEndpoint.as_view(), name="sentry-api-0-organization-release-thresholds", ), @@ -1815,52 +1815,52 @@ def create_group_urls(name_prefix: str) -> list[URLPattern | URLResolver]: name="sentry-api-0-organization-release-threshold-statuses", ), re_path( - r"^(?P[^\/]+)/releases/stats/$", + r"^(?P[^\/]+)/releases/stats/$", OrganizationReleasesStatsEndpoint.as_view(), name="sentry-api-0-organization-releases-stats", ), re_path( - r"^(?P[^\/]+)/releases/(?P[^/]+)/$", + r"^(?P[^\/]+)/releases/(?P[^/]+)/$", OrganizationReleaseDetailsEndpoint.as_view(), name="sentry-api-0-organization-release-details", ), re_path( - r"^(?P[^\/]+)/releases/(?P[^/]+)/meta/$", + r"^(?P[^\/]+)/releases/(?P[^/]+)/meta/$", OrganizationReleaseMetaEndpoint.as_view(), name="sentry-api-0-organization-release-meta", ), re_path( - r"^(?P[^\/]+)/releases/(?P[^/]+)/assemble/$", + r"^(?P[^\/]+)/releases/(?P[^/]+)/assemble/$", OrganizationReleaseAssembleEndpoint.as_view(), name="sentry-api-0-organization-release-assemble", ), re_path( - r"^(?P[^\/]+)/releases/(?P[^/]+)/files/$", + r"^(?P[^\/]+)/releases/(?P[^/]+)/files/$", OrganizationReleaseFilesEndpoint.as_view(), name="sentry-api-0-organization-release-files", ), re_path( - r"^(?P[^\/]+)/releases/(?P[^/]+)/files/(?P[^/]+)/$", + r"^(?P[^\/]+)/releases/(?P[^/]+)/files/(?P[^/]+)/$", OrganizationReleaseFileDetailsEndpoint.as_view(), name="sentry-api-0-organization-release-file-details", ), re_path( - r"^(?P[^\/]+)/releases/(?P[^/]+)/commitfiles/$", + r"^(?P[^\/]+)/releases/(?P[^/]+)/commitfiles/$", CommitFileChangeEndpoint.as_view(), name="sentry-api-0-release-commitfilechange", ), re_path( - r"^(?P[^\/]+)/releases/(?P[^/]+)/deploys/$", + r"^(?P[^\/]+)/releases/(?P[^/]+)/deploys/$", ReleaseDeploysEndpoint.as_view(), name="sentry-api-0-organization-release-deploys", ), re_path( - r"^(?P[^\/]+)/releases/(?P[^/]+)/commits/$", + r"^(?P[^\/]+)/releases/(?P[^/]+)/commits/$", OrganizationReleaseCommitsEndpoint.as_view(), name="sentry-api-0-organization-release-commits", ), re_path( - r"^(?P[^\/]+)/releases/(?P[^/]+)/previous-with-commits/$", + r"^(?P[^\/]+)/releases/(?P[^/]+)/previous-with-commits/$", OrganizationReleasePreviousCommitsEndpoint.as_view(), name="sentry-api-0-organization-release-previous-with-commits", ), @@ -1971,32 +1971,32 @@ def create_group_urls(name_prefix: str) -> list[URLPattern | URLResolver]: name="sentry-api-0-organization-relay-usage", ), re_path( - r"^(?P[^\/]+)/replays/$", + r"^(?P[^\/]+)/replays/$", OrganizationReplayIndexEndpoint.as_view(), name="sentry-api-0-organization-replay-index", ), re_path( - r"^(?P[^\/]+)/replay-selectors/$", + r"^(?P[^\/]+)/replay-selectors/$", OrganizationReplaySelectorIndexEndpoint.as_view(), name="sentry-api-0-organization-replay-selectors-index", ), re_path( - r"^(?P[^\/]+)/replay-count/$", + r"^(?P[^\/]+)/replay-count/$", OrganizationReplayCountEndpoint.as_view(), name="sentry-api-0-organization-replay-count", ), re_path( - r"^(?P[^/]+)/replays/(?P[\w-]+)/$", + r"^(?P[^/]+)/replays/(?P[\w-]+)/$", OrganizationReplayDetailsEndpoint.as_view(), name="sentry-api-0-organization-replay-details", ), re_path( - r"^(?P[^\/]+)/replays-events-meta/$", + r"^(?P[^\/]+)/replays-events-meta/$", OrganizationReplayEventsMetaEndpoint.as_view(), name="sentry-api-0-organization-replay-events-meta", ), re_path( - r"^(?P[^\/]+)/request-project-creation/$", + r"^(?P[^\/]+)/request-project-creation/$", OrganizationRequestProjectCreation.as_view(), name="sentry-api-0-organization-request-project-creation", ), @@ -2203,12 +2203,12 @@ def create_group_urls(name_prefix: str) -> list[URLPattern | URLResolver]: name="sentry-api-0-project-platform-details", ), re_path( - r"^(?P[^\/]+)/(?P[^\/]+)/events/$", + r"^(?P[^\/]+)/(?P[^\/]+)/events/$", ProjectEventsEndpoint.as_view(), name="sentry-api-0-project-events", ), re_path( - r"^(?P[^\/]+)/(?P[^\/]+)/events/(?P(?:\d+|[A-Fa-f0-9]{32}))/$", + r"^(?P[^\/]+)/(?P[^\/]+)/events/(?P(?:\d+|[A-Fa-f0-9]{32}))/$", ProjectEventDetailsEndpoint.as_view(), name="sentry-api-0-project-event-details", ), @@ -2248,7 +2248,7 @@ def create_group_urls(name_prefix: str) -> list[URLPattern | URLResolver]: name="sentry-api-0-event-file-committers", ), re_path( - r"^(?P[^\/]+)/(?P[^\/]+)/events/(?P[\w-]+)/json/$", + r"^(?P[^\/]+)/(?P[^\/]+)/events/(?P[\w-]+)/json/$", EventJsonEndpoint.as_view(), name="sentry-api-0-event-json", ), @@ -2318,17 +2318,17 @@ def create_group_urls(name_prefix: str) -> list[URLPattern | URLResolver]: name="sentry-api-0-project-filters-details", ), re_path( - r"^(?P[^\/]+)/(?P[^\/]+)/hooks/$", + r"^(?P[^\/]+)/(?P[^\/]+)/hooks/$", ProjectServiceHooksEndpoint.as_view(), name="sentry-api-0-service-hooks", ), re_path( - r"^(?P[^\/]+)/(?P[^\/]+)/hooks/(?P[^\/]+)/$", + r"^(?P[^\/]+)/(?P[^\/]+)/hooks/(?P[^\/]+)/$", ProjectServiceHookDetailsEndpoint.as_view(), name="sentry-api-0-project-service-hook-details", ), re_path( - r"^(?P[^\/]+)/(?P[^\/]+)/hooks/(?P[^\/]+)/stats/$", + r"^(?P[^\/]+)/(?P[^\/]+)/hooks/(?P[^\/]+)/stats/$", ProjectServiceHookStatsEndpoint.as_view(), ), re_path( @@ -2371,12 +2371,12 @@ def create_group_urls(name_prefix: str) -> list[URLPattern | URLResolver]: name="sentry-api-0-project-releases", ), re_path( - r"^(?P[^\/]+)/(?P[^\/]+)/release-thresholds/$", + r"^(?P[^\/]+)/(?P[^\/]+)/release-thresholds/$", ReleaseThresholdEndpoint.as_view(), name="sentry-api-0-project-release-thresholds", ), re_path( - r"^(?P[^\/]+)/(?P[^\/]+)/release-thresholds/(?P[^/]+)/$", + r"^(?P[^\/]+)/(?P[^\/]+)/release-thresholds/(?P[^/]+)/$", ReleaseThresholdDetailsEndpoint.as_view(), name="sentry-api-0-project-release-thresholds-details", ), @@ -2401,7 +2401,7 @@ def create_group_urls(name_prefix: str) -> list[URLPattern | URLResolver]: name="sentry-api-0-project-release-details", ), re_path( - r"^(?P[^\/]+)/(?P[^\/]+)/releases/(?P[^/]+)/commits/$", + r"^(?P[^\/]+)/(?P[^\/]+)/releases/(?P[^/]+)/commits/$", ProjectReleaseCommitsEndpoint.as_view(), name="sentry-api-0-project-release-commits", ), @@ -2431,12 +2431,12 @@ def create_group_urls(name_prefix: str) -> list[URLPattern | URLResolver]: name="sentry-api-0-project-artifact-bundle-file-details", ), re_path( - r"^(?P[^\/]+)/(?P[^\/]+)/releases/(?P[^/]+)/files/$", + r"^(?P[^\/]+)/(?P[^\/]+)/releases/(?P[^/]+)/files/$", ProjectReleaseFilesEndpoint.as_view(), name="sentry-api-0-project-release-files", ), re_path( - r"^(?P[^\/]+)/(?P[^\/]+)/releases/(?P[^/]+)/files/(?P[^/]+)/$", + r"^(?P[^\/]+)/(?P[^\/]+)/releases/(?P[^/]+)/files/(?P[^/]+)/$", ProjectReleaseFileDetailsEndpoint.as_view(), name="sentry-api-0-project-release-file-details", ), @@ -2451,37 +2451,37 @@ def create_group_urls(name_prefix: str) -> list[URLPattern | URLResolver]: name="sentry-api-0-project-rules", ), re_path( - r"^(?P[^/]+)/(?P[^\/]+)/replays/(?P[\w-]+)/$", + r"^(?P[^/]+)/(?P[^\/]+)/replays/(?P[\w-]+)/$", ProjectReplayDetailsEndpoint.as_view(), name="sentry-api-0-project-replay-details", ), re_path( - r"^(?P[^/]+)/(?P[^\/]+)/replays/(?P[\w-]+)/viewed-by/$", + r"^(?P[^/]+)/(?P[^\/]+)/replays/(?P[\w-]+)/viewed-by/$", ProjectReplayViewedByEndpoint.as_view(), name="sentry-api-0-project-replay-viewed-by", ), re_path( - r"^(?P[^/]+)/(?P[^\/]+)/replays/(?P[\w-]+)/accessibility-issues/$", + r"^(?P[^/]+)/(?P[^\/]+)/replays/(?P[\w-]+)/accessibility-issues/$", ProjectReplayAccessibilityIssuesEndpoint.as_view(), name="sentry-api-0-project-replay-accessibility-issues", ), re_path( - r"^(?P[^/]+)/(?P[^\/]+)/replays/(?P[\w-]+)/clicks/$", + r"^(?P[^/]+)/(?P[^\/]+)/replays/(?P[\w-]+)/clicks/$", ProjectReplayClicksIndexEndpoint.as_view(), name="sentry-api-0-project-replay-clicks-index", ), re_path( - r"^(?P[^/]+)/(?P[^\/]+)/replays/(?P[\w-]+)/recording-segments/$", + r"^(?P[^/]+)/(?P[^\/]+)/replays/(?P[\w-]+)/recording-segments/$", ProjectReplayRecordingSegmentIndexEndpoint.as_view(), name="sentry-api-0-project-replay-recording-segment-index", ), re_path( - r"^(?P[^/]+)/(?P[^\/]+)/replays/(?P[\w-]+)/recording-segments/(?P\d+)/$", + r"^(?P[^/]+)/(?P[^\/]+)/replays/(?P[\w-]+)/recording-segments/(?P\d+)/$", ProjectReplayRecordingSegmentDetailsEndpoint.as_view(), name="sentry-api-0-project-replay-recording-segment-details", ), re_path( - r"^(?P[^/]+)/(?P[^\/]+)/replays/(?P[\w-]+)/videos/(?P\d+)/$", + r"^(?P[^/]+)/(?P[^\/]+)/replays/(?P[\w-]+)/videos/(?P\d+)/$", ProjectReplayVideoDetailsEndpoint.as_view(), name="sentry-api-0-project-replay-video-details", ), @@ -2531,12 +2531,12 @@ def create_group_urls(name_prefix: str) -> list[URLPattern | URLResolver]: name="sentry-api-0-project-rule-stats-index", ), re_path( - r"^(?P[^\/]+)/(?P[^\/]+)/rule-task/(?P[^\/]+)/$", + r"^(?P[^\/]+)/(?P[^\/]+)/rule-task/(?P[^\/]+)/$", ProjectRuleTaskDetailsEndpoint.as_view(), name="sentry-api-0-project-rule-task-details", ), re_path( - r"^(?P[^\/]+)/(?P[^\/]+)/stats/$", + r"^(?P[^\/]+)/(?P[^\/]+)/stats/$", ProjectStatsEndpoint.as_view(), name="sentry-api-0-project-stats", ), @@ -2546,17 +2546,17 @@ def create_group_urls(name_prefix: str) -> list[URLPattern | URLResolver]: name="sentry-api-0-project-symbol-sources", ), re_path( - r"^(?P[^\/]+)/(?P[^\/]+)/tags/$", + r"^(?P[^\/]+)/(?P[^\/]+)/tags/$", ProjectTagsEndpoint.as_view(), name="sentry-api-0-project-tags", ), re_path( - r"^(?P[^\/]+)/(?P[^\/]+)/tags/(?P[^/]+)/$", + r"^(?P[^\/]+)/(?P[^\/]+)/tags/(?P[^/]+)/$", ProjectTagKeyDetailsEndpoint.as_view(), name="sentry-api-0-project-tagkey-details", ), re_path( - r"^(?P[^\/]+)/(?P[^\/]+)/tags/(?P[^/]+)/values/$", + r"^(?P[^\/]+)/(?P[^\/]+)/tags/(?P[^/]+)/values/$", ProjectTagKeyValuesEndpoint.as_view(), name="sentry-api-0-project-tagkey-values", ), @@ -2576,7 +2576,7 @@ def create_group_urls(name_prefix: str) -> list[URLPattern | URLResolver]: name="sentry-api-0-project-transfer", ), re_path( - r"^(?P[^\/]+)/(?P[^\/]+)/users/$", + r"^(?P[^\/]+)/(?P[^\/]+)/users/$", ProjectUsersEndpoint.as_view(), name="sentry-api-0-project-users", ), diff --git a/src/sentry/feedback/blueprints/api.md b/src/sentry/feedback/blueprints/api.md index 76d2ea07d50261..590df12679d6b7 100644 --- a/src/sentry/feedback/blueprints/api.md +++ b/src/sentry/feedback/blueprints/api.md @@ -14,7 +14,7 @@ returns a response _will_ document the full interchange format. Clients may opt to restrict response data or provide a subset of the request data. The API may or may not accept partial payloads. -## Feedback Index [/organizations//feedback/] +## Feedback Index [/organizations//feedback/] - Parameters @@ -155,7 +155,7 @@ Retrieve a collection of feedback items. } ``` -## Feedback [/projects///feedback//] +## Feedback [/projects///feedback//] - Model diff --git a/src/sentry/incidents/endpoints/organization_alert_rule_details.py b/src/sentry/incidents/endpoints/organization_alert_rule_details.py index 29985aae28f2e5..79e613c97336c5 100644 --- a/src/sentry/incidents/endpoints/organization_alert_rule_details.py +++ b/src/sentry/incidents/endpoints/organization_alert_rule_details.py @@ -335,7 +335,7 @@ def wrapper(self, request: Request, organization, alert_rule): @extend_schema( operation_id="Retrieve a Metric Alert Rule for an Organization", - parameters=[GlobalParams.ORG_SLUG, MetricAlertParams.METRIC_RULE_ID], + parameters=[GlobalParams.ORG_ID_OR_SLUG, MetricAlertParams.METRIC_RULE_ID], responses={ 200: AlertRuleSerializer, 401: RESPONSE_UNAUTHORIZED, @@ -360,7 +360,7 @@ def get(self, request: Request, organization, alert_rule) -> Response: @extend_schema( operation_id="Update a Metric Alert Rule", - parameters=[GlobalParams.ORG_SLUG, MetricAlertParams.METRIC_RULE_ID], + parameters=[GlobalParams.ORG_ID_OR_SLUG, MetricAlertParams.METRIC_RULE_ID], request=OrganizationAlertRuleDetailsPutSerializer, responses={ 200: AlertRuleSerializer, @@ -391,7 +391,7 @@ def put(self, request: Request, organization, alert_rule) -> Response: @extend_schema( operation_id="Delete a Metric Alert Rule", - parameters=[GlobalParams.ORG_SLUG, MetricAlertParams.METRIC_RULE_ID], + parameters=[GlobalParams.ORG_ID_OR_SLUG, MetricAlertParams.METRIC_RULE_ID], responses={ 202: RESPONSE_ACCEPTED, 401: RESPONSE_UNAUTHORIZED, diff --git a/src/sentry/replays/blueprints/api.md b/src/sentry/replays/blueprints/api.md index bd3c5a67b0b213..1e58fa793cca52 100644 --- a/src/sentry/replays/blueprints/api.md +++ b/src/sentry/replays/blueprints/api.md @@ -11,7 +11,7 @@ Host: https://sentry.io/api/0 This document is structured by resource with each resource having actions that can be performed against it. Every action that either accepts a request or returns a response WILL document the full interchange format. Clients may opt to restrict response data or provide a subset of the request data. The API may or may not accept partial payloads. -## Replays [/organizations//replays/] +## Replays [/organizations//replays/] - Parameters @@ -173,7 +173,7 @@ Retrieve a collection of replays. } ``` -## Replay [/projects///replays//] +## Replay [/projects///replays//] - Parameters - field (optional, string) @@ -244,7 +244,7 @@ Deletes a replay instance. - Response 204 -## Replay Accessibility Issues [/projects///replays//accessibility-issues] +## Replay Accessibility Issues [/projects///replays//accessibility-issues] This resource does not accept any URI parameters and is not paginated. Responses are ingested whole. @@ -336,7 +336,7 @@ IssueElementAlternative Type: } ``` -## Replay Selectors [/organizations//replay-selectors/] +## Replay Selectors [/organizations//replay-selectors/] - Parameters @@ -411,7 +411,7 @@ Retrieve a collection of selectors. } ``` -## Replay Recording Segments [/projects///replays//recording-segments/] +## Replay Recording Segments [/projects///replays//recording-segments/] - Parameters - per_page @@ -463,7 +463,7 @@ With download query argument, rrweb events JSON ] ``` -## Replay Recording Segment [/projects///replays//recording-segments//] +## Replay Recording Segment [/projects///replays//recording-segments//] - Parameters - download - Instruct the API to return a streaming bytes response. @@ -493,7 +493,7 @@ With download query argument. Content-Type application/octet-stream -## Replay Video [/projects///replays//videos//] +## Replay Video [/projects///replays//videos//] ### Fetch Replay Video [GET] @@ -505,7 +505,7 @@ Returns the bytes of a replay-segment video. \x00\x00\x00 ``` -## Replay Tag Keys [/projects///replays/tags/] +## Replay Tag Keys [/projects///replays/tags/] ### Fetch Tag Keys [GET] @@ -529,7 +529,7 @@ Retrieve a collection of tag keys associated with the replays dataset. ] ``` -## Replay Tag Values [/projects///replays/tags//values/] +## Replay Tag Values [/projects///replays/tags//values/] ### Fetch Tag Values [GET] @@ -559,7 +559,7 @@ Retrieve a collection of tag values associated with a tag key on the replays dat ] ``` -## Replay Click [/projects///replays//clicks/] +## Replay Click [/projects///replays//clicks/] Parameters: @@ -614,7 +614,7 @@ Retrieve a collection of click events associated with a replay. } ``` -## Replay Viewed By [/projects///replays//viewed-by/] +## Replay Viewed By [/projects///replays//viewed-by/] ### Fetch Replay Viewed By [GET] diff --git a/src/sentry/replays/endpoints/organization_replay_count.py b/src/sentry/replays/endpoints/organization_replay_count.py index 2d492e8480fe84..93d0bdeb494508 100644 --- a/src/sentry/replays/endpoints/organization_replay_count.py +++ b/src/sentry/replays/endpoints/organization_replay_count.py @@ -60,7 +60,7 @@ class OrganizationReplayCountEndpoint(OrganizationEventsV2EndpointBase): parameters=[ GlobalParams.END, GlobalParams.ENVIRONMENT, - GlobalParams.ORG_SLUG, + GlobalParams.ORG_ID_OR_SLUG, GlobalParams.START, GlobalParams.STATS_PERIOD, OrganizationParams.PROJECT, diff --git a/src/sentry/replays/endpoints/organization_replay_details.py b/src/sentry/replays/endpoints/organization_replay_details.py index 00f074fba83ec5..51656f5abc684b 100644 --- a/src/sentry/replays/endpoints/organization_replay_details.py +++ b/src/sentry/replays/endpoints/organization_replay_details.py @@ -36,7 +36,7 @@ class OrganizationReplayDetailsEndpoint(OrganizationEndpoint): @extend_schema( operation_id="Retrieve a Replay Instance", - parameters=[GlobalParams.ORG_SLUG, ReplayParams.REPLAY_ID, ReplayValidator], + parameters=[GlobalParams.ORG_ID_OR_SLUG, ReplayParams.REPLAY_ID, ReplayValidator], responses={ 200: inline_sentry_response_serializer("GetReplay", ReplayDetailsResponse), 400: RESPONSE_BAD_REQUEST, diff --git a/src/sentry/replays/endpoints/organization_replay_index.py b/src/sentry/replays/endpoints/organization_replay_index.py index 18692184936e3f..01f5cacbf83a26 100644 --- a/src/sentry/replays/endpoints/organization_replay_index.py +++ b/src/sentry/replays/endpoints/organization_replay_index.py @@ -34,7 +34,7 @@ class OrganizationReplayIndexEndpoint(OrganizationEndpoint): @extend_schema( operation_id="List an Organization's Replays", - parameters=[GlobalParams.ORG_SLUG, ReplayValidator], + parameters=[GlobalParams.ORG_ID_OR_SLUG, ReplayValidator], responses={ 200: inline_sentry_response_serializer("ListReplays", list[ReplayDetailsResponse]), 400: RESPONSE_BAD_REQUEST, diff --git a/src/sentry/replays/endpoints/organization_replay_selector_index.py b/src/sentry/replays/endpoints/organization_replay_selector_index.py index 8944b82c948923..8ca259004b7895 100644 --- a/src/sentry/replays/endpoints/organization_replay_selector_index.py +++ b/src/sentry/replays/endpoints/organization_replay_selector_index.py @@ -95,7 +95,7 @@ def get_replay_filter_params(self, request, organization): @extend_schema( operation_id="List an Organization's Selectors", parameters=[ - GlobalParams.ORG_SLUG, + GlobalParams.ORG_ID_OR_SLUG, GlobalParams.ENVIRONMENT, ReplaySelectorValidator, CursorQueryParam, diff --git a/src/sentry/replays/endpoints/project_replay_clicks_index.py b/src/sentry/replays/endpoints/project_replay_clicks_index.py index 2c63b3be7d14ad..9e9b22a23dc7cb 100644 --- a/src/sentry/replays/endpoints/project_replay_clicks_index.py +++ b/src/sentry/replays/endpoints/project_replay_clicks_index.py @@ -68,7 +68,7 @@ class ProjectReplayClicksIndexEndpoint(ProjectEndpoint): operation_id="List Clicked Nodes", parameters=[ CursorQueryParam, - GlobalParams.ORG_SLUG, + GlobalParams.ORG_ID_OR_SLUG, GlobalParams.PROJECT_ID_OR_SLUG, GlobalParams.ENVIRONMENT, ReplayParams.REPLAY_ID, diff --git a/src/sentry/replays/endpoints/project_replay_details.py b/src/sentry/replays/endpoints/project_replay_details.py index ea72baf56a89ff..07269ecd25eee4 100644 --- a/src/sentry/replays/endpoints/project_replay_details.py +++ b/src/sentry/replays/endpoints/project_replay_details.py @@ -73,7 +73,7 @@ def get(self, request: Request, project: Project, replay_id: str) -> Response: @extend_schema( operation_id="Delete a Replay Instance", parameters=[ - GlobalParams.ORG_SLUG, + GlobalParams.ORG_ID_OR_SLUG, GlobalParams.PROJECT_ID_OR_SLUG, ReplayParams.REPLAY_ID, ], diff --git a/src/sentry/replays/endpoints/project_replay_recording_segment_details.py b/src/sentry/replays/endpoints/project_replay_recording_segment_details.py index 983cf03e7fd434..3d90c05c533597 100644 --- a/src/sentry/replays/endpoints/project_replay_recording_segment_details.py +++ b/src/sentry/replays/endpoints/project_replay_recording_segment_details.py @@ -34,7 +34,7 @@ class ProjectReplayRecordingSegmentDetailsEndpoint(ProjectEndpoint): @extend_schema( operation_id="Fetch Recording Segment", parameters=[ - GlobalParams.ORG_SLUG, + GlobalParams.ORG_ID_OR_SLUG, GlobalParams.PROJECT_ID_OR_SLUG, ReplayParams.REPLAY_ID, ReplayParams.SEGMENT_ID, diff --git a/src/sentry/replays/endpoints/project_replay_recording_segment_index.py b/src/sentry/replays/endpoints/project_replay_recording_segment_index.py index 0359c325108eac..fee02128577774 100644 --- a/src/sentry/replays/endpoints/project_replay_recording_segment_index.py +++ b/src/sentry/replays/endpoints/project_replay_recording_segment_index.py @@ -36,7 +36,7 @@ def __init__(self, **options) -> None: operation_id="List Recording Segments", parameters=[ CursorQueryParam, - GlobalParams.ORG_SLUG, + GlobalParams.ORG_ID_OR_SLUG, GlobalParams.PROJECT_ID_OR_SLUG, ReplayParams.REPLAY_ID, VisibilityParams.PER_PAGE, diff --git a/src/sentry/replays/endpoints/project_replay_video_details.py b/src/sentry/replays/endpoints/project_replay_video_details.py index 03fd12d1ddaf35..3dcf4d6e66e01e 100644 --- a/src/sentry/replays/endpoints/project_replay_video_details.py +++ b/src/sentry/replays/endpoints/project_replay_video_details.py @@ -41,7 +41,7 @@ class ProjectReplayVideoDetailsEndpoint(ProjectEndpoint): @extend_schema( operation_id="Fetch Replay Video", parameters=[ - GlobalParams.ORG_SLUG, + GlobalParams.ORG_ID_OR_SLUG, GlobalParams.PROJECT_ID_OR_SLUG, ReplayParams.REPLAY_ID, ReplayParams.SEGMENT_ID, diff --git a/src/sentry/replays/endpoints/project_replay_viewed_by.py b/src/sentry/replays/endpoints/project_replay_viewed_by.py index c7a6cd409d0bcc..7c5ab9b96f8482 100644 --- a/src/sentry/replays/endpoints/project_replay_viewed_by.py +++ b/src/sentry/replays/endpoints/project_replay_viewed_by.py @@ -41,7 +41,7 @@ class ProjectReplayViewedByEndpoint(ProjectEndpoint): @extend_schema( operation_id="Get list of user who have viewed a replay", parameters=[ - GlobalParams.ORG_SLUG, + GlobalParams.ORG_ID_OR_SLUG, GlobalParams.PROJECT_ID_OR_SLUG, ReplayParams.REPLAY_ID, ], diff --git a/src/sentry/testutils/cases.py b/src/sentry/testutils/cases.py index 3727ffde44d30f..bfc39b0e3215c7 100644 --- a/src/sentry/testutils/cases.py +++ b/src/sentry/testutils/cases.py @@ -857,13 +857,15 @@ def enable_org_2fa(self, organization): def api_enable_org_2fa(self, organization, user): self.login_as(user) url = reverse( - "sentry-api-0-organization-details", kwargs={"organization_slug": organization.slug} + "sentry-api-0-organization-details", + kwargs={"organization_id_or_slug": organization.slug}, ) return self.client.put(url, data={"require2FA": True}) def api_disable_org_2fa(self, organization, user): url = reverse( - "sentry-api-0-organization-details", kwargs={"organization_slug": organization.slug} + "sentry-api-0-organization-details", + kwargs={"organization_id_or_slug": organization.slug}, ) return self.client.put(url, data={"require2FA": False}) @@ -1193,7 +1195,10 @@ def setUp(self): self.init_path = reverse( "sentry-organization-integrations-setup", - kwargs={"organization_slug": self.organization.slug, "provider_id": self.provider.key}, + kwargs={ + "organization_slug": self.organization.slug, + "provider_id": self.provider.key, + }, ) self.setup_path = reverse( diff --git a/tests/apidocs/endpoints/events/test_project_event_details.py b/tests/apidocs/endpoints/events/test_project_event_details.py index d6aaea37593e19..43480e91bc93f2 100644 --- a/tests/apidocs/endpoints/events/test_project_event_details.py +++ b/tests/apidocs/endpoints/events/test_project_event_details.py @@ -17,7 +17,7 @@ def setUp(self): self.url = reverse( self.endpoint, kwargs={ - "organization_slug": self.project.organization.slug, + "organization_id_or_slug": self.project.organization.slug, "project_id_or_slug": self.project.slug, "event_id": event.event_id, }, diff --git a/tests/apidocs/endpoints/events/test_project_tagkey_values.py b/tests/apidocs/endpoints/events/test_project_tagkey_values.py index 9672aeea8e6730..54c3a946cd4627 100644 --- a/tests/apidocs/endpoints/events/test_project_tagkey_values.py +++ b/tests/apidocs/endpoints/events/test_project_tagkey_values.py @@ -14,7 +14,7 @@ def setUp(self): self.url = reverse( "sentry-api-0-project-tagkey-values", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "project_id_or_slug": self.project.slug, "key": key, }, diff --git a/tests/apidocs/endpoints/organizations/test_event_id_lookup.py b/tests/apidocs/endpoints/organizations/test_event_id_lookup.py index 3042b5d4bf102d..ee04b4b77b129d 100644 --- a/tests/apidocs/endpoints/organizations/test_event_id_lookup.py +++ b/tests/apidocs/endpoints/organizations/test_event_id_lookup.py @@ -9,7 +9,7 @@ def setUp(self): event = self.create_event("a", message="oh no") self.url = reverse( "sentry-api-0-event-id-lookup", - kwargs={"organization_slug": self.organization.slug, "event_id": event.event_id}, + kwargs={"organization_id_or_slug": self.organization.slug, "event_id": event.event_id}, ) self.login_as(user=self.user) diff --git a/tests/apidocs/endpoints/organizations/test_org_details.py b/tests/apidocs/endpoints/organizations/test_org_details.py index 84d56815aaa800..92185fada732a7 100644 --- a/tests/apidocs/endpoints/organizations/test_org_details.py +++ b/tests/apidocs/endpoints/organizations/test_org_details.py @@ -10,7 +10,7 @@ def setUp(self): self.url = reverse( "sentry-api-0-organization-details", - kwargs={"organization_slug": organization.slug}, + kwargs={"organization_id_or_slug": organization.slug}, ) self.login_as(user=self.user) diff --git a/tests/apidocs/endpoints/organizations/test_org_repos.py b/tests/apidocs/endpoints/organizations/test_org_repos.py index 8601854f2bf3ae..e2299c23cf4172 100644 --- a/tests/apidocs/endpoints/organizations/test_org_repos.py +++ b/tests/apidocs/endpoints/organizations/test_org_repos.py @@ -12,7 +12,7 @@ def setUp(self): self.url = reverse( "sentry-api-0-organization-repositories", - kwargs={"organization_slug": organization.slug}, + kwargs={"organization_id_or_slug": organization.slug}, ) self.login_as(user=self.user) diff --git a/tests/apidocs/endpoints/organizations/test_repo_commits.py b/tests/apidocs/endpoints/organizations/test_repo_commits.py index 272d6acd699865..31b0c95bc4b920 100644 --- a/tests/apidocs/endpoints/organizations/test_repo_commits.py +++ b/tests/apidocs/endpoints/organizations/test_repo_commits.py @@ -14,7 +14,7 @@ def setUp(self): self.url = reverse( "sentry-api-0-organization-repository-commits", - kwargs={"organization_slug": organization.slug, "repo_id": repo.id}, + kwargs={"organization_id_or_slug": organization.slug, "repo_id": repo.id}, ) self.login_as(user=self.user) diff --git a/tests/apidocs/endpoints/organizations/test_shortid.py b/tests/apidocs/endpoints/organizations/test_shortid.py index 08fc89c37236f9..ad8895cabc1d8a 100644 --- a/tests/apidocs/endpoints/organizations/test_shortid.py +++ b/tests/apidocs/endpoints/organizations/test_shortid.py @@ -11,7 +11,7 @@ def setUp(self): self.url = reverse( "sentry-api-0-short-id-lookup", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "short_id": group.qualified_short_id, }, ) diff --git a/tests/apidocs/endpoints/projects/test_project_stats.py b/tests/apidocs/endpoints/projects/test_project_stats.py index 111882371a7089..4e947f6d5b80c6 100644 --- a/tests/apidocs/endpoints/projects/test_project_stats.py +++ b/tests/apidocs/endpoints/projects/test_project_stats.py @@ -12,7 +12,7 @@ def setUp(self): self.url = reverse( "sentry-api-0-project-stats", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "project_id_or_slug": self.project.slug, }, ) diff --git a/tests/apidocs/endpoints/projects/test_service_hook_details.py b/tests/apidocs/endpoints/projects/test_service_hook_details.py index 246edbc1e588eb..8bdaac91f26ffe 100644 --- a/tests/apidocs/endpoints/projects/test_service_hook_details.py +++ b/tests/apidocs/endpoints/projects/test_service_hook_details.py @@ -11,7 +11,7 @@ def setUp(self): self.url = reverse( "sentry-api-0-project-service-hook-details", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "project_id_or_slug": self.project.slug, "hook_id": hook.guid, }, diff --git a/tests/apidocs/endpoints/projects/test_service_hooks.py b/tests/apidocs/endpoints/projects/test_service_hooks.py index 6db62b94c3b350..f324eb7216eb83 100644 --- a/tests/apidocs/endpoints/projects/test_service_hooks.py +++ b/tests/apidocs/endpoints/projects/test_service_hooks.py @@ -12,7 +12,7 @@ def setUp(self): self.url = reverse( "sentry-api-0-service-hooks", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "project_id_or_slug": self.project.slug, }, ) diff --git a/tests/apidocs/endpoints/projects/test_tag_values.py b/tests/apidocs/endpoints/projects/test_tag_values.py index ca61354ed7ae90..cd75f59b7077ec 100644 --- a/tests/apidocs/endpoints/projects/test_tag_values.py +++ b/tests/apidocs/endpoints/projects/test_tag_values.py @@ -12,7 +12,7 @@ def setUp(self): self.url = reverse( "sentry-api-0-project-tagkey-values", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "project_id_or_slug": self.project.slug, "key": key, }, diff --git a/tests/apidocs/endpoints/projects/test_users.py b/tests/apidocs/endpoints/projects/test_users.py index 1749567835282c..35e16c43eadb5d 100644 --- a/tests/apidocs/endpoints/projects/test_users.py +++ b/tests/apidocs/endpoints/projects/test_users.py @@ -18,7 +18,7 @@ def setUp(self): self.url = reverse( "sentry-api-0-project-users", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "project_id_or_slug": self.project.slug, }, ) diff --git a/tests/apidocs/endpoints/releases/test_deploys.py b/tests/apidocs/endpoints/releases/test_deploys.py index c8ad56c2fbb7e6..07124f370c1669 100644 --- a/tests/apidocs/endpoints/releases/test_deploys.py +++ b/tests/apidocs/endpoints/releases/test_deploys.py @@ -48,7 +48,10 @@ def setUp(self): self.url = reverse( "sentry-api-0-organization-release-deploys", - kwargs={"organization_slug": project.organization.slug, "version": release.version}, + kwargs={ + "organization_id_or_slug": project.organization.slug, + "version": release.version, + }, ) self.login_as(user=self.user) diff --git a/tests/apidocs/endpoints/releases/test_organization_release_commit_files.py b/tests/apidocs/endpoints/releases/test_organization_release_commit_files.py index 0626a9303da72e..902f0cd23a9693 100644 --- a/tests/apidocs/endpoints/releases/test_organization_release_commit_files.py +++ b/tests/apidocs/endpoints/releases/test_organization_release_commit_files.py @@ -36,7 +36,10 @@ def setUp(self): ) self.url = reverse( "sentry-api-0-release-commitfilechange", - kwargs={"organization_slug": project.organization.slug, "version": release.version}, + kwargs={ + "organization_id_or_slug": project.organization.slug, + "version": release.version, + }, ) self.login_as(user=self.user) diff --git a/tests/apidocs/endpoints/releases/test_organization_release_commits.py b/tests/apidocs/endpoints/releases/test_organization_release_commits.py index 1df1568853f7d2..d458fd47addf74 100644 --- a/tests/apidocs/endpoints/releases/test_organization_release_commits.py +++ b/tests/apidocs/endpoints/releases/test_organization_release_commits.py @@ -26,7 +26,10 @@ def setUp(self): ) self.url = reverse( "sentry-api-0-organization-release-commits", - kwargs={"organization_slug": project.organization.slug, "version": release.version}, + kwargs={ + "organization_id_or_slug": project.organization.slug, + "version": release.version, + }, ) self.login_as(user=self.user) diff --git a/tests/apidocs/endpoints/releases/test_organization_release_details.py b/tests/apidocs/endpoints/releases/test_organization_release_details.py index 8488b1ac4d0337..a162c8f43849e1 100644 --- a/tests/apidocs/endpoints/releases/test_organization_release_details.py +++ b/tests/apidocs/endpoints/releases/test_organization_release_details.py @@ -32,7 +32,7 @@ def setUp(self): self.url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": org.slug, "version": release.version}, + kwargs={"organization_id_or_slug": org.slug, "version": release.version}, ) def test_get(self): diff --git a/tests/apidocs/endpoints/releases/test_organization_release_file_details.py b/tests/apidocs/endpoints/releases/test_organization_release_file_details.py index bdb558b1035cd0..0918b57996635c 100644 --- a/tests/apidocs/endpoints/releases/test_organization_release_file_details.py +++ b/tests/apidocs/endpoints/releases/test_organization_release_file_details.py @@ -24,7 +24,7 @@ def setUp(self): self.url = reverse( "sentry-api-0-organization-release-file-details", kwargs={ - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "version": release.version, "file_id": releasefile.id, }, diff --git a/tests/apidocs/endpoints/releases/test_organization_release_files.py b/tests/apidocs/endpoints/releases/test_organization_release_files.py index 781725c3d62103..5f434d4fedd6aa 100644 --- a/tests/apidocs/endpoints/releases/test_organization_release_files.py +++ b/tests/apidocs/endpoints/releases/test_organization_release_files.py @@ -22,7 +22,10 @@ def setUp(self): self.url = reverse( "sentry-api-0-organization-release-files", - kwargs={"organization_slug": project.organization.slug, "version": release.version}, + kwargs={ + "organization_id_or_slug": project.organization.slug, + "version": release.version, + }, ) self.login_as(user=self.user) diff --git a/tests/apidocs/endpoints/releases/test_organization_releases.py b/tests/apidocs/endpoints/releases/test_organization_releases.py index b096f46c2becd6..ef9da5d846deeb 100644 --- a/tests/apidocs/endpoints/releases/test_organization_releases.py +++ b/tests/apidocs/endpoints/releases/test_organization_releases.py @@ -42,7 +42,7 @@ def setUp(self): release2.add_project(self.project2) self.url = reverse( - "sentry-api-0-organization-releases", kwargs={"organization_slug": org.slug} + "sentry-api-0-organization-releases", kwargs={"organization_id_or_slug": org.slug} ) def test_get(self): diff --git a/tests/apidocs/endpoints/releases/test_project_release_commits.py b/tests/apidocs/endpoints/releases/test_project_release_commits.py index 21923bfb6b51d5..6db546d16b13e1 100644 --- a/tests/apidocs/endpoints/releases/test_project_release_commits.py +++ b/tests/apidocs/endpoints/releases/test_project_release_commits.py @@ -27,7 +27,7 @@ def setUp(self): self.url = reverse( "sentry-api-0-project-release-commits", kwargs={ - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "project_id_or_slug": project.slug, "version": release.version, }, diff --git a/tests/apidocs/endpoints/releases/test_project_release_file_details.py b/tests/apidocs/endpoints/releases/test_project_release_file_details.py index fa395364cf8ea0..c9ba02d24972ec 100644 --- a/tests/apidocs/endpoints/releases/test_project_release_file_details.py +++ b/tests/apidocs/endpoints/releases/test_project_release_file_details.py @@ -24,7 +24,7 @@ def setUp(self): "sentry-api-0-project-release-file-details", kwargs={ "project_id_or_slug": project.slug, - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "version": release.version, "file_id": releasefile.id, }, diff --git a/tests/apidocs/endpoints/releases/test_project_release_files.py b/tests/apidocs/endpoints/releases/test_project_release_files.py index 0f7519e6a11fc1..f5cb575b958c79 100644 --- a/tests/apidocs/endpoints/releases/test_project_release_files.py +++ b/tests/apidocs/endpoints/releases/test_project_release_files.py @@ -25,7 +25,7 @@ def setUp(self): "sentry-api-0-project-release-files", kwargs={ "project_id_or_slug": project.slug, - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "version": release.version, }, ) diff --git a/tests/sentry/api/endpoints/release_thresholds/test_release_threshold.py b/tests/sentry/api/endpoints/release_thresholds/test_release_threshold.py index d8fa44ce187a88..f6c1aa3292f1ee 100644 --- a/tests/sentry/api/endpoints/release_thresholds/test_release_threshold.py +++ b/tests/sentry/api/endpoints/release_thresholds/test_release_threshold.py @@ -21,7 +21,7 @@ def setUp(self): self.url = reverse( "sentry-api-0-project-release-thresholds", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "project_id_or_slug": self.project.slug, }, ) @@ -75,7 +75,7 @@ def test_post_invalid_project(self): url_with_invalid_project = reverse( "sentry-api-0-project-release-thresholds", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "project_id_or_slug": "Why did it have to be snakes?", }, ) @@ -156,7 +156,7 @@ def test_get_invalid_project(self): url_with_invalid_project = reverse( "sentry-api-0-project-release-thresholds", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "project_id_or_slug": "Why did it have to be snakes?", }, ) diff --git a/tests/sentry/api/endpoints/release_thresholds/test_release_threshold_details.py b/tests/sentry/api/endpoints/release_thresholds/test_release_threshold_details.py index 67c320f64b57a0..bd073f9ca49dee 100644 --- a/tests/sentry/api/endpoints/release_thresholds/test_release_threshold_details.py +++ b/tests/sentry/api/endpoints/release_thresholds/test_release_threshold_details.py @@ -32,7 +32,7 @@ def test_invalid_threshold_id(self): url = reverse( "sentry-api-0-project-release-thresholds-details", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "project_id_or_slug": self.project.slug, "release_threshold": 123, }, @@ -45,7 +45,7 @@ def test_invalid_project(self): url = reverse( "sentry-api-0-project-release-thresholds-details", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "project_id_or_slug": "kingdom_of_the_crystal_skull", "release_threshold": self.basic_threshold.id, }, @@ -58,7 +58,7 @@ def test_valid(self): url = reverse( "sentry-api-0-project-release-thresholds-details", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "project_id_or_slug": self.project.slug, "release_threshold": self.basic_threshold.id, }, @@ -99,7 +99,7 @@ def test_invalid_threshold_id(self): url = reverse( "sentry-api-0-project-release-thresholds-details", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "project_id_or_slug": self.project.slug, "release_threshold": 123, }, @@ -112,7 +112,7 @@ def test_invalid_project(self): url = reverse( "sentry-api-0-project-release-thresholds-details", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "project_id_or_slug": "kingdom_of_the_crystal_skull", "release_threshold": self.basic_threshold.id, }, @@ -125,7 +125,7 @@ def test_valid(self): url = reverse( "sentry-api-0-project-release-thresholds-details", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "project_id_or_slug": self.project.slug, "release_threshold": self.basic_threshold.id, }, @@ -161,7 +161,7 @@ def test_invalid_threshold_id(self): url = reverse( "sentry-api-0-project-release-thresholds-details", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "project_id_or_slug": self.project.slug, "release_threshold": 123, }, @@ -174,7 +174,7 @@ def test_invalid_missing_data(self): url = reverse( "sentry-api-0-project-release-thresholds-details", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "project_id_or_slug": self.project.slug, "release_threshold": self.basic_threshold.id, }, @@ -191,7 +191,7 @@ def test_invalid_trigger_type(self): url = reverse( "sentry-api-0-project-release-thresholds-details", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "project_id_or_slug": self.project.slug, "release_threshold": self.basic_threshold.id, }, @@ -212,7 +212,7 @@ def test_invalid_threshold_type(self): url = reverse( "sentry-api-0-project-release-thresholds-details", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "project_id_or_slug": self.project.slug, "release_threshold": self.basic_threshold.id, }, @@ -233,7 +233,7 @@ def test_invalid_window(self): url = reverse( "sentry-api-0-project-release-thresholds-details", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "project_id_or_slug": self.project.slug, "release_threshold": self.basic_threshold.id, }, @@ -254,7 +254,7 @@ def test_invalid_project(self): url = reverse( "sentry-api-0-project-release-thresholds-details", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "project_id_or_slug": "kingdom_of_the_crystal_skull", "release_threshold": self.basic_threshold.id, }, @@ -277,7 +277,7 @@ def test_valid(self): url = reverse( "sentry-api-0-project-release-thresholds-details", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "project_id_or_slug": self.project.slug, "release_threshold": self.basic_threshold.id, }, @@ -308,7 +308,7 @@ def test_valid_with_extra_data(self): url = reverse( "sentry-api-0-project-release-thresholds-details", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "project_id_or_slug": self.project.slug, "release_threshold": self.basic_threshold.id, }, diff --git a/tests/sentry/api/endpoints/test_organization_release_commits.py b/tests/sentry/api/endpoints/test_organization_release_commits.py index b9aad7a7617c75..52016245828d5a 100644 --- a/tests/sentry/api/endpoints/test_organization_release_commits.py +++ b/tests/sentry/api/endpoints/test_organization_release_commits.py @@ -27,7 +27,10 @@ def test_simple(self): ) url = reverse( "sentry-api-0-organization-release-commits", - kwargs={"organization_slug": project.organization.slug, "version": release.version}, + kwargs={ + "organization_id_or_slug": project.organization.slug, + "version": release.version, + }, ) self.login_as(user=self.user) diff --git a/tests/sentry/api/endpoints/test_organization_release_details.py b/tests/sentry/api/endpoints/test_organization_release_details.py index 1c58c3d677142b..fd549dfc9fedeb 100644 --- a/tests/sentry/api/endpoints/test_organization_release_details.py +++ b/tests/sentry/api/endpoints/test_organization_release_details.py @@ -67,7 +67,7 @@ def test_simple(self): url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": self.organization.slug, "version": release.version}, + kwargs={"organization_id_or_slug": self.organization.slug, "version": release.version}, ) response = self.client.get(url) @@ -81,7 +81,7 @@ def test_simple(self): # no access url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": self.organization.slug, "version": release2.version}, + kwargs={"organization_id_or_slug": self.organization.slug, "version": release2.version}, ) response = self.client.get(url) assert response.status_code == 404 @@ -103,7 +103,7 @@ def test_multiple_projects(self): url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": self.organization.slug, "version": release.version}, + kwargs={"organization_id_or_slug": self.organization.slug, "version": release.version}, ) response = self.client.get(url) @@ -121,7 +121,7 @@ def test_wrong_project(self): url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": self.organization.slug, "version": release.version}, + kwargs={"organization_id_or_slug": self.organization.slug, "version": release.version}, ) response = self.client.get(url, {"project": project2.id}) @@ -145,7 +145,7 @@ def test_correct_project_contains_current_project_meta(self): url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": self.organization.slug, "version": release.version}, + kwargs={"organization_id_or_slug": self.organization.slug, "version": release.version}, ) response = self.client.get(url, {"project": self.project1.id}) @@ -171,7 +171,7 @@ def test_incorrect_sort_option_should_return_invalid_sort_response(self): url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": self.organization.slug, "version": release.version}, + kwargs={"organization_id_or_slug": self.organization.slug, "version": release.version}, ) response = self.client.get(url, {"project": self.project1.id, "sort": "invalid_sort"}) assert response.status_code == 400 @@ -199,7 +199,10 @@ def test_get_prev_and_next_release_to_current_release_on_date_sort(self): # Test for middle release of the list url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": self.organization.slug, "version": release_2.version}, + kwargs={ + "organization_id_or_slug": self.organization.slug, + "version": release_2.version, + }, ) response = self.client.get(url, {"project": self.project1.id}) assert response.status_code == 200 @@ -209,7 +212,10 @@ def test_get_prev_and_next_release_to_current_release_on_date_sort(self): # Test for first release of the list url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": self.organization.slug, "version": release_3.version}, + kwargs={ + "organization_id_or_slug": self.organization.slug, + "version": release_3.version, + }, ) response = self.client.get(url, {"project": self.project1.id}) assert response.status_code == 200 @@ -219,7 +225,10 @@ def test_get_prev_and_next_release_to_current_release_on_date_sort(self): # Test for last release of the list url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": self.organization.slug, "version": release_1.version}, + kwargs={ + "organization_id_or_slug": self.organization.slug, + "version": release_1.version, + }, ) response = self.client.get(url, {"project": self.project1.id}) assert response.status_code == 200 @@ -249,7 +258,10 @@ def test_get_prev_and_next_release_to_current_release_on_date_sort_with_same_dat # Test for middle release of the list url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": self.organization.slug, "version": release_1.version}, + kwargs={ + "organization_id_or_slug": self.organization.slug, + "version": release_1.version, + }, ) response = self.client.get(url, {"project": self.project1.id}) assert response.status_code == 200 @@ -259,7 +271,10 @@ def test_get_prev_and_next_release_to_current_release_on_date_sort_with_same_dat # Test for first release of the list url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": self.organization.slug, "version": release_2.version}, + kwargs={ + "organization_id_or_slug": self.organization.slug, + "version": release_2.version, + }, ) response = self.client.get(url, {"project": self.project1.id}) assert response.status_code == 200 @@ -309,7 +324,10 @@ def test_get_prev_and_next_release_to_current_release_on_date_sort_env_filter_ap # Test for middle release of the list url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": self.organization.slug, "version": release_3.version}, + kwargs={ + "organization_id_or_slug": self.organization.slug, + "version": release_3.version, + }, ) response = self.client.get(url, {"project": self.project1.id, "environment": ["prod"]}) assert response.status_code == 200 @@ -361,7 +379,10 @@ def test_get_prev_and_next_release_to_current_release_on_date_sort_status_filter # Test for middle release of the list url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": self.organization.slug, "version": release_3.version}, + kwargs={ + "organization_id_or_slug": self.organization.slug, + "version": release_3.version, + }, ) response = self.client.get(url, {"project": self.project1.id, "status": "archived"}) assert response.status_code == 200 @@ -395,7 +416,10 @@ def test_get_prev_and_next_release_to_current_release_on_date_sort_query_filter_ # Test for middle release of the list url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": self.organization.slug, "version": release_2.version}, + kwargs={ + "organization_id_or_slug": self.organization.slug, + "version": release_2.version, + }, ) response = self.client.get(url, {"project": self.project1.id, "query": "foobar@1"}) assert response.status_code == 200 @@ -432,7 +456,10 @@ def test_get_prev_and_next_release_on_date_sort_does_not_apply_stats_period_filt # Test for middle release of the list url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": self.organization.slug, "version": release_1.version}, + kwargs={ + "organization_id_or_slug": self.organization.slug, + "version": release_1.version, + }, ) response = self.client.get(url, {"project": self.project1.id, "summaryStatsPeriod": "24h"}) assert response.status_code == 200 @@ -460,7 +487,10 @@ def test_get_first_and_last_release_on_date_sort(self): # Test for middle release of the list url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": self.organization.slug, "version": release_1.version}, + kwargs={ + "organization_id_or_slug": self.organization.slug, + "version": release_1.version, + }, ) response = self.client.get(url, {"project": self.project1.id}) assert response.status_code == 200 @@ -496,7 +526,10 @@ def test_get_first_and_last_release_on_date_sort_with_exact_same_date(self): # Test for middle release of the list url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": self.organization.slug, "version": release_1.version}, + kwargs={ + "organization_id_or_slug": self.organization.slug, + "version": release_1.version, + }, ) response = self.client.get(url, {"project": self.project1.id}) assert response.status_code == 200 @@ -543,7 +576,10 @@ def test_get_first_and_last_release_on_date_sort_env_filter_applied(self): # Test for middle release of the list url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": self.organization.slug, "version": release_3.version}, + kwargs={ + "organization_id_or_slug": self.organization.slug, + "version": release_3.version, + }, ) response = self.client.get(url, {"project": self.project1.id, "environment": ["prod"]}) assert response.status_code == 200 @@ -566,7 +602,10 @@ def test_get_first_and_last_release_on_non_date_sort(self): # Test for middle release of the list url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": self.organization.slug, "version": release_1.version}, + kwargs={ + "organization_id_or_slug": self.organization.slug, + "version": release_1.version, + }, ) response = self.client.get(url, {"project": self.project1.id, "sort": "sessions"}) assert response.status_code == 400 @@ -591,7 +630,7 @@ def test_get_first_and_last_release_when_project_has_no_releases(self): # Test for middle release of the list url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": self.organization.slug, "version": release.version}, + kwargs={"organization_id_or_slug": self.organization.slug, "version": release.version}, ) response = self.client.get(url, {"project": self.project1.id, "environment": ["test"]}) assert response.status_code == 200 @@ -614,7 +653,7 @@ def test_with_adoption_stages(self): release1.add_project(project1) url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": self.organization.slug, "version": release1.version}, + kwargs={"organization_id_or_slug": self.organization.slug, "version": release1.version}, ) response = self.client.get(url, format="json") @@ -662,7 +701,7 @@ def test_simple(self, mock_fetch_commits): url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": org.slug, "version": base_release.version}, + kwargs={"organization_id_or_slug": org.slug, "version": base_release.version}, ) self.client.put( url, @@ -677,7 +716,7 @@ def test_simple(self, mock_fetch_commits): url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": org.slug, "version": release.version}, + kwargs={"organization_id_or_slug": org.slug, "version": release.version}, ) response = self.client.put( url, @@ -711,7 +750,7 @@ def test_simple(self, mock_fetch_commits): # no access url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": org.slug, "version": release2.version}, + kwargs={"organization_id_or_slug": org.slug, "version": release2.version}, ) response = self.client.put(url, {"ref": "master"}) assert response.status_code == 404 @@ -750,7 +789,7 @@ def test_deprecated_head_commits(self, mock_fetch_commits): url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": org.slug, "version": base_release.version}, + kwargs={"organization_id_or_slug": org.slug, "version": base_release.version}, ) self.client.put( url, @@ -765,7 +804,7 @@ def test_deprecated_head_commits(self, mock_fetch_commits): url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": org.slug, "version": release.version}, + kwargs={"organization_id_or_slug": org.slug, "version": release.version}, ) response = self.client.put( url, @@ -799,7 +838,7 @@ def test_deprecated_head_commits(self, mock_fetch_commits): # no access url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": org.slug, "version": release2.version}, + kwargs={"organization_id_or_slug": org.slug, "version": release2.version}, ) response = self.client.put(url, {"ref": "master"}) assert response.status_code == 404 @@ -820,7 +859,7 @@ def test_commits(self): url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": org.slug, "version": release.version}, + kwargs={"organization_id_or_slug": org.slug, "version": release.version}, ) response = self.client.put(url, data={"commits": [{"id": "a" * 40}, {"id": "b" * 40}]}) @@ -851,7 +890,7 @@ def test_commits_patchset_character_limit_255(self): url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": org.slug, "version": release.version}, + kwargs={"organization_id_or_slug": org.slug, "version": release.version}, ) response = self.client.put( url, @@ -892,7 +931,7 @@ def test_commits_patchset_character_limit_reached(self): url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": org.slug, "version": release.version}, + kwargs={"organization_id_or_slug": org.slug, "version": release.version}, ) response = self.client.put( url, @@ -930,7 +969,7 @@ def test_commits_lock_conflict(self): url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": org.slug, "version": release.version}, + kwargs={"organization_id_or_slug": org.slug, "version": release.version}, ) response = self.client.put(url, data={"commits": [{"id": "a" * 40}, {"id": "b" * 40}]}) assert response.status_code == 409, (response.status_code, response.content) @@ -956,7 +995,7 @@ def test_release_archiving(self): url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": org.slug, "version": release.version}, + kwargs={"organization_id_or_slug": org.slug, "version": release.version}, ) response = self.client.put(url, data={"status": "archived"}) @@ -984,7 +1023,7 @@ def test_activity_generation(self): url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": org.slug, "version": release.version}, + kwargs={"organization_id_or_slug": org.slug, "version": release.version}, ) response = self.client.put(url, data={"dateReleased": datetime.now(UTC).isoformat()}) @@ -1018,7 +1057,7 @@ def test_activity_generation_long_release(self): url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": org.slug, "version": release.version}, + kwargs={"organization_id_or_slug": org.slug, "version": release.version}, ) response = self.client.put(url, data={"dateReleased": datetime.now(UTC).isoformat()}) @@ -1061,7 +1100,7 @@ def test_org_auth_token(self): url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": org.slug, "version": base_release.version}, + kwargs={"organization_id_or_slug": org.slug, "version": base_release.version}, ) self.client.put( url, @@ -1076,7 +1115,7 @@ def test_org_auth_token(self): url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": org.slug, "version": release.version}, + kwargs={"organization_id_or_slug": org.slug, "version": release.version}, ) response = self.client.put( url, @@ -1123,7 +1162,7 @@ def test_simple(self): url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": org.slug, "version": release.version}, + kwargs={"organization_id_or_slug": org.slug, "version": release.version}, ) response = self.client.delete(url) @@ -1153,7 +1192,7 @@ def test_existing_group(self): url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": org.slug, "version": release.version}, + kwargs={"organization_id_or_slug": org.slug, "version": release.version}, ) response = self.client.delete(url) @@ -1178,7 +1217,7 @@ def test_bad_repo_name(self): url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": org.slug, "version": release.version}, + kwargs={"organization_id_or_slug": org.slug, "version": release.version}, ) response = self.client.put( url, @@ -1209,7 +1248,7 @@ def test_bad_commit_list(self): url = reverse( "sentry-api-0-organization-release-details", - kwargs={"organization_slug": org.slug, "version": release.version}, + kwargs={"organization_id_or_slug": org.slug, "version": release.version}, ) response = self.client.put( url, diff --git a/tests/sentry/api/endpoints/test_organization_release_file_details.py b/tests/sentry/api/endpoints/test_organization_release_file_details.py index 4e8b8d0ca3c8c0..96635ec40aa994 100644 --- a/tests/sentry/api/endpoints/test_organization_release_file_details.py +++ b/tests/sentry/api/endpoints/test_organization_release_file_details.py @@ -29,7 +29,7 @@ def test_simple(self): url = reverse( "sentry-api-0-organization-release-file-details", kwargs={ - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "version": release.version, "file_id": releasefile.id, }, @@ -64,7 +64,7 @@ def test_file_download(self): url = reverse( "sentry-api-0-organization-release-file-details", kwargs={ - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "version": release.version, "file_id": releasefile.id, }, @@ -86,7 +86,7 @@ def _get(self, file_id): url = reverse( "sentry-api-0-organization-release-file-details", kwargs={ - "organization_slug": self.project.organization.slug, + "organization_id_or_slug": self.project.organization.slug, "version": self.release.version, "file_id": file_id, }, @@ -138,7 +138,7 @@ def test_simple(self): url = reverse( "sentry-api-0-organization-release-file-details", kwargs={ - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "version": release.version, "file_id": releasefile.id, }, @@ -179,7 +179,7 @@ def test_simple(self): url = reverse( "sentry-api-0-organization-release-file-details", kwargs={ - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "version": release.version, "file_id": releasefile.id, }, diff --git a/tests/sentry/api/endpoints/test_organization_release_files.py b/tests/sentry/api/endpoints/test_organization_release_files.py index 37f508d7ce7dfb..f26c99288e31d2 100644 --- a/tests/sentry/api/endpoints/test_organization_release_files.py +++ b/tests/sentry/api/endpoints/test_organization_release_files.py @@ -24,7 +24,10 @@ def test_simple(self): url = reverse( "sentry-api-0-organization-release-files", - kwargs={"organization_slug": project.organization.slug, "version": release.version}, + kwargs={ + "organization_id_or_slug": project.organization.slug, + "version": release.version, + }, ) self.login_as(user=self.user) @@ -56,7 +59,10 @@ def test_name_search(self): url = reverse( "sentry-api-0-organization-release-files", - kwargs={"organization_slug": project.organization.slug, "version": release.version}, + kwargs={ + "organization_id_or_slug": project.organization.slug, + "version": release.version, + }, ) self.login_as(user=self.user) @@ -115,7 +121,10 @@ def test_checksum_search(self): url = reverse( "sentry-api-0-organization-release-files", - kwargs={"organization_slug": project.organization.slug, "version": release.version}, + kwargs={ + "organization_id_or_slug": project.organization.slug, + "version": release.version, + }, ) self.login_as(user=self.user) @@ -172,7 +181,10 @@ def test_queries_should_be_narrowing_search(self): url = reverse( "sentry-api-0-organization-release-files", - kwargs={"organization_slug": project.organization.slug, "version": release.version}, + kwargs={ + "organization_id_or_slug": project.organization.slug, + "version": release.version, + }, ) self.login_as(user=self.user) @@ -204,7 +216,10 @@ def test_simple(self): url = reverse( "sentry-api-0-organization-release-files", - kwargs={"organization_slug": project.organization.slug, "version": release.version}, + kwargs={ + "organization_id_or_slug": project.organization.slug, + "version": release.version, + }, ) self.login_as(user=self.user) @@ -241,7 +256,10 @@ def test_no_file(self): url = reverse( "sentry-api-0-organization-release-files", - kwargs={"organization_slug": project.organization.slug, "version": release.version}, + kwargs={ + "organization_id_or_slug": project.organization.slug, + "version": release.version, + }, ) self.login_as(user=self.user) @@ -260,7 +278,10 @@ def test_missing_name(self): url = reverse( "sentry-api-0-organization-release-files", - kwargs={"organization_slug": project.organization.slug, "version": release.version}, + kwargs={ + "organization_id_or_slug": project.organization.slug, + "version": release.version, + }, ) self.login_as(user=self.user) @@ -289,7 +310,10 @@ def test_invalid_name(self): url = reverse( "sentry-api-0-organization-release-files", - kwargs={"organization_slug": project.organization.slug, "version": release.version}, + kwargs={ + "organization_id_or_slug": project.organization.slug, + "version": release.version, + }, ) self.login_as(user=self.user) @@ -316,7 +340,10 @@ def test_bad_headers(self): url = reverse( "sentry-api-0-organization-release-files", - kwargs={"organization_slug": project.organization.slug, "version": release.version}, + kwargs={ + "organization_id_or_slug": project.organization.slug, + "version": release.version, + }, ) self.login_as(user=self.user) @@ -359,7 +386,10 @@ def test_duplicate_file(self): url = reverse( "sentry-api-0-organization-release-files", - kwargs={"organization_slug": project.organization.slug, "version": release.version}, + kwargs={ + "organization_id_or_slug": project.organization.slug, + "version": release.version, + }, ) self.login_as(user=self.user) diff --git a/tests/sentry/api/endpoints/test_organization_release_meta.py b/tests/sentry/api/endpoints/test_organization_release_meta.py index c2a88091e20b85..98329dea44b408 100644 --- a/tests/sentry/api/endpoints/test_organization_release_meta.py +++ b/tests/sentry/api/endpoints/test_organization_release_meta.py @@ -70,7 +70,7 @@ def test_multiple_projects(self): url = reverse( "sentry-api-0-organization-release-meta", - kwargs={"organization_slug": org.slug, "version": release.version}, + kwargs={"organization_id_or_slug": org.slug, "version": release.version}, ) response = self.client.get(url) @@ -104,7 +104,7 @@ def test_artifact_count_without_weak_association(self): url = reverse( "sentry-api-0-organization-release-meta", - kwargs={"organization_slug": org.slug, "version": release.version}, + kwargs={"organization_id_or_slug": org.slug, "version": release.version}, ) response = self.client.get(url) @@ -142,7 +142,7 @@ def test_artifact_count_with_single_weak_association(self): url = reverse( "sentry-api-0-organization-release-meta", - kwargs={"organization_slug": org.slug, "version": release.version}, + kwargs={"organization_id_or_slug": org.slug, "version": release.version}, ) response = self.client.get(url) @@ -193,7 +193,7 @@ def test_artifact_count_with_multiple_weak_association(self): url = reverse( "sentry-api-0-organization-release-meta", - kwargs={"organization_slug": org.slug, "version": release.version}, + kwargs={"organization_id_or_slug": org.slug, "version": release.version}, ) response = self.client.get(url) diff --git a/tests/sentry/api/endpoints/test_organization_release_previous_commits.py b/tests/sentry/api/endpoints/test_organization_release_previous_commits.py index 80cee1409f0632..8585d4df8ee837 100644 --- a/tests/sentry/api/endpoints/test_organization_release_previous_commits.py +++ b/tests/sentry/api/endpoints/test_organization_release_previous_commits.py @@ -49,7 +49,10 @@ def setUp(self): new_release.add_project(self.project2) self.url = reverse( "sentry-api-0-organization-release-previous-with-commits", - kwargs={"organization_slug": self.organization.slug, "version": new_release.version}, + kwargs={ + "organization_id_or_slug": self.organization.slug, + "version": new_release.version, + }, ) def test_previous_release_has_commits(self): @@ -68,7 +71,10 @@ def test_no_previous_release_with_commit(self): new_release.add_project(self.project2) url = reverse( "sentry-api-0-organization-release-previous-with-commits", - kwargs={"organization_slug": self.organization.slug, "version": new_release.version}, + kwargs={ + "organization_id_or_slug": self.organization.slug, + "version": new_release.version, + }, ) response = self.client.get(url) assert response.status_code == 200, response.content @@ -80,7 +86,7 @@ def test_wrong_release_version(self): url = reverse( "sentry-api-0-organization-release-previous-with-commits", - kwargs={"organization_slug": self.organization.slug, "version": release.version}, + kwargs={"organization_id_or_slug": self.organization.slug, "version": release.version}, ) response = self.client.get(url) diff --git a/tests/sentry/api/endpoints/test_organization_releases.py b/tests/sentry/api/endpoints/test_organization_releases.py index 971890aa0fd86b..4e51e37f7c5c47 100644 --- a/tests/sentry/api/endpoints/test_organization_releases.py +++ b/tests/sentry/api/endpoints/test_organization_releases.py @@ -373,14 +373,18 @@ def test_query_filter_suffix(self): ) release.add_project(project) - url = reverse("sentry-api-0-organization-releases", kwargs={"organization_slug": org.slug}) + url = reverse( + "sentry-api-0-organization-releases", kwargs={"organization_id_or_slug": org.slug} + ) response = self.client.get(url + "?query=1.0+(1234)", format="json") assert response.status_code == 200, response.content assert len(response.data) == 1 assert response.data[0]["version"] == release.version - url = reverse("sentry-api-0-organization-releases", kwargs={"organization_slug": org.slug}) + url = reverse( + "sentry-api-0-organization-releases", kwargs={"organization_id_or_slug": org.slug} + ) response = self.client.get(url + "?query=1.0%2B1234", format="json") assert response.status_code == 200, response.content @@ -739,7 +743,7 @@ def test_archive_release(self): self.login_as(user=self.user) url = reverse( "sentry-api-0-organization-releases", - kwargs={"organization_slug": self.organization.slug}, + kwargs={"organization_id_or_slug": self.organization.slug}, ) # test legacy status value of None (=open) @@ -810,7 +814,7 @@ def test_simple(self): url = reverse( "sentry-api-0-organization-releases-stats", - kwargs={"organization_slug": self.organization.slug}, + kwargs={"organization_id_or_slug": self.organization.slug}, ) response = self.client.get(url, format="json") @@ -869,7 +873,7 @@ def test_release_list_order_by_date_added(self): url = reverse( "sentry-api-0-organization-releases-stats", - kwargs={"organization_slug": self.organization.slug}, + kwargs={"organization_id_or_slug": self.organization.slug}, ) response = self.client.get(url, format="json") @@ -893,7 +897,9 @@ def test_with_adoption_stages(self): date_added=datetime(2013, 8, 13, 3, 8, 24, 880386, tzinfo=UTC), ) release1.add_project(project1) - url = reverse("sentry-api-0-organization-releases", kwargs={"organization_slug": org.slug}) + url = reverse( + "sentry-api-0-organization-releases", kwargs={"organization_id_or_slug": org.slug} + ) response = self.client.get(url, format="json") @@ -1125,7 +1131,9 @@ def test_empty_release_version(self): self.create_member(teams=[team], user=user, organization=org) self.login_as(user=user) - url = reverse("sentry-api-0-organization-releases", kwargs={"organization_slug": org.slug}) + url = reverse( + "sentry-api-0-organization-releases", kwargs={"organization_id_or_slug": org.slug} + ) response = self.client.post( url, data={"version": "", "projects": [project.slug, project2.slug]} ) @@ -1145,7 +1153,9 @@ def test_minimal(self): self.create_member(teams=[team], user=user, organization=org) self.login_as(user=user) - url = reverse("sentry-api-0-organization-releases", kwargs={"organization_slug": org.slug}) + url = reverse( + "sentry-api-0-organization-releases", kwargs={"organization_id_or_slug": org.slug} + ) response = self.client.post( url, data={"version": "1.2.1", "projects": [project.slug, project2.slug]}, @@ -1180,7 +1190,9 @@ def test_duplicate(self): release = Release.objects.create(version="1.2.1", organization=org) - url = reverse("sentry-api-0-organization-releases", kwargs={"organization_slug": org.slug}) + url = reverse( + "sentry-api-0-organization-releases", kwargs={"organization_id_or_slug": org.slug} + ) with self.tasks(): response = self.client.post( @@ -1272,7 +1284,9 @@ def test_activity(self): ) release.add_project(project) - url = reverse("sentry-api-0-organization-releases", kwargs={"organization_slug": org.slug}) + url = reverse( + "sentry-api-0-organization-releases", kwargs={"organization_id_or_slug": org.slug} + ) response = self.client.post(url, data={"version": "1.2.1", "projects": [project.slug]}) assert response.status_code == 208, response.content @@ -1308,7 +1322,9 @@ def test_activity_with_long_release(self): ) release.add_project(project) - url = reverse("sentry-api-0-organization-releases", kwargs={"organization_slug": org.slug}) + url = reverse( + "sentry-api-0-organization-releases", kwargs={"organization_id_or_slug": org.slug} + ) response = self.client.post(url, data={"version": "x" * 65, "projects": [project.slug]}) assert response.status_code == 208, response.content @@ -1338,7 +1354,9 @@ def test_version_whitespace(self): self.create_member(teams=[team], user=user, organization=org) self.login_as(user=user) - url = reverse("sentry-api-0-organization-releases", kwargs={"organization_slug": org.slug}) + url = reverse( + "sentry-api-0-organization-releases", kwargs={"organization_id_or_slug": org.slug} + ) response = self.client.post(url, data={"version": "1.2.3\n", "projects": [project.slug]}) assert response.status_code == 400, response.content @@ -1375,7 +1393,9 @@ def test_features(self): self.create_member(teams=[team], user=self.user, organization=org) self.login_as(user=user) - url = reverse("sentry-api-0-organization-releases", kwargs={"organization_slug": org.slug}) + url = reverse( + "sentry-api-0-organization-releases", kwargs={"organization_id_or_slug": org.slug} + ) response = self.client.post( url, data={"version": "1.2.1", "owner": self.user.email, "projects": [project.slug]} ) @@ -1398,7 +1418,9 @@ def test_commits(self): self.create_member(teams=[team], user=user, organization=org) self.login_as(user=user) - url = reverse("sentry-api-0-organization-releases", kwargs={"organization_slug": org.slug}) + url = reverse( + "sentry-api-0-organization-releases", kwargs={"organization_id_or_slug": org.slug} + ) response = self.client.post( url, data={ @@ -1442,7 +1464,9 @@ def test_commits_from_provider(self, mock_fetch_commits): self.create_member(teams=[team], user=user, organization=org) self.login_as(user=user) - url = reverse("sentry-api-0-organization-releases", kwargs={"organization_slug": org.slug}) + url = reverse( + "sentry-api-0-organization-releases", kwargs={"organization_id_or_slug": org.slug} + ) self.client.post( url, data={ @@ -1499,7 +1523,9 @@ def test_commits_from_provider_deprecated_head_commits(self, mock_fetch_commits) self.create_member(teams=[team], user=user, organization=org) self.login_as(user=user) - url = reverse("sentry-api-0-organization-releases", kwargs={"organization_slug": org.slug}) + url = reverse( + "sentry-api-0-organization-releases", kwargs={"organization_id_or_slug": org.slug} + ) self.client.post( url, data={ @@ -1555,7 +1581,9 @@ def test_commits_lock_conflict(self): lock = locks.get(Release.get_lock_key(org.id, release.id), duration=10, name="release") lock.acquire() - url = reverse("sentry-api-0-organization-releases", kwargs={"organization_slug": org.slug}) + url = reverse( + "sentry-api-0-organization-releases", kwargs={"organization_id_or_slug": org.slug} + ) response = self.client.post( url, data={ @@ -1579,7 +1607,9 @@ def test_bad_project_slug(self): self.create_member(teams=[team], user=user, organization=org) self.login_as(user=user) - url = reverse("sentry-api-0-organization-releases", kwargs={"organization_slug": org.slug}) + url = reverse( + "sentry-api-0-organization-releases", kwargs={"organization_id_or_slug": org.slug} + ) response = self.client.post( url, data={"version": "1.2.1", "projects": [project.slug, "banana"]} ) @@ -1623,7 +1653,9 @@ def test_project_permissions(self): ) release3.add_project(project1) - url = reverse("sentry-api-0-organization-releases", kwargs={"organization_slug": org.slug}) + url = reverse( + "sentry-api-0-organization-releases", kwargs={"organization_id_or_slug": org.slug} + ) response = self.client.post( url, data={"version": "1.2.1", "projects": [project1.slug, project2.slug]} ) @@ -1651,7 +1683,9 @@ def test_api_key(self): ) release1.add_project(project1) - url = reverse("sentry-api-0-organization-releases", kwargs={"organization_slug": org.slug}) + url = reverse( + "sentry-api-0-organization-releases", kwargs={"organization_id_or_slug": org.slug} + ) # test right org, wrong permissions level with assume_test_silo_mode(SiloMode.CONTROL): @@ -1703,7 +1737,9 @@ def test_org_auth_token(self): ) release1.add_project(project1) - url = reverse("sentry-api-0-organization-releases", kwargs={"organization_slug": org.slug}) + url = reverse( + "sentry-api-0-organization-releases", kwargs={"organization_id_or_slug": org.slug} + ) # test right org, wrong permissions level with assume_test_silo_mode(SiloMode.CONTROL): @@ -1794,7 +1830,9 @@ def test_api_token(self, mock_fetch_commits): ) release1.add_project(project1) - url = reverse("sentry-api-0-organization-releases", kwargs={"organization_slug": org.slug}) + url = reverse( + "sentry-api-0-organization-releases", kwargs={"organization_id_or_slug": org.slug} + ) response = self.client.post( url, @@ -1835,7 +1873,9 @@ def test_bad_repo_name(self): self.create_member(teams=[team], user=user, organization=org) self.login_as(user=user) - url = reverse("sentry-api-0-organization-releases", kwargs={"organization_slug": org.slug}) + url = reverse( + "sentry-api-0-organization-releases", kwargs={"organization_id_or_slug": org.slug} + ) response = self.client.post( url, data={ @@ -1852,7 +1892,7 @@ class OrganizationReleaseCommitRangesTest(SetRefsTestCase): def setUp(self): super().setUp() self.url = reverse( - "sentry-api-0-organization-releases", kwargs={"organization_slug": self.org.slug} + "sentry-api-0-organization-releases", kwargs={"organization_id_or_slug": self.org.slug} ) @patch("sentry.tasks.commits.fetch_commits") @@ -2046,7 +2086,7 @@ def assert_releases(self, response, releases): def test_environments_filter(self): url = reverse( - "sentry-api-0-organization-releases", kwargs={"organization_slug": self.org.slug} + "sentry-api-0-organization-releases", kwargs={"organization_id_or_slug": self.org.slug} ) response = self.client.get(url + "?environment=" + self.env1.name, format="json") self.assert_releases(response, [self.release1, self.release5]) @@ -2056,7 +2096,7 @@ def test_environments_filter(self): def test_empty_environment(self): url = reverse( - "sentry-api-0-organization-releases", kwargs={"organization_slug": self.org.slug} + "sentry-api-0-organization-releases", kwargs={"organization_id_or_slug": self.org.slug} ) env = self.make_environment("", self.project2) ReleaseProjectEnvironment.objects.create( @@ -2067,7 +2107,7 @@ def test_empty_environment(self): def test_all_environments(self): url = reverse( - "sentry-api-0-organization-releases", kwargs={"organization_slug": self.org.slug} + "sentry-api-0-organization-releases", kwargs={"organization_id_or_slug": self.org.slug} ) response = self.client.get(url, format="json") self.assert_releases( @@ -2076,14 +2116,14 @@ def test_all_environments(self): def test_invalid_environment(self): url = reverse( - "sentry-api-0-organization-releases", kwargs={"organization_slug": self.org.slug} + "sentry-api-0-organization-releases", kwargs={"organization_id_or_slug": self.org.slug} ) response = self.client.get(url + "?environment=" + "invalid_environment", format="json") assert response.status_code == 404 def test_specify_project_ids(self): url = reverse( - "sentry-api-0-organization-releases", kwargs={"organization_slug": self.org.slug} + "sentry-api-0-organization-releases", kwargs={"organization_id_or_slug": self.org.slug} ) response = self.client.get(url, format="json", data={"project": self.project1.id}) self.assert_releases(response, [self.release1, self.release3, self.release5]) @@ -2098,7 +2138,7 @@ def test_specify_project_ids(self): def test_date_range(self): url = reverse( - "sentry-api-0-organization-releases", kwargs={"organization_slug": self.org.slug} + "sentry-api-0-organization-releases", kwargs={"organization_id_or_slug": self.org.slug} ) response = self.client.get( url, @@ -2112,7 +2152,7 @@ def test_date_range(self): def test_invalid_date_range(self): url = reverse( - "sentry-api-0-organization-releases", kwargs={"organization_slug": self.org.slug} + "sentry-api-0-organization-releases", kwargs={"organization_id_or_slug": self.org.slug} ) response = self.client.get(url, format="json", data={"start": "null", "end": "null"}) assert response.status_code == 400 @@ -2122,7 +2162,7 @@ class OrganizationReleaseCreateCommitPatch(ReleaseCommitPatchTest): @cached_property def url(self): return reverse( - "sentry-api-0-organization-releases", kwargs={"organization_slug": self.org.slug} + "sentry-api-0-organization-releases", kwargs={"organization_id_or_slug": self.org.slug} ) def test_commits_with_patch_set(self): diff --git a/tests/sentry/api/endpoints/test_organization_shortid.py b/tests/sentry/api/endpoints/test_organization_shortid.py index 2b162f37513494..7d412f44744849 100644 --- a/tests/sentry/api/endpoints/test_organization_shortid.py +++ b/tests/sentry/api/endpoints/test_organization_shortid.py @@ -15,7 +15,7 @@ def test_simple(self): self.login_as(user=self.user) url = reverse( "sentry-api-0-short-id-lookup", - kwargs={"organization_slug": org.slug, "short_id": group.qualified_short_id}, + kwargs={"organization_id_or_slug": org.slug, "short_id": group.qualified_short_id}, ) response = self.client.get(url, format="json") diff --git a/tests/sentry/api/endpoints/test_project_release_file_details.py b/tests/sentry/api/endpoints/test_project_release_file_details.py index a1d07ef155e75b..78bd0924f42f98 100644 --- a/tests/sentry/api/endpoints/test_project_release_file_details.py +++ b/tests/sentry/api/endpoints/test_project_release_file_details.py @@ -41,7 +41,7 @@ def test_simple(self): url = reverse( "sentry-api-0-project-release-file-details", kwargs={ - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "project_id_or_slug": project.slug, "version": release.version, "file_id": releasefile.id, @@ -77,7 +77,7 @@ def test_file_download(self): url = reverse( "sentry-api-0-project-release-file-details", kwargs={ - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "project_id_or_slug": project.slug, "version": release.version, "file_id": releasefile.id, @@ -121,7 +121,7 @@ def _get(self, file_id, postfix=""): url = reverse( "sentry-api-0-project-release-file-details", kwargs={ - "organization_slug": self.project.organization.slug, + "organization_id_or_slug": self.project.organization.slug, "project_id_or_slug": self.project.slug, "version": self.release.version, "file_id": file_id, @@ -204,7 +204,7 @@ def test_simple(self): url = reverse( "sentry-api-0-project-release-file-details", kwargs={ - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "project_id_or_slug": project.slug, "version": release.version, "file_id": releasefile.id, @@ -229,7 +229,7 @@ def test_update_archived(self): url = reverse( "sentry-api-0-project-release-file-details", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "project_id_or_slug": self.project.slug, "version": self.release.version, "file_id": id, @@ -266,7 +266,7 @@ def test_simple(self): url = reverse( "sentry-api-0-project-release-file-details", kwargs={ - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "project_id_or_slug": project.slug, "version": release.version, "file_id": releasefile.id, @@ -290,7 +290,7 @@ def test_delete_archived(self): url = lambda id: reverse( "sentry-api-0-project-release-file-details", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "project_id_or_slug": self.project.slug, "version": self.release.version, "file_id": id, diff --git a/tests/sentry/api/endpoints/test_project_release_files.py b/tests/sentry/api/endpoints/test_project_release_files.py index a350c415924dbe..482469614ecf7b 100644 --- a/tests/sentry/api/endpoints/test_project_release_files.py +++ b/tests/sentry/api/endpoints/test_project_release_files.py @@ -28,7 +28,7 @@ def test_simple(self): url = reverse( "sentry-api-0-project-release-files", kwargs={ - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "project_id_or_slug": project.slug, "version": release.version, }, @@ -49,7 +49,7 @@ def test_with_archive(self): url = reverse( "sentry-api-0-project-release-files", kwargs={ - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "project_id_or_slug": project.slug, "version": release.version, }, @@ -131,7 +131,7 @@ def test_sort_order(self): url = reverse( "sentry-api-0-project-release-files", kwargs={ - "organization_slug": self.project.organization.slug, + "organization_id_or_slug": self.project.organization.slug, "project_id_or_slug": self.project.slug, "version": self.release.version, }, @@ -148,7 +148,7 @@ def test_archive_name_search(self): url = reverse( "sentry-api-0-project-release-files", kwargs={ - "organization_slug": self.project.organization.slug, + "organization_id_or_slug": self.project.organization.slug, "project_id_or_slug": self.project.slug, "version": self.release.version, }, @@ -164,7 +164,7 @@ def test_archive_checksum_search(self): url = reverse( "sentry-api-0-project-release-files", kwargs={ - "organization_slug": self.project.organization.slug, + "organization_id_or_slug": self.project.organization.slug, "project_id_or_slug": self.project.slug, "version": self.release.version, }, @@ -199,7 +199,7 @@ def test_archive_queries_should_be_narrowing_search(self): url = reverse( "sentry-api-0-project-release-files", kwargs={ - "organization_slug": self.project.organization.slug, + "organization_id_or_slug": self.project.organization.slug, "project_id_or_slug": self.project.slug, "version": self.release.version, }, @@ -226,7 +226,7 @@ def test_archive_paging(self): url = reverse( "sentry-api-0-project-release-files", kwargs={ - "organization_slug": self.project.organization.slug, + "organization_id_or_slug": self.project.organization.slug, "project_id_or_slug": self.project.slug, "version": self.release.version, }, @@ -255,7 +255,7 @@ def test_simple(self): url = reverse( "sentry-api-0-project-release-files", kwargs={ - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "project_id_or_slug": project.slug, "version": release.version, }, @@ -296,7 +296,7 @@ def test_no_file(self): url = reverse( "sentry-api-0-project-release-files", kwargs={ - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "project_id_or_slug": project.slug, "version": release.version, }, @@ -319,7 +319,7 @@ def test_missing_name(self): url = reverse( "sentry-api-0-project-release-files", kwargs={ - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "project_id_or_slug": project.slug, "version": release.version, }, @@ -352,7 +352,7 @@ def test_invalid_name(self): url = reverse( "sentry-api-0-project-release-files", kwargs={ - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "project_id_or_slug": project.slug, "version": release.version, }, @@ -383,7 +383,7 @@ def test_bad_headers(self): url = reverse( "sentry-api-0-project-release-files", kwargs={ - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "project_id_or_slug": project.slug, "version": release.version, }, @@ -430,7 +430,7 @@ def test_duplicate_file(self): url = reverse( "sentry-api-0-project-release-files", kwargs={ - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "project_id_or_slug": project.slug, "version": release.version, }, diff --git a/tests/sentry/api/endpoints/test_project_stats.py b/tests/sentry/api/endpoints/test_project_stats.py index 947cef1439999d..a4582ba0dc8de4 100644 --- a/tests/sentry/api/endpoints/test_project_stats.py +++ b/tests/sentry/api/endpoints/test_project_stats.py @@ -46,7 +46,7 @@ def test_simple(self): url = reverse( "sentry-api-0-project-stats", kwargs={ - "organization_slug": project1.organization.slug, + "organization_id_or_slug": project1.organization.slug, "project_id_or_slug": project1.slug, }, ) @@ -92,7 +92,7 @@ def test_get_error_message_stats(self): url = reverse( "sentry-api-0-project-stats", kwargs={ - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "project_id_or_slug": project.slug, }, ) diff --git a/tests/sentry/api/endpoints/test_project_tagkey_details.py b/tests/sentry/api/endpoints/test_project_tagkey_details.py index 9f8c00b13fa870..6da793f7f26cbe 100644 --- a/tests/sentry/api/endpoints/test_project_tagkey_details.py +++ b/tests/sentry/api/endpoints/test_project_tagkey_details.py @@ -32,7 +32,7 @@ def make_event(i): url = reverse( "sentry-api-0-project-tagkey-details", kwargs={ - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "project_id_or_slug": project.slug, "key": "foo", }, @@ -64,7 +64,7 @@ def test_simple(self, mock_eventstream): url = reverse( "sentry-api-0-project-tagkey-details", kwargs={ - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "project_id_or_slug": project.slug, "key": key, }, @@ -89,7 +89,7 @@ def test_protected(self): url = reverse( "sentry-api-0-project-tagkey-details", kwargs={ - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "project_id_or_slug": project.slug, "key": "environment", }, diff --git a/tests/sentry/api/endpoints/test_project_tagkey_values.py b/tests/sentry/api/endpoints/test_project_tagkey_values.py index da7ba2de5595be..ac39a691e60e44 100644 --- a/tests/sentry/api/endpoints/test_project_tagkey_values.py +++ b/tests/sentry/api/endpoints/test_project_tagkey_values.py @@ -17,7 +17,7 @@ def test_simple(self): url = reverse( "sentry-api-0-project-tagkey-values", kwargs={ - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "project_id_or_slug": project.slug, "key": "foo", }, @@ -42,7 +42,7 @@ def test_query(self): url = reverse( "sentry-api-0-project-tagkey-values", kwargs={ - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "project_id_or_slug": project.slug, "key": "foo", }, @@ -71,7 +71,7 @@ def test_statperiod_query(self): url = reverse( "sentry-api-0-project-tagkey-values", kwargs={ - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "project_id_or_slug": project.slug, "key": "foo", }, @@ -99,7 +99,7 @@ def test_start_end_query(self): url = reverse( "sentry-api-0-project-tagkey-values", kwargs={ - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "project_id_or_slug": project.slug, "key": "foo", }, diff --git a/tests/sentry/api/endpoints/test_release_deploys.py b/tests/sentry/api/endpoints/test_release_deploys.py index 50dbe1a58585a7..0478c41cdf3078 100644 --- a/tests/sentry/api/endpoints/test_release_deploys.py +++ b/tests/sentry/api/endpoints/test_release_deploys.py @@ -57,7 +57,10 @@ def test_simple(self): url = reverse( "sentry-api-0-organization-release-deploys", - kwargs={"organization_slug": project.organization.slug, "version": release.version}, + kwargs={ + "organization_id_or_slug": project.organization.slug, + "version": release.version, + }, ) self.login_as(user=self.user) @@ -102,7 +105,10 @@ def test_with_project(self): url = reverse( "sentry-api-0-organization-release-deploys", - kwargs={"organization_slug": project.organization.slug, "version": release.version}, + kwargs={ + "organization_id_or_slug": project.organization.slug, + "version": release.version, + }, ) self.login_as(user=self.user) @@ -152,7 +158,7 @@ def test_simple(self): url = reverse( "sentry-api-0-organization-release-deploys", kwargs={ - "organization_slug": self.org.slug, + "organization_id_or_slug": self.org.slug, "version": release.version, }, ) @@ -192,7 +198,7 @@ def test_with_project_slugs(self): url = reverse( "sentry-api-0-organization-release-deploys", kwargs={ - "organization_slug": self.org.slug, + "organization_id_or_slug": self.org.slug, "version": release.version, }, ) @@ -240,7 +246,7 @@ def test_with_invalid_project_slug(self): url = reverse( "sentry-api-0-organization-release-deploys", kwargs={ - "organization_slug": self.org.slug, + "organization_id_or_slug": self.org.slug, "version": release.version, }, ) @@ -268,7 +274,7 @@ def test_environment_validation_failure(self): url = reverse( "sentry-api-0-organization-release-deploys", kwargs={ - "organization_slug": self.org.slug, + "organization_id_or_slug": self.org.slug, "version": release.version, }, ) diff --git a/tests/sentry/api/endpoints/test_sudo.py b/tests/sentry/api/endpoints/test_sudo.py index 0bdbdd730747e1..d8c28d3dd66f91 100644 --- a/tests/sentry/api/endpoints/test_sudo.py +++ b/tests/sentry/api/endpoints/test_sudo.py @@ -9,7 +9,9 @@ class SudoTest(APITestCase): def test_sudo_required_del_org(self): org = self.create_organization() - url = reverse("sentry-api-0-organization-details", kwargs={"organization_slug": org.slug}) + url = reverse( + "sentry-api-0-organization-details", kwargs={"organization_id_or_slug": org.slug} + ) user = self.create_user(email="foo@example.com") self.create_member(organization=org, user=user, role="owner") diff --git a/tests/sentry/replays/test_organization_replay_count.py b/tests/sentry/replays/test_organization_replay_count.py index 45820302627a98..db69f9991db30a 100644 --- a/tests/sentry/replays/test_organization_replay_count.py +++ b/tests/sentry/replays/test_organization_replay_count.py @@ -34,7 +34,7 @@ def setUp(self): self.login_as(user=self.user) self.url = reverse( "sentry-api-0-organization-replay-count", - kwargs={"organization_slug": self.project.organization.slug}, + kwargs={"organization_id_or_slug": self.project.organization.slug}, ) self.features = {"organizations:session-replay": True} diff --git a/tests/sentry/replays/test_organization_replay_events_meta.py b/tests/sentry/replays/test_organization_replay_events_meta.py index 0789b689ca9878..84b82a5c1042b5 100644 --- a/tests/sentry/replays/test_organization_replay_events_meta.py +++ b/tests/sentry/replays/test_organization_replay_events_meta.py @@ -20,7 +20,7 @@ def setUp(self): self.project_2 = self.create_project() self.url = reverse( "sentry-api-0-organization-replay-events-meta", - kwargs={"organization_slug": self.project.organization.slug}, + kwargs={"organization_id_or_slug": self.project.organization.slug}, ) self.features = {"organizations:session-replay": True} diff --git a/tests/snuba/api/endpoints/test_organization_eventid.py b/tests/snuba/api/endpoints/test_organization_eventid.py index 6bc2be90a42aab..e3fae59feb5484 100644 --- a/tests/snuba/api/endpoints/test_organization_eventid.py +++ b/tests/snuba/api/endpoints/test_organization_eventid.py @@ -29,7 +29,7 @@ def setUp(self): def test_simple(self): url = reverse( "sentry-api-0-event-id-lookup", - kwargs={"organization_slug": self.org.slug, "event_id": self.event.event_id}, + kwargs={"organization_id_or_slug": self.org.slug, "event_id": self.event.event_id}, ) response = self.client.get(url, format="json") @@ -43,7 +43,7 @@ def test_simple(self): def test_missing_eventid(self): url = reverse( "sentry-api-0-event-id-lookup", - kwargs={"organization_slug": self.org.slug, "event_id": "c" * 32}, + kwargs={"organization_id_or_slug": self.org.slug, "event_id": "c" * 32}, ) response = self.client.get(url, format="json") @@ -53,7 +53,7 @@ def test_missing_eventid(self): def test_ratelimit(self): url = reverse( "sentry-api-0-event-id-lookup", - kwargs={"organization_slug": self.org.slug, "event_id": self.event.event_id}, + kwargs={"organization_id_or_slug": self.org.slug, "event_id": self.event.event_id}, ) with freeze_time("2000-01-01"): for i in range(10): @@ -66,14 +66,14 @@ def test_invalid_event_id(self): reverse( "sentry-api-0-event-id-lookup", kwargs={ - "organization_slug": self.org.slug, + "organization_id_or_slug": self.org.slug, "event_id": "not-an-event", }, ) url = reverse( "sentry-api-0-event-id-lookup", - kwargs={"organization_slug": self.org.slug, "event_id": 123456}, + kwargs={"organization_id_or_slug": self.org.slug, "event_id": 123456}, ) resp = self.client.get(url, format="json") diff --git a/tests/snuba/api/endpoints/test_project_event_details.py b/tests/snuba/api/endpoints/test_project_event_details.py index 1a0305e5794101..5d576eefaec5c3 100644 --- a/tests/snuba/api/endpoints/test_project_event_details.py +++ b/tests/snuba/api/endpoints/test_project_event_details.py @@ -56,7 +56,7 @@ def test_simple(self): kwargs={ "event_id": self.cur_event.event_id, "project_id_or_slug": self.project.slug, - "organization_slug": self.project.organization.slug, + "organization_id_or_slug": self.project.organization.slug, }, ) response = self.client.get(url, format="json") @@ -73,7 +73,7 @@ def test_snuba_no_prev(self): kwargs={ "event_id": self.prev_event.event_id, "project_id_or_slug": self.project.slug, - "organization_slug": self.project.organization.slug, + "organization_id_or_slug": self.project.organization.slug, }, ) response = self.client.get(url, format="json") @@ -90,7 +90,7 @@ def test_snuba_with_environment(self): kwargs={ "event_id": self.cur_event.event_id, "project_id_or_slug": self.project.slug, - "organization_slug": self.project.organization.slug, + "organization_id_or_slug": self.project.organization.slug, }, ) response = self.client.get( @@ -109,7 +109,7 @@ def test_ignores_different_group(self): kwargs={ "event_id": self.next_event.event_id, "project_id_or_slug": self.project.slug, - "organization_slug": self.project.organization.slug, + "organization_id_or_slug": self.project.organization.slug, }, ) response = self.client.get(url, format="json") @@ -180,7 +180,7 @@ def test_generic_event_with_occurrence(self): kwargs={ "event_id": self.cur_event.event_id, "project_id_or_slug": self.project.slug, - "organization_slug": self.project.organization.slug, + "organization_id_or_slug": self.project.organization.slug, }, ) response = self.client.get(url, format="json", data={"group_id": self.cur_group.id}) @@ -251,7 +251,7 @@ def test_transaction_event(self): kwargs={ "event_id": self.cur_transaction_event.event_id, "project_id_or_slug": self.cur_transaction_event.project.slug, - "organization_slug": self.cur_transaction_event.project.organization.slug, + "organization_id_or_slug": self.cur_transaction_event.project.organization.slug, }, ) response = self.client.get(url, format="json", data={"group_id": self.group.id}) @@ -269,7 +269,7 @@ def test_no_previous_event(self): kwargs={ "event_id": self.prev_transaction_event.event_id, "project_id_or_slug": self.prev_transaction_event.project.slug, - "organization_slug": self.prev_transaction_event.project.organization.slug, + "organization_id_or_slug": self.prev_transaction_event.project.organization.slug, }, ) response = self.client.get(url, format="json", data={"group_id": self.group.id}) @@ -287,7 +287,7 @@ def test_ignores_different_group(self): kwargs={ "event_id": self.next_transaction_event.event_id, "project_id_or_slug": self.next_transaction_event.project.slug, - "organization_slug": self.next_transaction_event.project.organization.slug, + "organization_id_or_slug": self.next_transaction_event.project.organization.slug, }, ) response = self.client.get(url, format="json", data={"group_id": self.group.id}) @@ -303,7 +303,7 @@ def test_no_group_id(self): kwargs={ "event_id": self.cur_transaction_event.event_id, "project_id_or_slug": self.cur_transaction_event.project.slug, - "organization_slug": self.cur_transaction_event.project.organization.slug, + "organization_id_or_slug": self.cur_transaction_event.project.organization.slug, }, ) response = self.client.get(url, format="json") @@ -334,7 +334,7 @@ def setUp(self): self.url = reverse( "sentry-api-0-event-json", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "project_id_or_slug": self.project.slug, "event_id": self.event_id, }, @@ -355,7 +355,7 @@ def test_event_does_not_exist(self): self.url = reverse( "sentry-api-0-event-json", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "project_id_or_slug": self.project.slug, "event_id": "no" * 16, }, @@ -377,7 +377,7 @@ def test_project_not_associated_with_event(self): url = reverse( "sentry-api-0-event-json", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "project_id_or_slug": project2.slug, "event_id": self.event_id, }, diff --git a/tests/snuba/api/endpoints/test_project_events.py b/tests/snuba/api/endpoints/test_project_events.py index 3d07b705999095..d0179ac0d5b60f 100644 --- a/tests/snuba/api/endpoints/test_project_events.py +++ b/tests/snuba/api/endpoints/test_project_events.py @@ -19,7 +19,7 @@ def test_simple(self): url = reverse( "sentry-api-0-project-events", kwargs={ - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "project_id_or_slug": project.slug, }, ) @@ -47,7 +47,7 @@ def test_message_search(self): url = reverse( "sentry-api-0-project-events", kwargs={ - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "project_id_or_slug": project.slug, }, ) @@ -71,7 +71,7 @@ def test_filters_based_on_retention(self): url = reverse( "sentry-api-0-project-events", kwargs={ - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "project_id_or_slug": project.slug, }, ) @@ -93,7 +93,7 @@ def test_limited_to_week(self): url = reverse( "sentry-api-0-project-events", kwargs={ - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "project_id_or_slug": project.slug, }, ) @@ -118,7 +118,7 @@ def test_sample(self): url = reverse( "sentry-api-0-project-events", kwargs={ - "organization_slug": project.organization.slug, + "organization_id_or_slug": project.organization.slug, "project_id_or_slug": project.slug, }, )