Browse Source

feat(api-idorslug): Updated Rest of Endpoints to use `organization_id_or_slug` (#70829)

Final PR to update all the endpoints in `url.py` to use
`organization_id_or_slug`.

Entire PR is literally updating url.py and then fix all the tests,
specifically args of the tests.
Raj Joshi 10 months ago
parent
commit
830717067c

File diff suppressed because it is too large
+ 152 - 152
src/sentry/api/urls.py


+ 9 - 9
tests/sentry/api/endpoints/test_artifact_bundles.py

@@ -77,7 +77,7 @@ class ArtifactBundlesEndpointTest(APITestCase):
         url = reverse(
             "sentry-api-0-artifact-bundles",
             kwargs={
-                "organization_slug": project.organization.slug,
+                "organization_id_or_slug": project.organization.slug,
                 "project_id_or_slug": project.slug,
             },
         )
@@ -219,7 +219,7 @@ class ArtifactBundlesEndpointTest(APITestCase):
         url = reverse(
             "sentry-api-0-artifact-bundles",
             kwargs={
-                "organization_slug": project.organization.slug,
+                "organization_id_or_slug": project.organization.slug,
                 "project_id_or_slug": project.slug,
             },
         )
@@ -281,7 +281,7 @@ class ArtifactBundlesEndpointTest(APITestCase):
         url = reverse(
             "sentry-api-0-artifact-bundles",
             kwargs={
-                "organization_slug": project.organization.slug,
+                "organization_id_or_slug": project.organization.slug,
                 "project_id_or_slug": project.slug,
             },
         )
@@ -357,7 +357,7 @@ class ArtifactBundlesEndpointTest(APITestCase):
         url = reverse(
             "sentry-api-0-artifact-bundles",
             kwargs={
-                "organization_slug": project.organization.slug,
+                "organization_id_or_slug": project.organization.slug,
                 "project_id_or_slug": project.slug,
             },
         )
@@ -386,7 +386,7 @@ class ArtifactBundlesEndpointTest(APITestCase):
             url = reverse(
                 "sentry-api-0-artifact-bundles",
                 kwargs={
-                    "organization_slug": project.organization.slug,
+                    "organization_id_or_slug": project.organization.slug,
                     "project_id_or_slug": project.slug,
                 },
             )
@@ -416,7 +416,7 @@ class ArtifactBundlesEndpointTest(APITestCase):
         url = reverse(
             "sentry-api-0-artifact-bundles",
             kwargs={
-                "organization_slug": project.organization.slug,
+                "organization_id_or_slug": project.organization.slug,
                 "project_id_or_slug": project.slug,
             },
         )
@@ -473,7 +473,7 @@ class ArtifactBundlesEndpointTest(APITestCase):
         url = reverse(
             "sentry-api-0-artifact-bundles",
             kwargs={
-                "organization_slug": project.organization.slug,
+                "organization_id_or_slug": project.organization.slug,
                 "project_id_or_slug": project.slug,
             },
         )
@@ -528,7 +528,7 @@ class ArtifactBundlesEndpointTest(APITestCase):
         url = reverse(
             "sentry-api-0-artifact-bundles",
             kwargs={
-                "organization_slug": project_a.organization.slug,
+                "organization_id_or_slug": project_a.organization.slug,
                 "project_id_or_slug": project_a.slug,
             },
         )
@@ -584,7 +584,7 @@ class ArtifactBundlesEndpointTest(APITestCase):
         url = reverse(
             "sentry-api-0-artifact-bundles",
             kwargs={
-                "organization_slug": project_a.organization.slug,
+                "organization_id_or_slug": project_a.organization.slug,
                 "project_id_or_slug": project_a.slug,
             },
         )

+ 1 - 1
tests/sentry/api/endpoints/test_event_ai_suggested_fix.py

@@ -64,7 +64,7 @@ class EventAiSuggestedFixEndpointTest(APITestCase):
         self.path = reverse(
             "sentry-api-0-event-ai-fix-suggest",
             kwargs={
-                "organization_slug": self.organization.slug,
+                "organization_id_or_slug": self.organization.slug,
                 "project_id_or_slug": self.project.slug,
                 "event_id": self.event.event_id,
             },

+ 6 - 6
tests/sentry/api/endpoints/test_event_committers.py

@@ -38,7 +38,7 @@ class EventCommittersTest(APITestCase):
             kwargs={
                 "event_id": event.event_id,
                 "project_id_or_slug": event.project.slug,
-                "organization_slug": event.project.organization.slug,
+                "organization_id_or_slug": event.project.organization.slug,
             },
         )
 
@@ -68,7 +68,7 @@ class EventCommittersTest(APITestCase):
             kwargs={
                 "event_id": event.event_id,
                 "project_id_or_slug": event.project.slug,
-                "organization_slug": event.project.organization.slug,
+                "organization_id_or_slug": event.project.organization.slug,
             },
         )
 
