Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,30 @@ export function BuildDetailsMainContent(props: BuildDetailsMainContentProps) {
const missingDsymBinaries =
buildDetailsData?.app_info?.apple_app_info?.missing_dsym_binaries;

const missingProguardMapping =
buildDetailsData?.app_info?.android_app_info?.has_proguard_mapping === false;

const getAlertMessage = () => {
if (missingDsymBinaries && missingDsymBinaries.length > 0) {
if (missingDsymBinaries?.length === 1) {
return t(
'Missing debug symbols for some binaries (%s). Those binaries will not have a detailed breakdown.',
missingDsymBinaries[0]
);
}
return t(
'Missing debug symbols for some binaries (%s and others). Those binaries will not have a detailed breakdown.',
missingDsymBinaries[0]
);
}

if (missingProguardMapping) {
return t('Missing proguard mapping. Dex will not have a detailed breakdown.');
}

return undefined;
};

// Filter data based on search query and categories
const filteredRoot = filterTreemapElement(
appSizeData.treemap.root,
Expand All @@ -234,7 +258,7 @@ export function BuildDetailsMainContent(props: BuildDetailsMainContentProps) {
root={filteredTreemapData.root}
searchQuery={searchQuery || ''}
unfilteredRoot={appSizeData.treemap.root}
missingDsymBinaries={missingDsymBinaries}
alertMessage={getAlertMessage()}
onSearchChange={value => setSearchQuery(value || undefined)}
/>
) : (
Expand All @@ -249,7 +273,7 @@ export function BuildDetailsMainContent(props: BuildDetailsMainContentProps) {
root={filteredTreemapData.root}
searchQuery={searchQuery || ''}
unfilteredRoot={appSizeData.treemap.root}
missingDsymBinaries={missingDsymBinaries}
alertMessage={getAlertMessage()}
onSearchChange={value => setSearchQuery(value || undefined)}
/>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ import {filterTreemapElement} from 'sentry/views/preprod/utils/treemapFiltering'
interface AppSizeTreemapProps {
root: TreemapElement | null;
searchQuery: string;
missingDsymBinaries?: string[];
alertMessage?: string;
onSearchChange?: (query: string) => void;
unfilteredRoot?: TreemapElement;
}

function FullscreenModalContent({
unfilteredRoot,
initialSearch,
missingDsymBinaries,
alertMessage,
onSearchChange,
}: {
initialSearch: string;
unfilteredRoot: TreemapElement;
missingDsymBinaries?: string[];
alertMessage?: string;
onSearchChange?: (query: string) => void;
}) {
const [localSearch, setLocalSearch] = useState(initialSearch);
Expand Down Expand Up @@ -74,7 +74,7 @@ function FullscreenModalContent({
<AppSizeTreemap
root={filteredRoot}
searchQuery={localSearch}
missingDsymBinaries={missingDsymBinaries}
alertMessage={alertMessage}
/>
</Container>
</Flex>
Expand All @@ -83,7 +83,7 @@ function FullscreenModalContent({

export function AppSizeTreemap(props: AppSizeTreemapProps) {
const theme = useTheme();
const {root, searchQuery, unfilteredRoot, missingDsymBinaries, onSearchChange} = props;
const {root, searchQuery, unfilteredRoot, alertMessage, onSearchChange} = props;
const appSizeCategoryInfo = getAppSizeCategoryInfo(theme);
const renderingContext = useContext(ChartRenderingContext);
const isFullscreen = renderingContext?.isFullscreen ?? false;
Expand Down Expand Up @@ -314,24 +314,9 @@ export function AppSizeTreemap(props: AppSizeTreemapProps) {
},
};

const hasMissingDsyms = missingDsymBinaries && missingDsymBinaries.length > 0;

const getBinariesMessage = () => {
if (missingDsymBinaries?.length === 1) {
return t(
'Missing debug symbols for some binaries (%s). Those binaries will not have a detailed breakdown.',
missingDsymBinaries[0]
);
}
return t(
'Missing debug symbols for some binaries (%s and others). Those binaries will not have a detailed breakdown.',
missingDsymBinaries![0]
);
};

return (
<Flex direction="column" gap="sm" height="100%" width="100%">
{hasMissingDsyms && <Alert type="warning">{getBinariesMessage()}</Alert>}
{alertMessage && <Alert type="warning">{alertMessage}</Alert>}
<Container
height="100%"
width="100%"
Expand Down Expand Up @@ -379,15 +364,15 @@ export function AppSizeTreemap(props: AppSizeTreemapProps) {
<FullscreenModalContent
unfilteredRoot={unfilteredRoot}
initialSearch={searchQuery}
missingDsymBinaries={missingDsymBinaries}
alertMessage={alertMessage}
onSearchChange={onSearchChange}
/>
) : (
<Container height="100%" width="100%">
<AppSizeTreemap
root={root}
searchQuery={searchQuery}
missingDsymBinaries={missingDsymBinaries}
alertMessage={alertMessage}
/>
</Container>
),
Expand Down
5 changes: 5 additions & 0 deletions static/app/views/preprod/types/buildDetailsTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export interface BuildDetailsApiResponse {
}

export interface BuildDetailsAppInfo {
android_app_info?: AndroidAppInfo | null;
app_id?: string | null;
apple_app_info?: AppleAppInfo | null;
artifact_type?: BuildDetailsArtifactType | null;
Expand All @@ -26,6 +27,10 @@ interface AppleAppInfo {
missing_dsym_binaries?: string[];
}

interface AndroidAppInfo {
has_proguard_mapping?: boolean;
}

export interface BuildDetailsVcsInfo {
base_ref?: string | null;
base_repo_name?: string | null;
Expand Down
Loading