Skip to content
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

chore(apis): delete MinimalProject endpoint #83206

Merged
merged 4 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions api_class_names.txt
sentaur-athena marked this conversation as resolved.
Show resolved Hide resolved

Large diffs are not rendered by default.

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
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
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-metrics-details"
method = "get"

def setUp(self):
Expand Down
Loading