Skip to content

Commit

Permalink
undo endpoint changes
Browse files Browse the repository at this point in the history
  • Loading branch information
iamrajjoshi committed May 6, 2024
1 parent 7662575 commit d74e608
Show file tree
Hide file tree
Showing 100 changed files with 248 additions and 218 deletions.
4 changes: 2 additions & 2 deletions src/sentry/api/endpoints/artifact_bundles.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def get(self, request: Request, project) -> Response:
Retrieve a list of artifact bundles for a given project.
:pparam string organization_id_or_slug: the id or slug of the organization the
:pparam string organization_slug: the slug of the organization the
artifact bundle belongs to.
:pparam string project_id_or_slug: the id or slug of the project to list the
artifact bundles of.
Expand Down Expand Up @@ -121,7 +121,7 @@ def delete(self, request: Request, project) -> Response:
Delete all artifacts inside given archive.
:pparam string organization_id_or_slug: the id or slug of the organization the
:pparam string organization_slug: the slug of the organization the
archive belongs to.
:pparam string project_id_or_slug: the id or slug of the project to delete the
archive of.
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/api/endpoints/artifact_lookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def get(self, request: Request, project: Project) -> Response:
Retrieve a list of individual artifacts or artifact bundles for a given project.
:pparam string organization_id_or_slug: the id or slug of the organization to query.
:pparam string organization_slug: the slug of the organization to query.
:pparam string project_id_or_slug: the id or slug of the project to query.
:qparam string debug_id: if set, will query and return the artifact
bundle that matches the given `debug_id`.
Expand Down
6 changes: 3 additions & 3 deletions src/sentry/api/endpoints/codeowners/details.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ class ProjectCodeOwnersDetailsEndpoint(ProjectEndpoint, ProjectCodeOwnersMixin):
def convert_args(
self,
request: Request,
organization_id_or_slug: int | str,
organization_slug: str | int,
project_id_or_slug: int | str,
codeowners_id: str,
*args: Any,
**kwargs: Any,
) -> tuple[Any, Any]:
args, kwargs = super().convert_args(
request, organization_id_or_slug, project_id_or_slug, *args, **kwargs
request, organization_slug, project_id_or_slug, *args, **kwargs
)
try:
kwargs["codeowners"] = ProjectCodeOwners.objects.get(
Expand All @@ -58,7 +58,7 @@ def put(self, request: Request, project: Project, codeowners: ProjectCodeOwners)
Update a CodeOwners
`````````````
:pparam string organization_id_or_slug: the id or slug of the organization.
:pparam string organization_slug: the slug of the organization.
:pparam string project_id_or_slug: the id or slug of the project to get.
:pparam string codeowners_id: id of codeowners object
:param string raw: the raw CODEOWNERS text
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ class ExternalTeamDetailsEndpoint(TeamEndpoint, ExternalActorEndpointMixin):
def convert_args(
self,
request: Request,
organization_id_or_slug: int | str,
organization_slug: str,
team_id_or_slug: int | str,
external_team_id: int,
*args: Any,
**kwargs: Any,
) -> tuple[Any, Any]:
args, kwargs = super().convert_args(
request, organization_id_or_slug, team_id_or_slug, *args, **kwargs
request, organization_slug, team_id_or_slug, *args, **kwargs
)
kwargs["external_team"] = self.get_external_actor_or_404(
external_team_id, kwargs["team"].organization
Expand All @@ -47,7 +47,7 @@ def put(self, request: Request, team: Team, external_team: ExternalActor) -> Res
Update an External Team
`````````````
:pparam string organization_id_or_slug: the id or slug of the organization the
:pparam string organization_slug: the slug of the organization the
team belongs to.
:pparam string team_id_or_slug: the id or slug of the team to get.
:pparam string external_team_id: id of external_team object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def post(self, request: Request, team: Team) -> Response:
Create an External Team
`````````````
:pparam string organization_id_or_slug: the id or slug of the organization the
:pparam string organization_slug: the slug of the organization the
team belongs to.
:pparam string team_id_or_slug: the team_id_or_slug of the team to get.
:param required string provider: enum("github", "gitlab")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ class ExternalUserDetailsEndpoint(OrganizationEndpoint, ExternalActorEndpointMix
}
owner = ApiOwner.ENTERPRISE

def convert_args(
def convert_args( # type: ignore[override]
self,
request: Request,
organization_id_or_slug: int | str,
organization_slug: str,
external_user_id: int,
*args: Any,
**kwargs: Any,
) -> tuple[tuple[Any, ...], dict[str, Any]]:
args, kwargs = super().convert_args(request, organization_id_or_slug, *args, **kwargs)
args, kwargs = super().convert_args(request, organization_slug, *args, **kwargs)
kwargs["external_user"] = self.get_external_actor_or_404(
external_user_id, kwargs["organization"]
)
Expand All @@ -48,7 +48,7 @@ def put(
Update an External User
`````````````
:pparam string organization_id_or_slug: the id or slug of the organization the
:pparam string organization_slug: the slug of the organization the
user belongs to.
:pparam int user_id: the User id.
:pparam string external_user_id: id of external_user object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def post(self, request: Request, organization: Organization) -> Response:
Create an External User
`````````````
:pparam string organization_id_or_slug: the id or slug of the organization the
:pparam string organization_slug: the slug of the organization the
user belongs to.
:param required string provider: enum("github", "gitlab", "slack")
:param required string external_name: the associated username for this provider.
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/api/endpoints/codeowners/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def post(self, request: Request, project: Project) -> Response:
Upload a CODEOWNERS for project
`````````````
:pparam string organization_id_or_slug: the id or slug of the organization.
:pparam string organization_slug: the slug of the organization.
:pparam string project_id_or_slug: the id or slug of the project to get.
:param string raw: the raw CODEOWNERS text
:param string codeMappingId: id of the RepositoryProjectPathConfig object
Expand Down
12 changes: 6 additions & 6 deletions src/sentry/api/endpoints/debug_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def get(self, request: Request, project) -> Response:
Retrieve a list of associated releases for a given Proguard File.
:pparam string organization_id_or_slug: the id or slug of the organization the
:pparam string organization_slug: the slug of the organization the
file belongs to.
:pparam string project_id_or_slug: the id or slug of the project to list the
DIFs of.
Expand Down Expand Up @@ -227,7 +227,7 @@ def get(self, request: Request, project) -> Response:
Retrieve a list of debug information files for a given project.
:pparam string organization_id_or_slug: the id or slug of the organization the
:pparam string organization_slug: the slug of the organization the
file belongs to.
:pparam string project_id_or_slug: the id or slug of the project to list the
DIFs of.
Expand Down Expand Up @@ -312,7 +312,7 @@ def delete(self, request: Request, project: Project) -> Response:
Delete a debug information file for a given project.
:pparam string organization_id_or_slug: the id or slug of the organization the
:pparam string organization_slug: the slug of the organization the
file belongs to.
:pparam string project_id_or_slug: the id or slug of the project to delete the
DIF.
Expand Down Expand Up @@ -346,7 +346,7 @@ def post(self, request: Request, project) -> Response:
contains the individual debug images. Uploading through this endpoint
will create different files for the contained images.
:pparam string organization_id_or_slug: the id or slug of the organization the
:pparam string organization_slug: the slug of the organization the
release belongs to.
:pparam string project_id_or_slug: the id or slug of the project to change the
release of.
Expand Down Expand Up @@ -521,7 +521,7 @@ def get(self, request: Request, project) -> Response:
Retrieve a list of source map archives (releases, later bundles) for a given project.
:pparam string organization_id_or_slug: the id or slug of the organization the
:pparam string organization_slug: the slug of the organization the
source map archive belongs to.
:pparam string project_id_or_slug: the id or slug of the project to list the
source map archives of.
Expand Down Expand Up @@ -585,7 +585,7 @@ def delete(self, request: Request, project) -> Response:
Delete all artifacts inside given archive.
:pparam string organization_id_or_slug: the id or slug of the organization the
:pparam string organization_slug: the slug of the organization the
archive belongs to.
:pparam string project_id_or_slug: the id or slug of the project to delete the
archive of.
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/api/endpoints/event_attachment_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def get(self, request: Request, project, event_id, attachment_id) -> Response:
Retrieve an Attachment
``````````````````````
:pparam string organization_id_or_slug: the id or slug of the organization the
:pparam string organization_slug: the slug of the organization the
issues belong to.
:pparam string project_id_or_slug: the id or slug of the project the event
belongs to.
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/api/endpoints/event_attachments.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def get(self, request: Request, project, event_id) -> Response:
Retrieve attachments for an event
`````````````````````````````````
:pparam string organization_id_or_slug: the id or slug of the organization the
:pparam string organization_slug: the slug of the organization the
issues belong to.
:pparam string project_id_or_slug: the id or slug of the project the event
belongs to.
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/api/endpoints/event_reprocessable.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def get(self, request: Request, project, event_id) -> Response:
* `attachment.not_found`: A required attachment, such as the original
minidump, is missing.
:pparam string organization_id_or_slug: the id or slug of the organization the
:pparam string organization_slug: the slug of the organization the
issues belong to.
:pparam string project_id_or_slug: the id or slug of the project the event
belongs to.
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/api/endpoints/filechange.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def get(self, request: Request, organization, version) -> Response:
Retrieve a list of files that were changed in a given release's commits.
:pparam string organization_id_or_slug: the id or slug of the organization the
:pparam string organization_slug: the slug of the organization the
release belongs to.
:pparam string version: the version identifier of the release.
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/api/endpoints/group_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def get(self, request: Request, group) -> Response:
the issue (title, last seen, first seen), some overall numbers (number
of comments, user reports) as well as the summarized event data.
:pparam string organization_id_or_slug: the id or slug of the organization.
:pparam string organization_slug: The slug of the organization.
:pparam string issue_id: the ID of the issue to retrieve.
:auth: required
"""
Expand Down
4 changes: 2 additions & 2 deletions src/sentry/api/endpoints/group_similar_issues_embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from sentry.models.group import Group
from sentry.models.user import User
from sentry.seer.utils import (
SimilarIssuesEmbeddingsData,
RawSeerSimilarIssueData,
SimilarIssuesEmbeddingsRequest,
get_similar_issues_embeddings,
)
Expand Down Expand Up @@ -108,7 +108,7 @@ class GroupSimilarIssuesEmbeddingsEndpoint(GroupEndpoint):

def get_formatted_results(
self,
similar_issues_data: Sequence[SimilarIssuesEmbeddingsData],
similar_issues_data: Sequence[RawSeerSimilarIssueData],
user: User | AnonymousUser,
) -> Sequence[tuple[Mapping[str, Any], Mapping[str, Any]] | None]:
"""
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/api/endpoints/group_tombstone_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def delete(self, request: Request, project, tombstone_id) -> Response:
Undiscards a group such that new events in that group will be captured.
This does not restore any previous data.
:pparam string organization_id_or_slug: the id or slug of the organization.
:pparam string organization_slug: the slug of the organization.
:pparam string project_id_or_slug: the id or slug of the project to which this tombstone belongs.
:pparam string tombstone_id: the ID of the tombstone to remove.
:auth: required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class OrganizationIntegrationsEndpoint(OrganizationIntegrationBaseEndpoint):
@extend_schema(
operation_id="List an Organization's Available Integrations",
parameters=[
GlobalParams.ORG_ID_OR_SLUG,
GlobalParams.ORG_SLUG,
IntegrationParams.PROVIDER_KEY,
IntegrationParams.FEATURES,
IntegrationParams.INCLUDE_CONFIG,
Expand Down
3 changes: 0 additions & 3 deletions src/sentry/api/endpoints/internal/integration_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,6 @@ def _should_operate(self, request: HttpRequest) -> bool:
logger.info("integration_proxy.failure.invalid_request", extra=self.log_extra)
metrics.incr("hybrid_cloud.integration_proxy.failure.invalid_request", sample_rate=1.0)
return False

logger.info("integration_proxy.valid_request", extra=self.log_extra)
return True

def _call_third_party_api(self, request, full_url: str, headers) -> HttpResponse:
Expand Down Expand Up @@ -218,7 +216,6 @@ def http_method_not_allowed(self, request):
tags={"status": response.status_code},
sample_rate=1.0,
)
logger.info("proxy_success", extra=self.log_extra)
return response

def handle_exception( # type: ignore[override]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def convert_args(self, request: Request, action_id: int, *args, **kwargs):
@extend_schema(
operation_id="Retrieve a Spike Protection Notification Action",
parameters=[
GlobalParams.ORG_ID_OR_SLUG,
GlobalParams.ORG_SLUG,
NotificationParams.ACTION_ID,
],
responses={200: OutgoingNotificationActionSerializer},
Expand All @@ -111,7 +111,7 @@ def get(
@extend_schema(
operation_id="Update a Spike Protection Notification Action",
parameters=[
GlobalParams.ORG_ID_OR_SLUG,
GlobalParams.ORG_SLUG,
NotificationParams.ACTION_ID,
],
request=NotificationActionSerializer,
Expand Down Expand Up @@ -159,7 +159,7 @@ def put(
@extend_schema(
operation_id="Delete a Spike Protection Notification Action",
parameters=[
GlobalParams.ORG_ID_OR_SLUG,
GlobalParams.ORG_SLUG,
NotificationParams.ACTION_ID,
],
responses={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class NotificationActionsIndexEndpoint(OrganizationEndpoint):
@extend_schema(
operation_id="List Spike Protection Notifications",
parameters=[
GlobalParams.ORG_ID_OR_SLUG,
GlobalParams.ORG_SLUG,
OrganizationParams.PROJECT,
OrganizationParams.PROJECT_ID_OR_SLUG,
NotificationParams.TRIGGER_TYPE,
Expand Down Expand Up @@ -119,7 +119,7 @@ def get(self, request: Request, organization: Organization) -> Response:
@extend_schema(
operation_id="Create a Spike Protection Notification Action",
parameters=[
GlobalParams.ORG_ID_OR_SLUG,
GlobalParams.ORG_SLUG,
],
request=NotificationActionSerializer,
responses={
Expand Down
6 changes: 3 additions & 3 deletions src/sentry/api/endpoints/organization_api_key_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def get(self, request: Request, organization_context, organization, api_key_id)
Retrieves API Key details
`````````````````````````
:pparam string organization_id_or_slug: the id or slug of the organization the
:pparam string organization_slug: the slug of the organization the
team belongs to.
:pparam string api_key_id: the ID of the api key to delete
:auth: required
Expand All @@ -53,7 +53,7 @@ def put(self, request: Request, organization_context, organization, api_key_id)
Update an API Key
`````````````````
:pparam string organization_id_or_slug: the id or slug of the organization the
:pparam string organization_slug: the slug of the organization the
team belongs to.
:pparam string api_key_id: the ID of the api key to delete
:param string label: the new label for the api key
Expand Down Expand Up @@ -89,7 +89,7 @@ def delete(self, request: Request, organization_context, organization, api_key_i
Deletes an API Key
``````````````````
:pparam string organization_id_or_slug: the id or slug of the organization the
:pparam string organization_slug: the slug of the organization the
team belongs to.
:pparam string api_key_id: the ID of the api key to delete
:auth: required
Expand Down
4 changes: 2 additions & 2 deletions src/sentry/api/endpoints/organization_api_key_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def get(self, request: Request, organization_context, organization) -> Response:
List an Organization's API Keys
```````````````````````````````````
:pparam string organization_id_or_slug: the id or slug of the organization
:pparam string organization_slug: the organization short name
:auth: required
"""
queryset = sorted(
Expand All @@ -44,7 +44,7 @@ def post(self, request: Request, organization_context, organization) -> Response
Create an Organization API Key
```````````````````````````````````
:pparam string organization_id_or_slug: the id or slug of the organization
:pparam string organization_slug: the organization short name
:auth: required
"""
key = ApiKey.objects.create(organization_id=organization.id, scope_list=DEFAULT_SCOPES)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def get(self, request: Request, organization: Organization) -> Response:
currently installed auth_provider
``````````````````````````````````````````````````````
:pparam string organization_id_or_slug: the id or slug of the organization
:pparam string organization_slug: the organization short name
:auth: required
"""
auth_provider = auth_service.get_auth_provider(organization_id=organization.id)
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/api/endpoints/organization_auth_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get(self, request: Request, organization) -> Response:
List available auth providers that are available to use for an Organization
```````````````````````````````````````````````````````````````````````````
:pparam string organization_id_or_slug: the id or slug of the organization
:pparam string organization_slug: the organization short name
:auth: required
"""
provider_list = []
Expand Down
Loading

0 comments on commit d74e608

Please sign in to comment.