diff --git a/src/sentry/api/api_owners.py b/src/sentry/api/api_owners.py index abfbbdf08a2999..0089b7a67a7535 100644 --- a/src/sentry/api/api_owners.py +++ b/src/sentry/api/api_owners.py @@ -32,5 +32,5 @@ class ApiOwner(Enum): SECURITY = "security" TELEMETRY_EXPERIENCE = "telemetry-experience" UNOWNED = "unowned" - VISIBILITY = "visibility" + DATA_BROWSING = "data-browsing" WEB_FRONTEND_SDKS = "team-javascript-sdks" diff --git a/src/sentry/api/bases/organization_events.py b/src/sentry/api/bases/organization_events.py index 2b7794efec60ce..7746280ab6ca0f 100644 --- a/src/sentry/api/bases/organization_events.py +++ b/src/sentry/api/bases/organization_events.py @@ -93,7 +93,7 @@ def resolve_axis_column( class OrganizationEventsEndpointBase(OrganizationEndpoint): - owner = ApiOwner.VISIBILITY + owner = ApiOwner.DATA_BROWSING def has_feature(self, organization: Organization, request: Request) -> bool: return ( @@ -223,7 +223,7 @@ def quantize_date_params( class OrganizationEventsV2EndpointBase(OrganizationEventsEndpointBase): - owner = ApiOwner.VISIBILITY + owner = ApiOwner.DATA_BROWSING def build_cursor_link(self, request: HttpRequest, name: str, cursor: Cursor | None) -> str: # The base API function only uses the last query parameter, but this endpoint diff --git a/src/sentry/api/endpoints/organization_ai_conversations.py b/src/sentry/api/endpoints/organization_ai_conversations.py index 8a6c6dee694bec..56a22a0ce7c031 100644 --- a/src/sentry/api/endpoints/organization_ai_conversations.py +++ b/src/sentry/api/endpoints/organization_ai_conversations.py @@ -58,7 +58,7 @@ class OrganizationAIConversationsEndpoint(OrganizationEventsV2EndpointBase): publish_status = { "GET": ApiPublishStatus.PRIVATE, } - owner = ApiOwner.VISIBILITY + owner = ApiOwner.DATA_BROWSING def get(self, request: Request, organization: Organization) -> Response: """ diff --git a/src/sentry/api/endpoints/organization_events_histogram.py b/src/sentry/api/endpoints/organization_events_histogram.py index df9aa008891688..4c8a00e68881ba 100644 --- a/src/sentry/api/endpoints/organization_events_histogram.py +++ b/src/sentry/api/endpoints/organization_events_histogram.py @@ -48,7 +48,7 @@ class OrganizationEventsHistogramEndpoint(OrganizationEventsV2EndpointBase): publish_status = { "GET": ApiPublishStatus.PRIVATE, } - owner = ApiOwner.VISIBILITY + owner = ApiOwner.DATA_BROWSING def has_feature(self, organization, request): return features.has("organizations:performance-view", organization, actor=request.user) diff --git a/src/sentry/api/endpoints/organization_spans_fields.py b/src/sentry/api/endpoints/organization_spans_fields.py index 259496d1d69f2a..819381e5edbef0 100644 --- a/src/sentry/api/endpoints/organization_spans_fields.py +++ b/src/sentry/api/endpoints/organization_spans_fields.py @@ -58,7 +58,7 @@ class OrganizationSpansFieldsEndpointBase(OrganizationEventsV2EndpointBase): publish_status = { "GET": ApiPublishStatus.PRIVATE, } - owner = ApiOwner.VISIBILITY + owner = ApiOwner.DATA_BROWSING class OrganizationSpansFieldsEndpointSerializer(serializers.Serializer): diff --git a/src/sentry/api/endpoints/organization_spans_fields_stats.py b/src/sentry/api/endpoints/organization_spans_fields_stats.py index e763aad87414e8..7fac80cacdae77 100644 --- a/src/sentry/api/endpoints/organization_spans_fields_stats.py +++ b/src/sentry/api/endpoints/organization_spans_fields_stats.py @@ -33,7 +33,7 @@ class OrganizationSpansFieldsStatsEndpoint(OrganizationEventsV2EndpointBase): publish_status = { "GET": ApiPublishStatus.EXPERIMENTAL, } - owner = ApiOwner.VISIBILITY + owner = ApiOwner.DATA_BROWSING def get(self, request: Request, organization: Organization) -> Response: diff --git a/src/sentry/api/endpoints/organization_tags.py b/src/sentry/api/endpoints/organization_tags.py index 1dee2162dda9f6..0049ad6ed94c2a 100644 --- a/src/sentry/api/endpoints/organization_tags.py +++ b/src/sentry/api/endpoints/organization_tags.py @@ -24,7 +24,7 @@ class OrganizationTagsEndpoint(OrganizationEndpoint): publish_status = { "GET": ApiPublishStatus.PRIVATE, } - owner = ApiOwner.VISIBILITY + owner = ApiOwner.DATA_BROWSING def get(self, request: Request, organization: Organization) -> Response: try: diff --git a/src/sentry/api/endpoints/organization_trace_item_attributes.py b/src/sentry/api/endpoints/organization_trace_item_attributes.py index 3fc0061c4ff91b..09345346f90fb2 100644 --- a/src/sentry/api/endpoints/organization_trace_item_attributes.py +++ b/src/sentry/api/endpoints/organization_trace_item_attributes.py @@ -104,7 +104,7 @@ class OrganizationTraceItemAttributesEndpointBase(OrganizationEventsV2EndpointBa publish_status = { "GET": ApiPublishStatus.PRIVATE, } - owner = ApiOwner.VISIBILITY + owner = ApiOwner.DATA_BROWSING feature_flags = [ "organizations:ourlogs-enabled", "organizations:visibility-explore-view", @@ -231,7 +231,9 @@ def get(self, request: Request, organization: Organization) -> Response: ) use_sentry_conventions = features.has( - "organizations:performance-sentry-conventions-fields", organization, actor=request.user + "organizations:performance-sentry-conventions-fields", + organization, + actor=request.user, ) sentry_sdk.set_tag("feature.use_sentry_conventions", use_sentry_conventions) @@ -248,7 +250,9 @@ def get(self, request: Request, organization: Organization) -> Response: referrer = resolve_attribute_referrer(trace_item_type, attribute_type) column_definitions = get_column_definitions(trace_item_type) resolver = SearchResolver( - params=snuba_params, config=SearchResolverConfig(), definitions=column_definitions + params=snuba_params, + config=SearchResolverConfig(), + definitions=column_definitions, ) query_filter, _, _ = resolver.resolve_query(query_string) meta = resolver.resolve_meta(referrer=referrer.value) @@ -287,16 +291,22 @@ def data_fn(offset: int, limit: int): attribute_keys = {} for attribute in rpc_response.attributes: if attribute.name and can_expose_attribute( - attribute.name, trace_item_type, include_internal=include_internal + attribute.name, + trace_item_type, + include_internal=include_internal, ): attr_key = as_attribute_key( - attribute.name, serialized["attribute_type"], trace_item_type + attribute.name, + serialized["attribute_type"], + trace_item_type, ) public_alias = attr_key["name"] replacement = translate_to_sentry_conventions(public_alias, trace_item_type) if public_alias != replacement: attr_key = as_attribute_key( - replacement, serialized["attribute_type"], trace_item_type + replacement, + serialized["attribute_type"], + trace_item_type, ) attribute_keys[attr_key["name"]] = attr_key @@ -312,12 +322,16 @@ def data_fn(offset: int, limit: int): ), [ as_attribute_key( - attribute.name, serialized["attribute_type"], trace_item_type + attribute.name, + serialized["attribute_type"], + trace_item_type, ) for attribute in rpc_response.attributes if attribute.name and can_expose_attribute( - attribute.name, trace_item_type, include_internal=include_internal + attribute.name, + trace_item_type, + include_internal=include_internal, ) ], ) @@ -425,7 +439,11 @@ def resolve_attribute_key( resolved_attr, context_definition = self.resolver.resolve_attribute(key) if context_definition: resolved_attr = self.resolver.map_context_to_original_column(context_definition) - return resolved_attr.search_type, resolved_attr.proto_definition, context_definition + return ( + resolved_attr.search_type, + resolved_attr.proto_definition, + context_definition, + ) def execute(self) -> list[TagValue]: func = self.autocomplete_function.get(self.key) @@ -545,7 +563,8 @@ def semver_build_autocomplete_function(self): def semver_package_autocomplete_function(self): packages = ( Release.objects.filter( - organization_id=self.snuba_params.organization_id, package__startswith=self.query + organization_id=self.snuba_params.organization_id, + package__startswith=self.query, ) .values_list("package") .distinct() diff --git a/src/sentry/api/endpoints/organization_trace_item_attributes_ranked.py b/src/sentry/api/endpoints/organization_trace_item_attributes_ranked.py index 1a64303d959c24..4dfa67000bf5de 100644 --- a/src/sentry/api/endpoints/organization_trace_item_attributes_ranked.py +++ b/src/sentry/api/endpoints/organization_trace_item_attributes_ranked.py @@ -38,7 +38,7 @@ class OrganizationTraceItemsAttributesRankedEndpoint(OrganizationEventsV2Endpoin publish_status = { "GET": ApiPublishStatus.PRIVATE, } - owner = ApiOwner.VISIBILITY + owner = ApiOwner.DATA_BROWSING def get(self, request: Request, organization: Organization) -> Response: diff --git a/src/sentry/api/endpoints/organization_trace_item_stats.py b/src/sentry/api/endpoints/organization_trace_item_stats.py index a64c1865a6f035..f89faaa7f33957 100644 --- a/src/sentry/api/endpoints/organization_trace_item_stats.py +++ b/src/sentry/api/endpoints/organization_trace_item_stats.py @@ -31,7 +31,7 @@ class OrganizationTraceItemsStatsEndpoint(OrganizationEventsV2EndpointBase): publish_status = { "GET": ApiPublishStatus.PRIVATE, } - owner = ApiOwner.VISIBILITY + owner = ApiOwner.DATA_BROWSING def get(self, request: Request, organization: Organization) -> Response: try: diff --git a/src/sentry/api/endpoints/organization_traces.py b/src/sentry/api/endpoints/organization_traces.py index 6f52c66cc58472..33286e7df1eff8 100644 --- a/src/sentry/api/endpoints/organization_traces.py +++ b/src/sentry/api/endpoints/organization_traces.py @@ -127,7 +127,7 @@ class OrganizationTracesEndpointBase(OrganizationEventsV2EndpointBase): publish_status = { "GET": ApiPublishStatus.EXPERIMENTAL, } - owner = ApiOwner.VISIBILITY + owner = ApiOwner.DATA_BROWSING @region_silo_endpoint diff --git a/src/sentry/api/endpoints/project_create_sample_transaction.py b/src/sentry/api/endpoints/project_create_sample_transaction.py index 14acba2995b1c8..9bf53bbeb09281 100644 --- a/src/sentry/api/endpoints/project_create_sample_transaction.py +++ b/src/sentry/api/endpoints/project_create_sample_transaction.py @@ -66,7 +66,7 @@ def fix_event_data(data): @region_silo_endpoint class ProjectCreateSampleTransactionEndpoint(ProjectEndpoint): - owner = ApiOwner.VISIBILITY + owner = ApiOwner.DATA_BROWSING publish_status = { "POST": ApiPublishStatus.PRIVATE, } diff --git a/src/sentry/api/endpoints/project_performance_general_settings.py b/src/sentry/api/endpoints/project_performance_general_settings.py index 5bfff4fb7a1ef9..57e20d68c896c2 100644 --- a/src/sentry/api/endpoints/project_performance_general_settings.py +++ b/src/sentry/api/endpoints/project_performance_general_settings.py @@ -19,7 +19,7 @@ class ProjectPerformanceGeneralSettingsSerializer(serializers.Serializer): @region_silo_endpoint class ProjectPerformanceGeneralSettingsEndpoint(ProjectEndpoint): - owner = ApiOwner.VISIBILITY + owner = ApiOwner.DATA_BROWSING publish_status = { "DELETE": ApiPublishStatus.PRIVATE, "GET": ApiPublishStatus.PRIVATE, diff --git a/src/sentry/api/endpoints/project_trace_item_details.py b/src/sentry/api/endpoints/project_trace_item_details.py index b2cb706d84fcd2..cb8adff678343f 100644 --- a/src/sentry/api/endpoints/project_trace_item_details.py +++ b/src/sentry/api/endpoints/project_trace_item_details.py @@ -238,7 +238,7 @@ class ProjectTraceItemDetailsEndpointSerializer(serializers.Serializer): @region_silo_endpoint class ProjectTraceItemDetailsEndpoint(ProjectEndpoint): - owner = ApiOwner.VISIBILITY + owner = ApiOwner.DATA_BROWSING publish_status = { "GET": ApiPublishStatus.EXPERIMENTAL, } diff --git a/src/sentry/api/endpoints/project_transaction_threshold.py b/src/sentry/api/endpoints/project_transaction_threshold.py index e1b79fbb0f4a5b..b59d18eef14b7b 100644 --- a/src/sentry/api/endpoints/project_transaction_threshold.py +++ b/src/sentry/api/endpoints/project_transaction_threshold.py @@ -42,7 +42,7 @@ def validate_threshold(self, threshold): @region_silo_endpoint class ProjectTransactionThresholdEndpoint(ProjectEndpoint): - owner = ApiOwner.VISIBILITY + owner = ApiOwner.DATA_BROWSING publish_status = { "DELETE": ApiPublishStatus.PRIVATE, "GET": ApiPublishStatus.PRIVATE, diff --git a/src/sentry/data_export/endpoints/data_export_details.py b/src/sentry/data_export/endpoints/data_export_details.py index 9c29dcfd13a922..8667c0015f4814 100644 --- a/src/sentry/data_export/endpoints/data_export_details.py +++ b/src/sentry/data_export/endpoints/data_export_details.py @@ -20,7 +20,7 @@ class DataExportDetailsEndpoint(OrganizationEndpoint): publish_status = { "GET": ApiPublishStatus.PRIVATE, } - owner = ApiOwner.VISIBILITY + owner = ApiOwner.DATA_BROWSING permission_classes = (OrganizationDataExportPermission,) def get( diff --git a/src/sentry/discover/endpoints/discover_saved_queries.py b/src/sentry/discover/endpoints/discover_saved_queries.py index fbdc086fef8651..530b461cc3d3a8 100644 --- a/src/sentry/discover/endpoints/discover_saved_queries.py +++ b/src/sentry/discover/endpoints/discover_saved_queries.py @@ -40,7 +40,7 @@ class DiscoverSavedQueriesEndpoint(OrganizationEndpoint): "GET": ApiPublishStatus.PUBLIC, "POST": ApiPublishStatus.PUBLIC, } - owner = ApiOwner.VISIBILITY + owner = ApiOwner.DATA_BROWSING permission_classes = (DiscoverSavedQueryPermission,) def has_feature(self, organization, request): diff --git a/src/sentry/discover/endpoints/discover_saved_query_detail.py b/src/sentry/discover/endpoints/discover_saved_query_detail.py index 8f18bd1557a9f5..5948d18a6675e7 100644 --- a/src/sentry/discover/endpoints/discover_saved_query_detail.py +++ b/src/sentry/discover/endpoints/discover_saved_query_detail.py @@ -28,7 +28,7 @@ class DiscoverSavedQueryBase(OrganizationEndpoint): - owner = ApiOwner.VISIBILITY + owner = ApiOwner.DATA_BROWSING permission_classes = (DiscoverSavedQueryPermission,) def convert_args(self, request: Request, organization_id_or_slug, query_id, *args, **kwargs): diff --git a/src/sentry/insights/endpoints/starred_segments.py b/src/sentry/insights/endpoints/starred_segments.py index 455fb2cc0033c2..39b933883fb049 100644 --- a/src/sentry/insights/endpoints/starred_segments.py +++ b/src/sentry/insights/endpoints/starred_segments.py @@ -31,7 +31,7 @@ class InsightsStarredSegmentsEndpoint(OrganizationEndpoint): "POST": ApiPublishStatus.EXPERIMENTAL, "DELETE": ApiPublishStatus.EXPERIMENTAL, } - owner = ApiOwner.VISIBILITY + owner = ApiOwner.DATA_BROWSING permission_classes = (MemberPermission,) def has_feature(self, organization, request): diff --git a/src/sentry/issues/endpoints/project_user_issue.py b/src/sentry/issues/endpoints/project_user_issue.py index 9e3a07513124de..e01cec9e3e60eb 100644 --- a/src/sentry/issues/endpoints/project_user_issue.py +++ b/src/sentry/issues/endpoints/project_user_issue.py @@ -196,7 +196,7 @@ class ProjectUserIssueEndpoint(ProjectEndpoint): publish_status = { "POST": ApiPublishStatus.EXPERIMENTAL, } - owner = ApiOwner.VISIBILITY + owner = ApiOwner.DATA_BROWSING def get_formatter(self, data: dict) -> BaseUserIssueFormatter: if data.get("issueType") == WebVitalsGroup.slug: