Skip to content

Commit b7608da

Browse files
mtopo27claude
andauthored
feat(preprod): Add installable attribute to EAP alias mappings (#112363)
Register PREPROD in the shared `INTERNAL_TO_PUBLIC_ALIAS_MAPPINGS` infrastructure so the EAP attributes endpoint translates `has_installable_file` → `installable`. This makes the `installable` boolean filter appear in the mobile builds search bar dropdown on the Distribution view. Previously, the PREPROD trace item type had no entry in the alias mapping dicts in `search/eap/utils.py`, so `translate_internal_to_public_alias()` returned the raw internal name `has_installable_file`. The frontend `filterToAllowedKeys()` then couldn't match it against the allowlist (which expects `installable`), so the attribute was silently filtered out. The mapping dict is built dynamically from `PREPROD_SIZE_ATTRIBUTE_DEFINITIONS`, so any future aliased PREPROD attributes will automatically be included. Refs EME-868 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0a58b34 commit b7608da

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

src/sentry/search/eap/preprod_size/attributes.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from typing import Literal
2+
13
from sentry.search.eap import constants
24
from sentry.search.eap.columns import ResolvedAttribute, datetime_processor
35
from sentry.search.eap.common_columns import COMMON_COLUMNS
@@ -56,6 +58,11 @@
5658
internal_name="git_head_ref",
5759
search_type="string",
5860
),
61+
ResolvedAttribute(
62+
public_alias="installable",
63+
internal_name="has_installable_file",
64+
search_type="boolean",
65+
),
5966
ResolvedAttribute(
6067
public_alias="timestamp",
6168
internal_name="sentry.timestamp",
@@ -65,3 +72,23 @@
6572
),
6673
]
6774
}
75+
76+
PREPROD_SIZE_INTERNAL_TO_PUBLIC_ALIAS_MAPPINGS: dict[
77+
Literal["string", "number", "boolean"], dict[str, str]
78+
] = {
79+
"string": {
80+
definition.internal_name: definition.public_alias
81+
for definition in PREPROD_SIZE_ATTRIBUTE_DEFINITIONS.values()
82+
if not definition.secondary_alias and definition.search_type == "string"
83+
},
84+
"boolean": {
85+
definition.internal_name: definition.public_alias
86+
for definition in PREPROD_SIZE_ATTRIBUTE_DEFINITIONS.values()
87+
if not definition.secondary_alias and definition.search_type == "boolean"
88+
},
89+
"number": {
90+
definition.internal_name: definition.public_alias
91+
for definition in PREPROD_SIZE_ATTRIBUTE_DEFINITIONS.values()
92+
if not definition.secondary_alias and definition.search_type != "string"
93+
},
94+
}

src/sentry/search/eap/utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
OURLOG_ATTRIBUTE_DEFINITIONS,
1717
)
1818
from sentry.search.eap.ourlogs.definitions import OURLOG_DEFINITIONS
19+
from sentry.search.eap.preprod_size.attributes import (
20+
PREPROD_SIZE_INTERNAL_TO_PUBLIC_ALIAS_MAPPINGS,
21+
)
1922
from sentry.search.eap.profile_functions.attributes import (
2023
PROFILE_FUNCTIONS_ATTRIBUTE_DEFINITIONS,
2124
PROFILE_FUNCTIONS_INTERNAL_TO_PUBLIC_ALIAS_MAPPINGS,
@@ -69,6 +72,7 @@ def add_start_end_conditions(
6972
SupportedTraceItemType.LOGS: LOGS_INTERNAL_TO_PUBLIC_ALIAS_MAPPINGS,
7073
SupportedTraceItemType.TRACEMETRICS: TRACE_METRICS_INTERNAL_TO_PUBLIC_ALIAS_MAPPINGS,
7174
SupportedTraceItemType.PROFILE_FUNCTIONS: PROFILE_FUNCTIONS_INTERNAL_TO_PUBLIC_ALIAS_MAPPINGS,
75+
SupportedTraceItemType.PREPROD: PREPROD_SIZE_INTERNAL_TO_PUBLIC_ALIAS_MAPPINGS,
7276
}
7377

7478
PUBLIC_ALIAS_TO_INTERNAL_MAPPING: dict[SupportedTraceItemType, dict[str, ResolvedAttribute]] = {

0 commit comments

Comments
 (0)