diff --git a/src/sentry/api/endpoints/organization_unsubscribe.py b/src/sentry/api/endpoints/organization_unsubscribe.py index 12466807112f03..16f4fd1a20c7e5 100644 --- a/src/sentry/api/endpoints/organization_unsubscribe.py +++ b/src/sentry/api/endpoints/organization_unsubscribe.py @@ -37,7 +37,7 @@ class OrganizationUnsubscribeBase(Endpoint, Generic[T]): object_type = "unknown" - def fetch_instance(self, request: Request, organization_slug: str, id: int) -> T: + def fetch_instance(self, request: Request, organization_id_or_slug: int | str, id: int) -> T: raise NotImplementedError() def unsubscribe(self, request: Request, instance: T): @@ -46,10 +46,12 @@ def unsubscribe(self, request: Request, instance: T): def add_instance_data(self, data: dict[str, Any], instance: T) -> dict[str, Any]: return data - def get(self, request: Request, organization_slug: str, id: int, **kwargs) -> Response: + def get( + self, request: Request, organization_id_or_slug: int | str, id: int, **kwargs + ) -> Response: if not request.user_from_signed_request: raise NotFound() - instance = self.fetch_instance(request, organization_slug, id) + instance = self.fetch_instance(request, organization_id_or_slug, id) view_url = "" if hasattr(instance, "get_absolute_url"): view_url = str(instance.get_absolute_url()) @@ -65,10 +67,12 @@ def get(self, request: Request, organization_slug: str, id: int, **kwargs) -> Re } return Response(self.add_instance_data(data, instance), 200) - def post(self, request: Request, organization_slug: str, id: int, **kwargs) -> Response: + def post( + self, request: Request, organization_id_or_slug: int | str, id: int, **kwargs + ) -> Response: if not request.user_from_signed_request: raise NotFound() - instance = self.fetch_instance(request, organization_slug, id) + instance = self.fetch_instance(request, organization_id_or_slug, id) if request.data.get("cancel"): self.unsubscribe(request, instance) @@ -79,16 +83,18 @@ def post(self, request: Request, organization_slug: str, id: int, **kwargs) -> R class OrganizationUnsubscribeProject(OrganizationUnsubscribeBase[Project]): object_type = "project" - def fetch_instance(self, request: Request, organization_slug: str, id: int) -> Project: + def fetch_instance( + self, request: Request, organization_id_or_slug: int | str, id: int + ) -> Project: try: project = Project.objects.select_related("organization").get(id=id) except Project.DoesNotExist: raise NotFound() - if str(organization_slug).isdecimal(): - if project.organization.id != int(organization_slug): + if str(organization_id_or_slug).isdecimal(): + if project.organization.id != int(organization_id_or_slug): raise NotFound() else: - if project.organization.slug != organization_slug: + if project.organization.slug != organization_id_or_slug: raise NotFound() if not OrganizationMember.objects.filter( user_id=request.user.pk, organization_id=project.organization_id @@ -115,16 +121,18 @@ def unsubscribe(self, request: Request, instance: Project): class OrganizationUnsubscribeIssue(OrganizationUnsubscribeBase[Group]): object_type = "issue" - def fetch_instance(self, request: Request, organization_slug: str, issue_id: int) -> Group: + def fetch_instance( + self, request: Request, organization_id_or_slug: int | str, issue_id: int + ) -> Group: try: issue = Group.objects.get_from_cache(id=issue_id) except Group.DoesNotExist: raise NotFound() - if str(organization_slug).isdecimal(): - if issue.organization.id != int(organization_slug): + if str(organization_id_or_slug).isdecimal(): + if issue.organization.id != int(organization_id_or_slug): raise NotFound() else: - if issue.organization.slug != organization_slug: + if issue.organization.slug != organization_id_or_slug: raise NotFound() if not OrganizationMember.objects.filter( diff --git a/src/sentry/api/urls.py b/src/sentry/api/urls.py index 2e72830157bf80..3d2d704719de6f 100644 --- a/src/sentry/api/urls.py +++ b/src/sentry/api/urls.py @@ -1643,47 +1643,47 @@ def create_group_urls(name_prefix: str) -> list[URLPattern | URLResolver]: ), # Monitors re_path( - r"^(?P[^\/]+)/monitors/$", + r"^(?P[^\/]+)/monitors/$", OrganizationMonitorIndexEndpoint.as_view(), name="sentry-api-0-organization-monitor-index", ), re_path( - r"^(?P[^\/]+)/monitors-stats/$", + r"^(?P[^\/]+)/monitors-stats/$", OrganizationMonitorIndexStatsEndpoint.as_view(), name="sentry-api-0-organization-monitor-index-stats", ), re_path( - r"^(?P[^\/]+)/processing-errors/$", + r"^(?P[^\/]+)/processing-errors/$", OrganizationMonitorProcessingErrorsIndexEndpoint.as_view(), name="sentry-api-0-organization-monitor-processing-errors-index", ), re_path( - r"^(?P[^\/]+)/monitors-schedule-data/$", + r"^(?P[^\/]+)/monitors-schedule-data/$", OrganizationMonitorScheduleSampleDataEndpoint.as_view(), name="sentry-api-0-organization-monitors-schedule-sample-data", ), re_path( - r"^(?P[^\/]+)/monitors/(?P[^\/]+)/$", + r"^(?P[^\/]+)/monitors/(?P[^\/]+)/$", OrganizationMonitorDetailsEndpoint.as_view(), name="sentry-api-0-organization-monitor-details", ), re_path( - r"^(?P[^\/]+)/monitors/(?P[^\/]+)/environments/(?P[^\/]+)$", + r"^(?P[^\/]+)/monitors/(?P[^\/]+)/environments/(?P[^\/]+)$", OrganizationMonitorEnvironmentDetailsEndpoint.as_view(), name="sentry-api-0-organization-monitor-environment-details", ), re_path( - r"^(?P[^\/]+)/monitors/(?P[^\/]+)/stats/$", + r"^(?P[^\/]+)/monitors/(?P[^\/]+)/stats/$", OrganizationMonitorStatsEndpoint.as_view(), name="sentry-api-0-organization-monitor-stats", ), re_path( - r"^(?P[^\/]+)/monitors/(?P[^\/]+)/checkins/$", + r"^(?P[^\/]+)/monitors/(?P[^\/]+)/checkins/$", OrganizationMonitorCheckInIndexEndpoint.as_view(), name="sentry-api-0-organization-monitor-check-in-index", ), re_path( - r"^(?P[^\/]+)/monitors/(?P[^\/]+)/checkins/(?P[^\/]+)/attachment/$", + r"^(?P[^\/]+)/monitors/(?P[^\/]+)/checkins/(?P[^\/]+)/attachment/$", method_dispatch( GET=OrganizationMonitorCheckInAttachmentEndpoint.as_view(), OPTIONS=OrganizationMonitorCheckInAttachmentEndpoint.as_view(), @@ -2120,12 +2120,12 @@ def create_group_urls(name_prefix: str) -> list[URLPattern | URLResolver]: ), # Unsubscribe from organization notifications re_path( - r"^(?P[^/]+)/unsubscribe/project/(?P\d+)/$", + r"^(?P[^/]+)/unsubscribe/project/(?P\d+)/$", OrganizationUnsubscribeProject.as_view(), name="sentry-api-0-organization-unsubscribe-project", ), re_path( - r"^(?P[^/]+)/unsubscribe/issue/(?P\d+)/$", + r"^(?P[^/]+)/unsubscribe/issue/(?P\d+)/$", OrganizationUnsubscribeIssue.as_view(), name="sentry-api-0-organization-unsubscribe-issue", ), @@ -2743,22 +2743,22 @@ def create_group_urls(name_prefix: str) -> list[URLPattern | URLResolver]: name="sentry-api-0-project-statistical-detector", ), re_path( - r"^(?P[^\/]+)/(?P[^\/]+)/monitors/(?P[^\/]+)/checkins/(?P[^\/]+)/attachment/$", + r"^(?P[^\/]+)/(?P[^\/]+)/monitors/(?P[^\/]+)/checkins/(?P[^\/]+)/attachment/$", ProjectMonitorCheckInAttachmentEndpoint.as_view(), name="sentry-api-0-project-monitor-check-in-attachment", ), re_path( - r"^(?P[^\/]+)/(?P[^\/]+)/monitors/(?P[^\/]+)/$", + r"^(?P[^\/]+)/(?P[^\/]+)/monitors/(?P[^\/]+)/$", ProjectMonitorDetailsEndpoint.as_view(), name="sentry-api-0-project-monitor-details", ), re_path( - r"^(?P[^\/]+)/(?P[^\/]+)/monitors/(?P[^\/]+)/checkins/$", + r"^(?P[^\/]+)/(?P[^\/]+)/monitors/(?P[^\/]+)/checkins/$", ProjectMonitorCheckInIndexEndpoint.as_view(), name="sentry-api-0-project-monitor-check-in-index", ), re_path( - r"^(?P[^\/]+)/(?P[^\/]+)/monitors/(?P[^\/]+)/environments/(?P[^\/]+)$", + r"^(?P[^\/]+)/(?P[^\/]+)/monitors/(?P[^\/]+)/environments/(?P[^\/]+)$", ProjectMonitorEnvironmentDetailsEndpoint.as_view(), name="sentry-api-0-project-monitor-environment-details", ), @@ -2768,12 +2768,12 @@ def create_group_urls(name_prefix: str) -> list[URLPattern | URLResolver]: name="sentry-api-0-project-processing-errors-details", ), re_path( - r"^(?P[^\/]+)/(?P[^\/]+)/monitors/(?P[^\/]+)/processing-errors/$", + r"^(?P[^\/]+)/(?P[^\/]+)/monitors/(?P[^\/]+)/processing-errors/$", ProjectMonitorProcessingErrorsIndexEndpoint.as_view(), name="sentry-api-0-project-monitor-processing-errors-index", ), re_path( - r"^(?P[^\/]+)/(?P[^\/]+)/monitors/(?P[^\/]+)/stats/$", + r"^(?P[^\/]+)/(?P[^\/]+)/monitors/(?P[^\/]+)/stats/$", ProjectMonitorStatsEndpoint.as_view(), name="sentry-api-0-project-monitor-stats", ), diff --git a/src/sentry/integrations/bitbucket/urls.py b/src/sentry/integrations/bitbucket/urls.py index d8b9c53e32e8c0..932d5bb74da71c 100644 --- a/src/sentry/integrations/bitbucket/urls.py +++ b/src/sentry/integrations/bitbucket/urls.py @@ -28,7 +28,7 @@ name="sentry-extensions-bitbucket-webhook", ), re_path( - r"^search/(?P[^\/]+)/(?P\d+)/$", + r"^search/(?P[^\/]+)/(?P\d+)/$", BitbucketSearchEndpoint.as_view(), name="sentry-extensions-bitbucket-search", ), diff --git a/src/sentry/integrations/github/urls.py b/src/sentry/integrations/github/urls.py index bc3180a72a62ff..2f34211734e416 100644 --- a/src/sentry/integrations/github/urls.py +++ b/src/sentry/integrations/github/urls.py @@ -16,7 +16,7 @@ name="sentry-integration-github-installation", ), re_path( - r"^search/(?P[^\/]+)/(?P\d+)/$", + r"^search/(?P[^\/]+)/(?P\d+)/$", GithubSharedSearchEndpoint.as_view(), name="sentry-integration-github-search", ), diff --git a/src/sentry/integrations/gitlab/urls.py b/src/sentry/integrations/gitlab/urls.py index b61f623884da9c..b7d01f066a1c1e 100644 --- a/src/sentry/integrations/gitlab/urls.py +++ b/src/sentry/integrations/gitlab/urls.py @@ -5,7 +5,7 @@ urlpatterns = [ re_path( - r"^search/(?P[^\/]+)/(?P\d+)/$", + r"^search/(?P[^\/]+)/(?P\d+)/$", GitlabIssueSearchEndpoint.as_view(), name="sentry-extensions-gitlab-search", ), diff --git a/src/sentry/integrations/jira/urls.py b/src/sentry/integrations/jira/urls.py index a5ce5f058c5162..05a435e9a10de4 100644 --- a/src/sentry/integrations/jira/urls.py +++ b/src/sentry/integrations/jira/urls.py @@ -39,7 +39,7 @@ name="sentry-extensions-jira-issue-updated", ), re_path( - r"^search/(?P[^\/]+)/(?P\d+)/$", + r"^search/(?P[^\/]+)/(?P\d+)/$", JiraSearchEndpoint.as_view(), name="sentry-extensions-jira-search", ), diff --git a/src/sentry/integrations/jira_server/urls.py b/src/sentry/integrations/jira_server/urls.py index 7d3900ff0fd28d..4c3ec3436b3795 100644 --- a/src/sentry/integrations/jira_server/urls.py +++ b/src/sentry/integrations/jira_server/urls.py @@ -11,7 +11,7 @@ name="sentry-extensions-jiraserver-issue-updated", ), re_path( - r"^search/(?P[^\/]+)/(?P\d+)/$", + r"^search/(?P[^\/]+)/(?P\d+)/$", JiraServerSearchEndpoint.as_view(), name="sentry-extensions-jiraserver-search", ), diff --git a/src/sentry/integrations/vsts/urls.py b/src/sentry/integrations/vsts/urls.py index ec8f6d92e52c28..44f6c38557926d 100644 --- a/src/sentry/integrations/vsts/urls.py +++ b/src/sentry/integrations/vsts/urls.py @@ -12,7 +12,7 @@ name="sentry-extensions-vsts-issue-updated", ), re_path( - r"^search/(?P[^\/]+)/(?P\d+)/$", + r"^search/(?P[^\/]+)/(?P\d+)/$", VstsSearchEndpoint.as_view(), name="sentry-extensions-vsts-search", ), diff --git a/src/sentry/monitors/endpoints/base.py b/src/sentry/monitors/endpoints/base.py index 0351a370b3a678..bf61fad1df72a5 100644 --- a/src/sentry/monitors/endpoints/base.py +++ b/src/sentry/monitors/endpoints/base.py @@ -57,7 +57,7 @@ class MonitorEndpoint(Endpoint): def convert_args( self, request: Request, - organization_slug: str, + organization_id_or_slug: int | str, monitor_id_or_slug: int | str, environment: str | None = None, checkin_id: str | None = None, @@ -67,13 +67,13 @@ def convert_args( try: if ( id_or_slug_path_params_enabled( - self.convert_args.__qualname__, str(organization_slug) + self.convert_args.__qualname__, str(organization_id_or_slug) ) - and str(organization_slug).isdigit() + and str(organization_id_or_slug).isdigit() ): - organization = Organization.objects.get_from_cache(id=organization_slug) + organization = Organization.objects.get_from_cache(id=organization_id_or_slug) else: - organization = Organization.objects.get_from_cache(slug=organization_slug) + organization = Organization.objects.get_from_cache(slug=organization_id_or_slug) except Organization.DoesNotExist: raise ResourceDoesNotExist diff --git a/src/sentry/monitors/endpoints/monitor_ingest_checkin_attachment.py b/src/sentry/monitors/endpoints/monitor_ingest_checkin_attachment.py index ceb89788a34490..4c9b80e505b190 100644 --- a/src/sentry/monitors/endpoints/monitor_ingest_checkin_attachment.py +++ b/src/sentry/monitors/endpoints/monitor_ingest_checkin_attachment.py @@ -60,7 +60,7 @@ def convert_args( request: Request, monitor_id_or_slug: int | str, checkin_id: str, - organization_slug: str | int | None = None, + organization_id_or_slug: int | str | None = None, *args, **kwargs, ): @@ -83,24 +83,28 @@ def convert_args( raise ResourceDoesNotExist else: - # When using DSN auth we're able to infer the organization slug - if not organization_slug and using_dsn_auth: - organization_slug = request.auth.project.organization.slug + # When using DSN auth we're able to infer the organization slug (organization_id_or_slug is slug in this case) + if not organization_id_or_slug and using_dsn_auth: + organization_id_or_slug = request.auth.project.organization.slug - # The only monitor endpoints that do not have the org slug in their + # The only monitor endpoints that do not have the org id or slug in their # parameters are the GUID-style checkin endpoints - if organization_slug: + if organization_id_or_slug: try: - # Try lookup by slug first. This requires organization context. + # Try lookup by id or slug first. This requires organization context. if ( id_or_slug_path_params_enabled( - self.convert_args.__qualname__, str(organization_slug) + self.convert_args.__qualname__, str(organization_id_or_slug) ) - and str(organization_slug).isdecimal() + and str(organization_id_or_slug).isdecimal() ): - organization = Organization.objects.get_from_cache(id=organization_slug) + organization = Organization.objects.get_from_cache( + id=organization_id_or_slug + ) else: - organization = Organization.objects.get_from_cache(slug=organization_slug) + organization = Organization.objects.get_from_cache( + slug=organization_id_or_slug + ) monitor = get_monitor_by_org_id_or_slug(organization, monitor_id_or_slug) except (Organization.DoesNotExist, Monitor.DoesNotExist): @@ -140,12 +144,12 @@ def convert_args( # When looking up via GUID we do not check the organization slug, # validate that the slug matches the org of the monitors project - # We only raise if the organization_slug was set and it doesn't match. + # We only raise if the organization_id_or_slug was set and it doesn't match. # We don't check the api.id-or-slug-enabled option here because slug and id are unique if ( - organization_slug - and project.organization.slug != organization_slug - and project.organization.id != organization_slug + organization_id_or_slug + and project.organization.slug != organization_id_or_slug + and project.organization.id != organization_id_or_slug ): raise ResourceDoesNotExist diff --git a/src/sentry/monitors/endpoints/organization_monitor_checkin_index.py b/src/sentry/monitors/endpoints/organization_monitor_checkin_index.py index d0eeddcc029815..438f9ef4e3d15c 100644 --- a/src/sentry/monitors/endpoints/organization_monitor_checkin_index.py +++ b/src/sentry/monitors/endpoints/organization_monitor_checkin_index.py @@ -27,7 +27,7 @@ class OrganizationMonitorCheckInIndexEndpoint(MonitorEndpoint, MonitorCheckInMix @extend_schema( operation_id="Retrieve Check-Ins for a Monitor", parameters=[ - GlobalParams.ORG_SLUG, + GlobalParams.ORG_ID_OR_SLUG, MonitorParams.MONITOR_ID_OR_SLUG, ], responses={ diff --git a/src/sentry/monitors/endpoints/organization_monitor_details.py b/src/sentry/monitors/endpoints/organization_monitor_details.py index 05f8bf95376fca..b12e5741d21084 100644 --- a/src/sentry/monitors/endpoints/organization_monitor_details.py +++ b/src/sentry/monitors/endpoints/organization_monitor_details.py @@ -36,7 +36,7 @@ class OrganizationMonitorDetailsEndpoint(MonitorEndpoint, MonitorDetailsMixin): @extend_schema( operation_id="Retrieve a Monitor", parameters=[ - GlobalParams.ORG_SLUG, + GlobalParams.ORG_ID_OR_SLUG, MonitorParams.MONITOR_ID_OR_SLUG, GlobalParams.ENVIRONMENT, ], @@ -56,7 +56,7 @@ def get(self, request: Request, organization, project, monitor) -> Response: @extend_schema( operation_id="Update a Monitor", parameters=[ - GlobalParams.ORG_SLUG, + GlobalParams.ORG_ID_OR_SLUG, MonitorParams.MONITOR_ID_OR_SLUG, ], request=MonitorValidator, @@ -77,7 +77,7 @@ def put(self, request: AuthenticatedHttpRequest, organization, project, monitor) @extend_schema( operation_id="Delete a Monitor or Monitor Environments", parameters=[ - GlobalParams.ORG_SLUG, + GlobalParams.ORG_ID_OR_SLUG, MonitorParams.MONITOR_ID_OR_SLUG, GlobalParams.ENVIRONMENT, ], diff --git a/src/sentry/monitors/endpoints/organization_monitor_environment_details.py b/src/sentry/monitors/endpoints/organization_monitor_environment_details.py index 06037bde55ba16..2cdef8cce2cc7a 100644 --- a/src/sentry/monitors/endpoints/organization_monitor_environment_details.py +++ b/src/sentry/monitors/endpoints/organization_monitor_environment_details.py @@ -35,7 +35,7 @@ class OrganizationMonitorEnvironmentDetailsEndpoint( @extend_schema( operation_id="Update a Monitor Environment", parameters=[ - GlobalParams.ORG_SLUG, + GlobalParams.ORG_ID_OR_SLUG, MonitorParams.MONITOR_ID_OR_SLUG, MonitorParams.ENVIRONMENT, ], @@ -58,7 +58,7 @@ def put( @extend_schema( operation_id="Delete a Monitor Environments", parameters=[ - GlobalParams.ORG_SLUG, + GlobalParams.ORG_ID_OR_SLUG, MonitorParams.MONITOR_ID_OR_SLUG, MonitorParams.ENVIRONMENT, ], diff --git a/src/sentry/monitors/endpoints/organization_monitor_index.py b/src/sentry/monitors/endpoints/organization_monitor_index.py index 98de33a870f6d6..8c6ad1e016be4a 100644 --- a/src/sentry/monitors/endpoints/organization_monitor_index.py +++ b/src/sentry/monitors/endpoints/organization_monitor_index.py @@ -102,7 +102,7 @@ class OrganizationMonitorIndexEndpoint(OrganizationEndpoint): @extend_schema( operation_id="Retrieve Monitors for an Organization", parameters=[ - GlobalParams.ORG_SLUG, + GlobalParams.ORG_ID_OR_SLUG, OrganizationParams.PROJECT, GlobalParams.ENVIRONMENT, MonitorParams.OWNER, @@ -270,7 +270,7 @@ def get(self, request: Request, organization: Organization) -> Response: @extend_schema( operation_id="Create a Monitor", - parameters=[GlobalParams.ORG_SLUG], + parameters=[GlobalParams.ORG_ID_OR_SLUG], request=MonitorValidator, responses={ 201: MonitorSerializer, @@ -346,7 +346,7 @@ def post(self, request: Request, organization) -> Response: @extend_schema( operation_id="Bulk Edit Monitors", - parameters=[GlobalParams.ORG_SLUG], + parameters=[GlobalParams.ORG_ID_OR_SLUG], request=MonitorBulkEditValidator, responses={ 200: inline_sentry_response_serializer( diff --git a/src/sentry/monitors/endpoints/project_monitor_checkin_index.py b/src/sentry/monitors/endpoints/project_monitor_checkin_index.py index 3b851c6d8b62e4..8357857391070f 100644 --- a/src/sentry/monitors/endpoints/project_monitor_checkin_index.py +++ b/src/sentry/monitors/endpoints/project_monitor_checkin_index.py @@ -27,7 +27,7 @@ class ProjectMonitorCheckInIndexEndpoint(ProjectMonitorEndpoint, MonitorCheckInM @extend_schema( operation_id="Retrieve Check-Ins for a Monitor by Project", parameters=[ - GlobalParams.ORG_SLUG, + GlobalParams.ORG_ID_OR_SLUG, GlobalParams.PROJECT_ID_OR_SLUG, MonitorParams.MONITOR_ID_OR_SLUG, ], diff --git a/src/sentry/monitors/endpoints/project_monitor_details.py b/src/sentry/monitors/endpoints/project_monitor_details.py index 639efbfae338bc..cc06c14ed4c682 100644 --- a/src/sentry/monitors/endpoints/project_monitor_details.py +++ b/src/sentry/monitors/endpoints/project_monitor_details.py @@ -36,7 +36,7 @@ class ProjectMonitorDetailsEndpoint(ProjectMonitorEndpoint, MonitorDetailsMixin) @extend_schema( operation_id="Retrieve a Monitor for a Project", parameters=[ - GlobalParams.ORG_SLUG, + GlobalParams.ORG_ID_OR_SLUG, GlobalParams.PROJECT_ID_OR_SLUG, MonitorParams.MONITOR_ID_OR_SLUG, ], @@ -56,7 +56,7 @@ def get(self, request: Request, project, monitor) -> Response: @extend_schema( operation_id="Update a Monitor for a Project", parameters=[ - GlobalParams.ORG_SLUG, + GlobalParams.ORG_ID_OR_SLUG, GlobalParams.PROJECT_ID_OR_SLUG, MonitorParams.MONITOR_ID_OR_SLUG, ], @@ -78,7 +78,7 @@ def put(self, request: AuthenticatedHttpRequest, project, monitor) -> Response: @extend_schema( operation_id="Delete a Monitor or Monitor Environments for a Project", parameters=[ - GlobalParams.ORG_SLUG, + GlobalParams.ORG_ID_OR_SLUG, GlobalParams.PROJECT_ID_OR_SLUG, MonitorParams.MONITOR_ID_OR_SLUG, GlobalParams.ENVIRONMENT, diff --git a/src/sentry/monitors/endpoints/project_monitor_environment_details.py b/src/sentry/monitors/endpoints/project_monitor_environment_details.py index 1ff7e28cb83de0..8108cd48ad2b42 100644 --- a/src/sentry/monitors/endpoints/project_monitor_environment_details.py +++ b/src/sentry/monitors/endpoints/project_monitor_environment_details.py @@ -35,7 +35,7 @@ class ProjectMonitorEnvironmentDetailsEndpoint( @extend_schema( operation_id="Update a Monitor Environment for a Project", parameters=[ - GlobalParams.ORG_SLUG, + GlobalParams.ORG_ID_OR_SLUG, GlobalParams.PROJECT_ID_OR_SLUG, MonitorParams.MONITOR_ID_OR_SLUG, MonitorParams.ENVIRONMENT, @@ -57,7 +57,7 @@ def put(self, request: Request, project, monitor, monitor_environment) -> Respon @extend_schema( operation_id="Delete a Monitor Environment for a Project", parameters=[ - GlobalParams.ORG_SLUG, + GlobalParams.ORG_ID_OR_SLUG, GlobalParams.PROJECT_ID_OR_SLUG, MonitorParams.MONITOR_ID_OR_SLUG, MonitorParams.ENVIRONMENT, diff --git a/tests/sentry/integrations/github/test_search.py b/tests/sentry/integrations/github/test_search.py index 86fac1fc906925..5bac78bcae541b 100644 --- a/tests/sentry/integrations/github/test_search.py +++ b/tests/sentry/integrations/github/test_search.py @@ -46,7 +46,7 @@ def setUp(self): self.url = reverse( "sentry-integration-github-search", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "integration_id": self.installation.model.id, }, ) @@ -196,7 +196,10 @@ def test_invalid_field(self): def test_missing_integration(self): url = reverse( "sentry-integration-github-search", - kwargs={"organization_slug": self.organization.slug, "integration_id": "1234567890"}, + kwargs={ + "organization_id_or_slug": self.organization.slug, + "integration_id": "1234567890", + }, ) resp = self.client.get( url, data={"field": "externalIssue", "query": "search", "repo": "example"} diff --git a/tests/sentry/integrations/gitlab/test_search.py b/tests/sentry/integrations/gitlab/test_search.py index 6c7ee763ac1fde..41cc671d29d1d7 100644 --- a/tests/sentry/integrations/gitlab/test_search.py +++ b/tests/sentry/integrations/gitlab/test_search.py @@ -18,7 +18,7 @@ def setUp(self): self.url = reverse( "sentry-extensions-gitlab-search", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "integration_id": self.installation.model.id, }, ) @@ -192,7 +192,10 @@ def test_missing_project_with_external_issue_field(self): def test_missing_integration(self): url = reverse( "sentry-extensions-gitlab-search", - kwargs={"organization_slug": self.organization.slug, "integration_id": "1234567890"}, + kwargs={ + "organization_id_or_slug": self.organization.slug, + "integration_id": "1234567890", + }, ) resp = self.client.get(url, data={"field": "project", "query": "GetSentry"}) diff --git a/tests/sentry/middleware/integrations/parsers/test_bitbucket.py b/tests/sentry/middleware/integrations/parsers/test_bitbucket.py index d79939572c2b16..c2b25285a36a6f 100644 --- a/tests/sentry/middleware/integrations/parsers/test_bitbucket.py +++ b/tests/sentry/middleware/integrations/parsers/test_bitbucket.py @@ -41,7 +41,7 @@ def test_routing_endpoints(self): reverse( "sentry-extensions-bitbucket-search", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "integration_id": self.integration.id, }, ), diff --git a/tests/sentry/middleware/integrations/parsers/test_github.py b/tests/sentry/middleware/integrations/parsers/test_github.py index 0d8f128695eed1..6a5adf64f71f34 100644 --- a/tests/sentry/middleware/integrations/parsers/test_github.py +++ b/tests/sentry/middleware/integrations/parsers/test_github.py @@ -89,7 +89,7 @@ def test_routing_search_properly(self): path = reverse( "sentry-integration-github-search", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "integration_id": self.integration.id, }, ) diff --git a/tests/sentry/middleware/integrations/parsers/test_gitlab.py b/tests/sentry/middleware/integrations/parsers/test_gitlab.py index 1a456f0fa045ce..34ce0a0d97a88c 100644 --- a/tests/sentry/middleware/integrations/parsers/test_gitlab.py +++ b/tests/sentry/middleware/integrations/parsers/test_gitlab.py @@ -199,7 +199,7 @@ def test_routing_search_properly(self): path = reverse( "sentry-extensions-gitlab-search", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "integration_id": self.integration.id, }, ) diff --git a/tests/sentry/middleware/integrations/parsers/test_jira_server.py b/tests/sentry/middleware/integrations/parsers/test_jira_server.py index b3fa856261591a..6f62923d230aa4 100644 --- a/tests/sentry/middleware/integrations/parsers/test_jira_server.py +++ b/tests/sentry/middleware/integrations/parsers/test_jira_server.py @@ -195,7 +195,7 @@ def test_routing_search_endpoint(self): route = reverse( "sentry-extensions-jiraserver-search", kwargs={ - "organization_slug": self.organization.slug, + "organization_id_or_slug": self.organization.slug, "integration_id": self.integration.id, }, ) diff --git a/tests/sentry/middleware/integrations/parsers/test_vsts.py b/tests/sentry/middleware/integrations/parsers/test_vsts.py index f8db8233d7a217..932af98661e73e 100644 --- a/tests/sentry/middleware/integrations/parsers/test_vsts.py +++ b/tests/sentry/middleware/integrations/parsers/test_vsts.py @@ -90,7 +90,7 @@ def test_routing_control_paths(self): search_request = self.factory.get( reverse( "sentry-extensions-vsts-search", - kwargs={"organization_slug": "albertos-apples", "integration_id": 1234}, + kwargs={"organization_id_or_slug": "albertos-apples", "integration_id": 1234}, ), ) parser = VstsRequestParser(request=search_request, response_handler=self.get_response)