File tree Expand file tree Collapse file tree 5 files changed +24
-13
lines changed
buildDetails/main/insights Expand file tree Collapse file tree 5 files changed +24
-13
lines changed Original file line number Diff line number Diff line change 1- import { AppleInsightResultsFixture } from 'sentry-fixture/preProdAppSize' ;
1+ import { InsightResultsFixture } from 'sentry-fixture/preProdAppSize' ;
22
33import { render , screen , userEvent } from 'sentry-test/reactTestingLibrary' ;
44
@@ -9,7 +9,7 @@ import {AppSizeInsights} from './appSizeInsights';
99describe ( 'AppSizeInsights' , ( ) => {
1010 const getDefaultProps = ( ) => {
1111 const totalSize = 10240000 ;
12- const insights = AppleInsightResultsFixture ( ) ;
12+ const insights = InsightResultsFixture ( ) ;
1313 return {
1414 processedInsights : processInsights ( insights , totalSize ) ,
1515 totalSize,
@@ -24,7 +24,7 @@ describe('AppSizeInsights', () => {
2424 } ) ;
2525
2626 it ( 'displays only top 5 insights in the main view' , ( ) => {
27- const manyInsights = AppleInsightResultsFixture ( {
27+ const manyInsights = InsightResultsFixture ( {
2828 image_optimization : {
2929 total_savings : 600000 ,
3030 optimizable_files : [
Original file line number Diff line number Diff line change 1- import { AppleInsightResultsFixture } from 'sentry-fixture/preProdAppSize' ;
1+ import { InsightResultsFixture } from 'sentry-fixture/preProdAppSize' ;
22
33import { render , screen , userEvent } from 'sentry-test/reactTestingLibrary' ;
44
@@ -8,7 +8,7 @@ import {AppSizeInsightsSidebar} from './appSizeInsightsSidebar';
88
99describe ( 'AppSizeInsightsSidebar' , ( ) => {
1010 const getDefaultProps = ( ) => {
11- const insights = AppleInsightResultsFixture ( {
11+ const insights = InsightResultsFixture ( {
1212 large_images : {
1313 total_savings : 128000 ,
1414 files : [
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import type {BuildDetailsApiResponse} from 'sentry/views/preprod/types/buildDeta
77export interface AppSizeApiResponse {
88 generated_at : string ;
99 treemap : TreemapResults ;
10- insights ?: AppleInsightResults ;
10+ insights ?: InsightResults ;
1111 missing_dsym_binaries ?: string [ ] ;
1212}
1313
@@ -189,7 +189,9 @@ interface AudioCompressionInsightResult extends FilesInsightResult {}
189189
190190interface VideoCompressionInsightResult extends FilesInsightResult { }
191191
192- export interface AppleInsightResults {
192+ interface MultipleNativeLibraryArchsInsightResult extends FilesInsightResult { }
193+
194+ export interface InsightResults {
193195 alternate_icons_optimization ?: ImageOptimizationInsightResult ;
194196 audio_compression ?: AudioCompressionInsightResult ;
195197 duplicate_files ?: DuplicateFilesInsightResult ;
@@ -202,6 +204,7 @@ export interface AppleInsightResults {
202204 localized_strings_minify ?: LocalizedStringCommentsInsightResult ;
203205 loose_images ?: LooseImagesInsightResult ;
204206 main_binary_exported_symbols ?: MainBinaryExportMetadataResult ;
207+ multiple_native_library_archs ?: MultipleNativeLibraryArchsInsightResult ;
205208 small_files ?: SmallFilesInsightResult ;
206209 strip_binary ?: StripBinaryInsightResult ;
207210 unnecessary_files ?: UnnecessaryFilesInsightResult ;
Original file line number Diff line number Diff line change 11import { t } from 'sentry/locale' ;
22import type {
3- AppleInsightResults ,
43 FileSavingsResult ,
54 FileSavingsResultGroup ,
65 FilesInsightResult ,
76 GroupsInsightResult ,
7+ InsightResults ,
88 OptimizableImageFile ,
99 StripBinaryFileInfo ,
1010} from 'sentry/views/preprod/types/appSizeTypes' ;
@@ -131,6 +131,13 @@ const INSIGHT_CONFIGS: InsightConfig[] = [
131131 "Alternate icons don't need full size quality because they are only shown downscaled in the homescreen."
132132 ) ,
133133 } ,
134+ {
135+ key : 'multiple_native_library_archs' ,
136+ name : t ( 'Multiple native library architectures' ) ,
137+ description : t (
138+ 'Only one native library architecture is needed. Non-arm64 architectures can be removed.'
139+ ) ,
140+ } ,
134141] ;
135142
136143function markDuplicateImageVariants ( processedInsights : ProcessedInsight [ ] ) : void {
@@ -163,7 +170,7 @@ function markDuplicateImageVariants(processedInsights: ProcessedInsight[]): void
163170 * Process all insights into a standardized format for display
164171 */
165172export function processInsights (
166- insights : AppleInsightResults ,
173+ insights : InsightResults ,
167174 totalSize : number
168175) : ProcessedInsight [ ] {
169176 const processedInsights : ProcessedInsight [ ] = [ ] ;
@@ -326,6 +333,7 @@ export function processInsights(
326333 'hermes_debug_info' ,
327334 'audio_compression' ,
328335 'video_compression' ,
336+ 'multiple_native_library_archs' ,
329337 ] as const ;
330338
331339 regularInsightKeys . forEach ( key => {
Original file line number Diff line number Diff line change 1- import type { AppleInsightResults } from 'sentry/views/preprod/types/appSizeTypes' ;
1+ import type { InsightResults } from 'sentry/views/preprod/types/appSizeTypes' ;
22import type { ProcessedInsight } from 'sentry/views/preprod/utils/insightProcessing' ;
33
44export function ProcessedInsightFixture (
@@ -61,9 +61,9 @@ export function ProcessedInsightFixture(
6161 } ;
6262}
6363
64- export function AppleInsightResultsFixture (
65- params : Partial < AppleInsightResults > = { }
66- ) : AppleInsightResults {
64+ export function InsightResultsFixture (
65+ params : Partial < InsightResults > = { }
66+ ) : InsightResults {
6767 return {
6868 duplicate_files : {
6969 total_savings : 768000 ,
You can’t perform that action at this time.
0 commit comments