@@ -91,7 +91,7 @@ class EventCommittersTest(APITestCase):
             kwargs={
                 "event_id": event.event_id,
                 "project_id_or_slug": event.project.slug,
-                "organization_slug": event.project.organization.slug,
+                "organization_id_or_slug": event.project.organization.slug,
             },
         )
 
@@ -134,7 +134,7 @@ class EventCommittersTest(APITestCase):
             kwargs={
                 "event_id": event.event_id,
                 "project_id_or_slug": event.project.slug,
-                "organization_slug": event.project.organization.slug,
+                "organization_id_or_slug": event.project.organization.slug,
             },
         )
 
@@ -178,7 +178,7 @@ class EventCommittersTest(APITestCase):
             kwargs={
                 "event_id": event.event_id,
                 "project_id_or_slug": event.project.slug,
-                "organization_slug": event.project.organization.slug,
+                "organization_id_or_slug": event.project.organization.slug,
             },
         )
 
@@ -238,7 +238,7 @@ class EventCommittersTest(APITestCase):
             kwargs={
                 "event_id": event.event_id,
                 "project_id_or_slug": event.project.slug,
-                "organization_slug": event.project.organization.slug,
+                "organization_id_or_slug": event.project.organization.slug,
             },
         )
 

+ 7 - 7
tests/sentry/api/endpoints/test_event_owners.py

