Skip to content

feat(api-idorslug): Updated Subset of Replay Endpoints and API Docs Tests to use organization_id_or_slug #70711

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 49 additions & 49 deletions src/sentry/api/urls.py

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/sentry/feedback/blueprints/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/<organization_slug>/feedback/]
## Feedback Index [/organizations/<organization_id_or_slug>/feedback/]

- Parameters

Expand Down Expand Up @@ -155,7 +155,7 @@ Retrieve a collection of feedback items.
}
```

## Feedback [/projects/<organization_slug>/<project_id_or_slug>/feedback/<feedback_id>/]
## Feedback [/projects/<organization_id_or_slug>/<project_id_or_slug>/feedback/<feedback_id>/]

- Model

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
22 changes: 11 additions & 11 deletions src/sentry/replays/blueprints/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/<organization_slug>/replays/]
## Replays [/organizations/<organization_id_or_slug>/replays/]

- Parameters

Expand Down Expand Up @@ -173,7 +173,7 @@ Retrieve a collection of replays.
}
```

## Replay [/projects/<organization_slug>/<project_id_or_slug>/replays/<replay_id>/]
## Replay [/projects/<organization_id_or_slug>/<project_id_or_slug>/replays/<replay_id>/]

- Parameters
- field (optional, string)
Expand Down Expand Up @@ -244,7 +244,7 @@ Deletes a replay instance.

- Response 204

## Replay Accessibility Issues [/projects/<organization_slug>/<project_id_or_slug>/replays/<replay_id>/accessibility-issues]
## Replay Accessibility Issues [/projects/<organization_id_or_slug>/<project_id_or_slug>/replays/<replay_id>/accessibility-issues]

This resource does not accept any URI parameters and is not paginated. Responses are ingested whole.

Expand Down Expand Up @@ -336,7 +336,7 @@ IssueElementAlternative Type:
}
```

## Replay Selectors [/organizations/<organization_slug>/replay-selectors/]
## Replay Selectors [/organizations/<organization_id_or_slug>/replay-selectors/]

- Parameters

Expand Down Expand Up @@ -411,7 +411,7 @@ Retrieve a collection of selectors.
}
```

## Replay Recording Segments [/projects/<organization_slug>/<project_id_or_slug>/replays/<replay_id>/recording-segments/]
## Replay Recording Segments [/projects/<organization_id_or_slug>/<project_id_or_slug>/replays/<replay_id>/recording-segments/]

- Parameters
- per_page
Expand Down Expand Up @@ -463,7 +463,7 @@ With download query argument, rrweb events JSON
]
```

## Replay Recording Segment [/projects/<organization_slug>/<project_id_or_slug>/replays/<replay_id>/recording-segments/<segment_id>/]
## Replay Recording Segment [/projects/<organization_id_or_slug>/<project_id_or_slug>/replays/<replay_id>/recording-segments/<segment_id>/]

- Parameters
- download - Instruct the API to return a streaming bytes response.
Expand Down Expand Up @@ -493,7 +493,7 @@ With download query argument.

Content-Type application/octet-stream

## Replay Video [/projects/<organization_slug>/<project_id_or_slug>/replays/<replay_id>/videos/<segment_id>/]
## Replay Video [/projects/<organization_id_or_slug>/<project_id_or_slug>/replays/<replay_id>/videos/<segment_id>/]

### Fetch Replay Video [GET]

Expand All @@ -505,7 +505,7 @@ Returns the bytes of a replay-segment video.
\x00\x00\x00
```

## Replay Tag Keys [/projects/<organization_slug>/<project_id_or_slug>/replays/tags/]
## Replay Tag Keys [/projects/<organization_id_or_slug>/<project_id_or_slug>/replays/tags/]

### Fetch Tag Keys [GET]

Expand All @@ -529,7 +529,7 @@ Retrieve a collection of tag keys associated with the replays dataset.
]
```

## Replay Tag Values [/projects/<organization_slug>/<project_id_or_slug>/replays/tags/<key>/values/]
## Replay Tag Values [/projects/<organization_id_or_slug>/<project_id_or_slug>/replays/tags/<key>/values/]

### Fetch Tag Values [GET]

Expand Down Expand Up @@ -559,7 +559,7 @@ Retrieve a collection of tag values associated with a tag key on the replays dat
]
```

## Replay Click [/projects/<organization_slug>/<project_id_or_slug>/replays/<replay_id>/clicks/]
## Replay Click [/projects/<organization_id_or_slug>/<project_id_or_slug>/replays/<replay_id>/clicks/]

Parameters:

Expand Down Expand Up @@ -614,7 +614,7 @@ Retrieve a collection of click events associated with a replay.
}
```

## Replay Viewed By [/projects/<organization_slug>/<project_id_or_slug>/replays/<replay_id>/viewed-by/]
## Replay Viewed By [/projects/<organization_id_or_slug>/<project_id_or_slug>/replays/<replay_id>/viewed-by/]

### Fetch Replay Viewed By [GET]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/replays/endpoints/project_replay_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/replays/endpoints/project_replay_viewed_by.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
],
Expand Down
11 changes: 8 additions & 3 deletions src/sentry/testutils/cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down Expand Up @@ -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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this missing the change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it auto formatted, i haven't updated this endpoint yet.

"provider_id": self.provider.key,
},
)

self.setup_path = reverse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/apidocs/endpoints/organizations/test_org_repos.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/apidocs/endpoints/organizations/test_shortid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
)
Expand Down
2 changes: 1 addition & 1 deletion tests/apidocs/endpoints/projects/test_project_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
2 changes: 1 addition & 1 deletion tests/apidocs/endpoints/projects/test_service_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
)
Expand Down
2 changes: 1 addition & 1 deletion tests/apidocs/endpoints/projects/test_tag_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
2 changes: 1 addition & 1 deletion tests/apidocs/endpoints/projects/test_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
)
Expand Down
5 changes: 4 additions & 1 deletion tests/apidocs/endpoints/releases/test_deploys.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading
Loading