Skip to content

Commit fc22f90

Browse files
Merge branch 'master' into extract-fixability-v2
2 parents fb2359d + 40168e0 commit fc22f90

26 files changed

+110
-40
lines changed

src/sentry/api/api_owners.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ class ApiOwner(Enum):
3232
SECURITY = "security"
3333
TELEMETRY_EXPERIENCE = "telemetry-experience"
3434
UNOWNED = "unowned"
35-
VISIBILITY = "visibility"
35+
DATA_BROWSING = "data-browsing"
3636
WEB_FRONTEND_SDKS = "team-javascript-sdks"

src/sentry/api/bases/organization_events.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def resolve_axis_column(
9393

9494

9595
class OrganizationEventsEndpointBase(OrganizationEndpoint):
96-
owner = ApiOwner.VISIBILITY
96+
owner = ApiOwner.DATA_BROWSING
9797

9898
def has_feature(self, organization: Organization, request: Request) -> bool:
9999
return (
@@ -223,7 +223,7 @@ def quantize_date_params(
223223

224224

225225
class OrganizationEventsV2EndpointBase(OrganizationEventsEndpointBase):
226-
owner = ApiOwner.VISIBILITY
226+
owner = ApiOwner.DATA_BROWSING
227227

228228
def build_cursor_link(self, request: HttpRequest, name: str, cursor: Cursor | None) -> str:
229229
# The base API function only uses the last query parameter, but this endpoint

src/sentry/api/endpoints/organization_ai_conversations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class OrganizationAIConversationsEndpoint(OrganizationEventsV2EndpointBase):
5858
publish_status = {
5959
"GET": ApiPublishStatus.PRIVATE,
6060
}
61-
owner = ApiOwner.VISIBILITY
61+
owner = ApiOwner.DATA_BROWSING
6262

6363
def get(self, request: Request, organization: Organization) -> Response:
6464
"""

src/sentry/api/endpoints/organization_events_histogram.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class OrganizationEventsHistogramEndpoint(OrganizationEventsV2EndpointBase):
4848
publish_status = {
4949
"GET": ApiPublishStatus.PRIVATE,
5050
}
51-
owner = ApiOwner.VISIBILITY
51+
owner = ApiOwner.DATA_BROWSING
5252

5353
def has_feature(self, organization, request):
5454
return features.has("organizations:performance-view", organization, actor=request.user)

src/sentry/api/endpoints/organization_spans_fields.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class OrganizationSpansFieldsEndpointBase(OrganizationEventsV2EndpointBase):
5858
publish_status = {
5959
"GET": ApiPublishStatus.PRIVATE,
6060
}
61-
owner = ApiOwner.VISIBILITY
61+
owner = ApiOwner.DATA_BROWSING
6262

6363

6464
class OrganizationSpansFieldsEndpointSerializer(serializers.Serializer):
@@ -184,7 +184,7 @@ def get(self, request: Request, organization: Organization, key: str) -> Respons
184184
with handle_query_errors():
185185
tag_values = executor.execute()
186186

187-
tag_values.sort(key=lambda tag: tag.value)
187+
tag_values.sort(key=lambda tag: tag.value or "")
188188

189189
paginator = ChainPaginator([tag_values], max_limit=max_span_tag_values)
190190

src/sentry/api/endpoints/organization_spans_fields_stats.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class OrganizationSpansFieldsStatsEndpoint(OrganizationEventsV2EndpointBase):
3333
publish_status = {
3434
"GET": ApiPublishStatus.EXPERIMENTAL,
3535
}
36-
owner = ApiOwner.VISIBILITY
36+
owner = ApiOwner.DATA_BROWSING
3737

3838
def get(self, request: Request, organization: Organization) -> Response:
3939

src/sentry/api/endpoints/organization_tags.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class OrganizationTagsEndpoint(OrganizationEndpoint):
2424
publish_status = {
2525
"GET": ApiPublishStatus.PRIVATE,
2626
}
27-
owner = ApiOwner.VISIBILITY
27+
owner = ApiOwner.DATA_BROWSING
2828

2929
def get(self, request: Request, organization: Organization) -> Response:
3030
try:

src/sentry/api/endpoints/organization_trace_item_attributes.py

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class OrganizationTraceItemAttributesEndpointBase(OrganizationEventsV2EndpointBa
104104
publish_status = {
105105
"GET": ApiPublishStatus.PRIVATE,
106106
}
107-
owner = ApiOwner.VISIBILITY
107+
owner = ApiOwner.DATA_BROWSING
108108
feature_flags = [
109109
"organizations:ourlogs-enabled",
110110
"organizations:visibility-explore-view",
@@ -231,7 +231,9 @@ def get(self, request: Request, organization: Organization) -> Response:
231231
)
232232

233233
use_sentry_conventions = features.has(
234-
"organizations:performance-sentry-conventions-fields", organization, actor=request.user
234+
"organizations:performance-sentry-conventions-fields",
235+
organization,
236+
actor=request.user,
235237
)
236238

237239
sentry_sdk.set_tag("feature.use_sentry_conventions", use_sentry_conventions)
@@ -248,7 +250,9 @@ def get(self, request: Request, organization: Organization) -> Response:
248250
referrer = resolve_attribute_referrer(trace_item_type, attribute_type)
249251
column_definitions = get_column_definitions(trace_item_type)
250252
resolver = SearchResolver(
251-
params=snuba_params, config=SearchResolverConfig(), definitions=column_definitions
253+
params=snuba_params,
254+
config=SearchResolverConfig(),
255+
definitions=column_definitions,
252256
)
253257
query_filter, _, _ = resolver.resolve_query(query_string)
254258
meta = resolver.resolve_meta(referrer=referrer.value)
@@ -287,16 +291,22 @@ def data_fn(offset: int, limit: int):
287291
attribute_keys = {}
288292
for attribute in rpc_response.attributes:
289293
if attribute.name and can_expose_attribute(
290-
attribute.name, trace_item_type, include_internal=include_internal
294+
attribute.name,
295+
trace_item_type,
296+
include_internal=include_internal,
291297
):
292298
attr_key = as_attribute_key(
293-
attribute.name, serialized["attribute_type"], trace_item_type
299+
attribute.name,
300+
serialized["attribute_type"],
301+
trace_item_type,
294302
)
295303
public_alias = attr_key["name"]
296304
replacement = translate_to_sentry_conventions(public_alias, trace_item_type)
297305
if public_alias != replacement:
298306
attr_key = as_attribute_key(
299-
replacement, serialized["attribute_type"], trace_item_type
307+
replacement,
308+
serialized["attribute_type"],
309+
trace_item_type,
300310
)
301311

302312
attribute_keys[attr_key["name"]] = attr_key
@@ -312,12 +322,16 @@ def data_fn(offset: int, limit: int):
312322
),
313323
[
314324
as_attribute_key(
315-
attribute.name, serialized["attribute_type"], trace_item_type
325+
attribute.name,
326+
serialized["attribute_type"],
327+
trace_item_type,
316328
)
317329
for attribute in rpc_response.attributes
318330
if attribute.name
319331
and can_expose_attribute(
320-
attribute.name, trace_item_type, include_internal=include_internal
332+
attribute.name,
333+
trace_item_type,
334+
include_internal=include_internal,
321335
)
322336
],
323337
)
@@ -375,7 +389,7 @@ def data_fn(offset: int, limit: int):
375389

376390
with handle_query_errors():
377391
tag_values = executor.execute()
378-
tag_values.sort(key=lambda tag: tag.value)
392+
tag_values.sort(key=lambda tag: tag.value or "")
379393
return tag_values
380394

381395
return self.paginate(
@@ -425,7 +439,11 @@ def resolve_attribute_key(
425439
resolved_attr, context_definition = self.resolver.resolve_attribute(key)
426440
if context_definition:
427441
resolved_attr = self.resolver.map_context_to_original_column(context_definition)
428-
return resolved_attr.search_type, resolved_attr.proto_definition, context_definition
442+
return (
443+
resolved_attr.search_type,
444+
resolved_attr.proto_definition,
445+
context_definition,
446+
)
429447

430448
def execute(self) -> list[TagValue]:
431449
func = self.autocomplete_function.get(self.key)
@@ -545,7 +563,8 @@ def semver_build_autocomplete_function(self):
545563
def semver_package_autocomplete_function(self):
546564
packages = (
547565
Release.objects.filter(
548-
organization_id=self.snuba_params.organization_id, package__startswith=self.query
566+
organization_id=self.snuba_params.organization_id,
567+
package__startswith=self.query,
549568
)
550569
.values_list("package")
551570
.distinct()

src/sentry/api/endpoints/organization_trace_item_attributes_ranked.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class OrganizationTraceItemsAttributesRankedEndpoint(OrganizationEventsV2Endpoin
3838
publish_status = {
3939
"GET": ApiPublishStatus.PRIVATE,
4040
}
41-
owner = ApiOwner.VISIBILITY
41+
owner = ApiOwner.DATA_BROWSING
4242

4343
def get(self, request: Request, organization: Organization) -> Response:
4444

src/sentry/api/endpoints/organization_trace_item_stats.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class OrganizationTraceItemsStatsEndpoint(OrganizationEventsV2EndpointBase):
3131
publish_status = {
3232
"GET": ApiPublishStatus.PRIVATE,
3333
}
34-
owner = ApiOwner.VISIBILITY
34+
owner = ApiOwner.DATA_BROWSING
3535

3636
def get(self, request: Request, organization: Organization) -> Response:
3737
try:

0 commit comments

Comments
 (0)