Skip to content

Commit

Permalink
chore(apis): delete MinimalProject endpoint (#83206)
Browse files Browse the repository at this point in the history
Deleting unused endpoints. This one doesn't have a frontend call either
so safe to delete in one PR.
  • Loading branch information
sentaur-athena authored Jan 9, 2025
1 parent a0baff4 commit d9dba2f
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 114 deletions.
41 changes: 0 additions & 41 deletions src/sentry/api/endpoints/organization_minimal_projects.py

This file was deleted.

22 changes: 0 additions & 22 deletions src/sentry/api/serializers/models/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -1167,25 +1167,3 @@ def serialize(self, obj, attrs, user, **kwargs):
"features": feature_list,
"organization": {"slug": obj.organization.slug, "name": obj.organization.name},
}


class MinimalProjectSerializer(Serializer):
def get_attrs(self, item_list: Sequence[Project], user: User, **kwargs: Any):
environments_by_project = get_environments_by_projects(item_list)
memberships_by_project = get_access_by_project(item_list, user)
return {
project: {
"environments": environments_by_project[project.id],
"isMember": memberships_by_project[project]["is_member"],
}
for project in item_list
}

def serialize(self, obj: Project, attrs: Mapping[str, Any], user: User):
return {
"slug": obj.slug,
"id": obj.id,
"platform": obj.platform,
"environments": attrs["environments"],
"isMember": attrs["isMember"],
}
6 changes: 0 additions & 6 deletions src/sentry/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
OrganizationEventsRootCauseAnalysisEndpoint,
)
from sentry.api.endpoints.organization_fork import OrganizationForkEndpoint
from sentry.api.endpoints.organization_minimal_projects import OrganizationMinimalProjectsEndpoint
from sentry.api.endpoints.organization_missing_org_members import OrganizationMissingMembersEndpoint
from sentry.api.endpoints.organization_plugins_configs import OrganizationPluginsConfigsEndpoint
from sentry.api.endpoints.organization_plugins_index import OrganizationPluginsEndpoint
Expand Down Expand Up @@ -1762,11 +1761,6 @@ def create_group_urls(name_prefix: str) -> list[URLPattern | URLResolver]:
OrganizationProjectsEndpoint.as_view(),
name="sentry-api-0-organization-projects",
),
re_path(
r"^(?P<organization_id_or_slug>[^\/]+)/minimal-projects/$",
OrganizationMinimalProjectsEndpoint.as_view(),
name="sentry-api-0-organization-minimal-projects",
),
re_path(
r"^(?P<organization_id_or_slug>[^\/]+)/experimental/projects/$",
OrganizationProjectsExperimentEndpoint.as_view(),
Expand Down
1 change: 0 additions & 1 deletion src/sentry/apidocs/api_ownership_allowlist_dont_modify.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"/api/0/organizations/{organization_id_or_slug}/releases/",
"/api/0/organizations/{organization_id_or_slug}/releases/{version}/files/",
"/api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/",
"/api/0/organizations/{organization_id_or_slug}/minimal-projects/",
"/api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/releases/{version}/commits/",
"/api/0/users/{user_id}/roles/",
"/api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/keys/{key_id}/",
Expand Down
43 changes: 0 additions & 43 deletions tests/sentry/api/endpoints/test_organization_minimal_projects.py

This file was deleted.

2 changes: 1 addition & 1 deletion tests/sentry/api/test_data_secrecy.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_member_has_access(self):

class DataSecrecyV2TestCase(APITestCase):
# Picked an endpoint with OrganizationAndStaffPermission
endpoint = "sentry-api-0-organization-minimal-projects"
endpoint = "sentry-api-0-organization-projects"
method = "get"

def setUp(self):
Expand Down

0 comments on commit d9dba2f

Please sign in to comment.