Skip to content

Commit 1d0f212

Browse files
cameroncookeclaude
andauthored
fix(preprod): Update default artifact type and label (#109194)
Change the default artifact type for new status check rules from `all_artifacts` to `main_artifact` and rename the `all_artifacts` display label from "All Artifact Types" to "Any Artifact Type" for clarity. - New rules now default to `main_artifact` instead of `all_artifacts` - Removed the unused `ALL_ARTIFACTS_ARTIFACT_TYPE` constant - Updated the label to better reflect matching semantics Refs LINEAR-EME-871 --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 54c4204 commit 1d0f212

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

static/app/views/settings/project/preprod/statusCheckRules.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {useRepositories} from 'sentry/utils/useRepositories';
2121
import {useProjectSettingsOutlet} from 'sentry/views/settings/project/projectSettingsLayout';
2222

2323
import {StatusCheckRuleItem} from './statusCheckRuleItem';
24+
import {DEFAULT_ARTIFACT_TYPE} from './types';
2425
import {useStatusCheckRules} from './useStatusCheckRules';
2526

2627
export function StatusCheckRules() {
@@ -127,7 +128,7 @@ export function StatusCheckRules() {
127128
project_slug: project.slug,
128129
metric: updated.metric,
129130
measurement: updated.measurement,
130-
artifact_type: updated.artifactType ?? 'all_artifacts',
131+
artifact_type: updated.artifactType ?? DEFAULT_ARTIFACT_TYPE,
131132
value: updated.value,
132133
});
133134
if (rule.id === newRuleId) {

static/app/views/settings/project/preprod/types.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import {t} from 'sentry/locale';
2+
13
const ALL_METRIC_TYPES = ['install_size', 'download_size'] as const;
24

35
type MetricType = (typeof ALL_METRIC_TYPES)[number];
@@ -17,7 +19,6 @@ export const ALL_ARTIFACT_TYPES = [
1719
export type ArtifactType = (typeof ALL_ARTIFACT_TYPES)[number];
1820

1921
export const DEFAULT_ARTIFACT_TYPE: ArtifactType = 'main_artifact';
20-
export const ALL_ARTIFACTS_ARTIFACT_TYPE: ArtifactType = 'all_artifacts';
2122

2223
export interface StatusCheckFilter {
2324
key: string;
@@ -37,8 +38,8 @@ export interface StatusCheckRule {
3738
export const DEFAULT_METRIC_TYPE: MetricType = 'install_size';
3839

3940
const METRIC_LABELS: Record<MetricType, string> = {
40-
install_size: 'Install/Uncompressed Size',
41-
download_size: 'Download Size',
41+
install_size: t('Install/Uncompressed Size'),
42+
download_size: t('Download Size'),
4243
};
4344

4445
export const METRIC_OPTIONS: Array<{label: string; value: MetricType}> =
@@ -50,9 +51,9 @@ export const METRIC_OPTIONS: Array<{label: string; value: MetricType}> =
5051
export const DEFAULT_MEASUREMENT_TYPE: MeasurementType = 'absolute';
5152

5253
const MEASUREMENT_LABELS: Record<MeasurementType, string> = {
53-
absolute: 'Absolute Size',
54-
absolute_diff: 'Absolute Diff',
55-
relative_diff: 'Relative Diff',
54+
absolute: t('Absolute Size'),
55+
absolute_diff: t('Absolute Diff'),
56+
relative_diff: t('Relative Diff'),
5657
};
5758

5859
export const MEASUREMENT_OPTIONS: Array<{label: string; value: MeasurementType}> =
@@ -62,11 +63,11 @@ export const MEASUREMENT_OPTIONS: Array<{label: string; value: MeasurementType}>
6263
}));
6364

6465
const ARTIFACT_TYPE_LABELS: Record<ArtifactType, string> = {
65-
all_artifacts: 'All Artifact Types',
66-
main_artifact: 'Main App',
67-
watch_artifact: 'Watch App',
68-
android_dynamic_feature_artifact: 'Android Dynamic Feature',
69-
app_clip_artifact: 'App Clip',
66+
all_artifacts: t('Any Artifact Type'),
67+
main_artifact: t('Main App'),
68+
watch_artifact: t('Watch App'),
69+
android_dynamic_feature_artifact: t('Android Dynamic Feature'),
70+
app_clip_artifact: t('App Clip'),
7071
};
7172

7273
export const ARTIFACT_TYPE_OPTIONS: Array<{label: string; value: ArtifactType}> =

static/app/views/settings/project/preprod/useStatusCheckRules.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {uniqueId} from 'sentry/utils/guid';
1111
import {useUpdateProject} from 'sentry/utils/project/useUpdateProject';
1212

1313
import {
14-
ALL_ARTIFACTS_ARTIFACT_TYPE,
14+
DEFAULT_ARTIFACT_TYPE,
1515
DEFAULT_MEASUREMENT_TYPE,
1616
DEFAULT_METRIC_TYPE,
1717
toArtifactType,
@@ -141,7 +141,7 @@ export function useStatusCheckRules(project: Project) {
141141
measurement: DEFAULT_MEASUREMENT,
142142
value: 0,
143143
filterQuery: '',
144-
artifactType: ALL_ARTIFACTS_ARTIFACT_TYPE,
144+
artifactType: DEFAULT_ARTIFACT_TYPE,
145145
};
146146
}, []);
147147

0 commit comments

Comments
 (0)