@@ -36,7 +36,7 @@ class ProjectOwnershipEndpointTestCase(APITestCase):
         self.path = reverse(
             "sentry-api-0-event-owners",
             kwargs={
-                "organization_slug": self.organization.slug,
+                "organization_id_or_slug": self.organization.slug,
                 "project_id_or_slug": self.project.slug,
                 "event_id": event1.event_id,
             },
@@ -62,7 +62,7 @@ class ProjectOwnershipEndpointTestCase(APITestCase):
         self.path = reverse(
             "sentry-api-0-event-owners",
             kwargs={
-                "organization_slug": self.organization.slug,
+                "organization_id_or_slug": self.organization.slug,
                 "project_id_or_slug": self.project.slug,
                 "event_id": event1.event_id,
             },
@@ -88,7 +88,7 @@ class ProjectOwnershipEndpointTestCase(APITestCase):
         self.path = reverse(
             "sentry-api-0-event-owners",
             kwargs={
-                "organization_slug": self.organization.slug,
+                "organization_id_or_slug": self.organization.slug,
                 "project_id_or_slug": self.project.slug,
                 "event_id": event1.event_id,
             },
@@ -114,7 +114,7 @@ class ProjectOwnershipEndpointTestCase(APITestCase):
         self.path = reverse(
             "sentry-api-0-event-owners",
             kwargs={
-                "organization_slug": self.organization.slug,
+                "organization_id_or_slug": self.organization.slug,
                 "project_id_or_slug": self.project.slug,
                 "event_id": event1.event_id,
             },
@@ -146,7 +146,7 @@ class ProjectOwnershipEndpointTestCase(APITestCase):
         self.path = reverse(
             "sentry-api-0-event-owners",
             kwargs={
-                "organization_slug": self.organization.slug,
+                "organization_id_or_slug": self.organization.slug,
                 "project_id_or_slug": self.project.slug,
                 "event_id": event1.event_id,
             },
@@ -179,7 +179,7 @@ class ProjectOwnershipEndpointTestCase(APITestCase):
         self.path = reverse(
             "sentry-api-0-event-owners",
             kwargs={
-                "organization_slug": self.organization.slug,
+                "organization_id_or_slug": self.organization.slug,
                 "project_id_or_slug": self.project.slug,
                 "event_id": event1.event_id,
             },
@@ -214,7 +214,7 @@ class ProjectOwnershipEndpointTestCase(APITestCase):
         self.path = reverse(
             "sentry-api-0-event-owners",
             kwargs={
-                "organization_slug": self.organization.slug,
+                "organization_id_or_slug": self.organization.slug,
                 "project_id_or_slug": self.project.slug,
                 "event_id": event1.event_id,
             },

+ 4 - 1
tests/sentry/api/endpoints/test_group_tombstone.py

@@ -27,7 +27,10 @@ class GroupTombstoneTest(APITestCase):
 
         path = reverse(
             "sentry-api-0-group-tombstones",
-            kwargs={"organization_slug": self.org.slug, "project_id_or_slug": self.project.slug},
+            kwargs={
+                "organization_id_or_slug": self.org.slug,
+                "project_id_or_slug": self.project.slug,
+            },
         )
 
         response = self.client.get(path)

+ 2 - 2
tests/sentry/api/endpoints/test_group_tombstone_details.py

@@ -29,7 +29,7 @@ class GroupTombstoneDetailsTest(APITestCase):
         path = reverse(
             "sentry-api-0-group-tombstone-details",
             kwargs={
-                "organization_slug": self.org.slug,
+                "organization_id_or_slug": self.org.slug,
                 "project_id_or_slug": self.project.slug,
                 "tombstone_id": tombstone.id,
             },
@@ -67,7 +67,7 @@ class GroupTombstoneDetailsTest(APITestCase):
         path = reverse(
             "sentry-api-0-group-tombstone-details",
             kwargs={
-                "organization_slug": self.org.slug,
+                "organization_id_or_slug": self.org.slug,
                 "project_id_or_slug": self.other_project.slug,
                 "tombstone_id": tombstone.id,
             },

+ 1 - 1
tests/sentry/api/endpoints/test_organization_dashboard_widget_details.py

@@ -28,7 +28,7 @@ class OrganizationDashboardWidgetDetailsTestCase(OrganizationDashboardWidgetTest
     def url(self):
         return reverse(
             "sentry-api-0-organization-dashboard-widget-details",
-            kwargs={"organization_slug": self.organization.slug},
+            kwargs={"organization_id_or_slug": self.organization.slug},
         )
 
     def test_valid_widget(self):

+ 1 - 1
tests/sentry/api/endpoints/test_organization_dashboards.py

@@ -21,7 +21,7 @@ class OrganizationDashboardsTest(OrganizationDashboardWidgetTestCase):
         self.login_as(self.user)
         self.url = reverse(
             "sentry-api-0-organization-dashboards",
-            kwargs={"organization_slug": self.organization.slug},
+            kwargs={"organization_id_or_slug": self.organization.slug},
         )
         self.dashboard_2 = Dashboard.objects.create(
             title="Dashboard 2", created_by_id=self.user.id, organization=self.organization

+ 1 - 1
tests/sentry/api/endpoints/test_organization_invite_request_index.py

@@ -86,7 +86,7 @@ class OrganizationInviteRequestCreateTest(
 
         self.url = reverse(
             "sentry-api-0-organization-invite-request-index",
-            kwargs={"organization_slug": self.organization.slug},
+            kwargs={"organization_id_or_slug": self.organization.slug},
         )
 
     def test_simple(self):

Some files were not shown because too many files changed in this diff