Skip to content

Commit bed30ee

Browse files
authored
ref(apidocs): dont make devs set private = True for apidocs (#45660)
- There was previously a push to make new API endpoints public, and we'd fail api docs tests if private wasn't set to true, or the endpoints were documented - This ended up not being super useful as most new endpoints are private / still in development / only for the UI, so it never made sense to make them public right away - This also caused a bunch of brittleness as we maintained an exclusion list for old endpoints. This should improve default developer experience, remove some messiness in imports, and not have any affect on when we make APIs public. will update our devdocs in a follow up PR.
1 parent 902dfb3 commit bed30ee

32 files changed

+11
-996
lines changed

src/sentry/api/base.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ class Endpoint(APIView):
121121

122122
cursor_name = "cursor"
123123

124-
# end user of endpoint must set private to true, or define public endpoints
125-
private: Optional[bool] = None
126124
public: Optional[HTTP_METHODS_SET] = None
127125

128126
rate_limits: RateLimitConfig = DEFAULT_RATE_LIMIT_CONFIG

src/sentry/api/endpoints/admin_project_configs.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
@pending_silo_endpoint
1212
class AdminRelayProjectConfigsEndpoint(Endpoint):
13-
private = True
1413
permission_classes = (SuperuserPermission,)
1514

1615
def get(self, request: Request) -> Response:

src/sentry/api/endpoints/client_state.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
@pending_silo_endpoint
1616
class ClientStateListEndpoint(OrganizationEndpoint):
17-
private = True
18-
1917
def __init__(self, **options) -> None:
2018
cluster_key = getattr(settings, "SENTRY_CLIENT_STATE_REDIS_CLUSTER", "default")
2119
self.client = redis.redis_clusters.get(cluster_key)
@@ -33,8 +31,6 @@ def get(self, request: Request, organization) -> Response:
3331

3432
@pending_silo_endpoint
3533
class ClientStateEndpoint(OrganizationEndpoint):
36-
private = True
37-
3834
def __init__(self, **options) -> None:
3935
self.client = get_redis_client()
4036
super().__init__(**options)

src/sentry/api/endpoints/issue_occurrence.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
@region_silo_endpoint
2020
class IssueOccurrenceEndpoint(Endpoint):
2121
permission_classes = (SuperuserPermission,)
22-
private = True
2322

2423
def post(self, request: Request) -> Response:
2524
"""

src/sentry/api/endpoints/organization_events_spans_histogram.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ def validate_span(self, span: str) -> Span:
3535

3636
@region_silo_endpoint
3737
class OrganizationEventsSpansHistogramEndpoint(OrganizationEventsV2EndpointBase):
38-
private = True
39-
4038
def has_feature(self, organization, request):
4139
return features.has(
4240
"organizations:performance-span-histogram-view", organization, actor=request.user

src/sentry/api/endpoints/organization_integration_issues.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
@region_silo_endpoint
1111
class OrganizationIntegrationIssuesEndpoint(OrganizationIntegrationBaseEndpoint):
12-
private = True
13-
1412
def put(self, request: Request, organization, integration_id) -> Response:
1513
"""
1614
Migrate plugin linked issues to integration linked issues

src/sentry/api/endpoints/organization_measurements_meta.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212

1313
@region_silo_endpoint
1414
class OrganizationMeasurementsMeta(OrganizationEventsEndpointBase): # type: ignore
15-
private = True
16-
1715
def get(self, request: Request, organization: Organization) -> Response:
1816
try:
1917
params = self.get_snuba_params(request, organization)

src/sentry/api/endpoints/organization_metrics_meta.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ class OrganizationMetricsCompatibility(OrganizationEventsEndpointBase):
1919
which are the projects which don't have null transactions and have at least 1 transaction with a valid name
2020
"""
2121

22-
private = True
23-
2422
def get(self, request: Request, organization) -> Response:
2523
data = {
2624
"incompatible_projects": [],
@@ -68,8 +66,6 @@ class OrganizationMetricsCompatibilitySums(OrganizationEventsEndpointBase):
6866
be
6967
"""
7068

71-
private = True
72-
7369
def get(self, request: Request, organization) -> Response:
7470
data = {
7571
"sum": {

src/sentry/api/endpoints/organization_onboarding_continuation_email.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def get_request_builder_args(user: User, organization: Organization, platforms:
4040

4141
@region_silo_endpoint
4242
class OrganizationOnboardingContinuationEmail(OrganizationEndpoint):
43-
private = True
43+
4444
# let anyone in the org use this endpoint
4545
permission_classes = ()
4646

src/sentry/api/endpoints/organization_profiling_profiles.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717

1818
class OrganizationProfilingBaseEndpoint(OrganizationEventsV2EndpointBase): # type: ignore
19-
private = True
20-
2119
def get_profiling_params(self, request: Request, organization: Organization) -> Dict[str, Any]:
2220
try:
2321
params: Dict[str, Any] = parse_profile_filters(request.query_params.get("query", ""))

0 commit comments

Comments
 (0)