eas-cli 24.12.1 → 24.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +154 -152
- package/bin/run +8 -0
- package/build/build/runBuildAndSubmit.js +0 -1
- package/build/commands/channel/protect.js +1 -1
- package/build/commands/channel/unprotect.js +1 -1
- package/build/commands/workflow/insights/index.js +1 -1
- package/build/commands/workflow/insights/maestro.d.ts +2 -0
- package/build/commands/workflow/insights/maestro.js +6 -0
- package/build/credentials/ios/actions/AscApiKeyUtils.js +5 -5
- package/build/env.d.ts +0 -4
- package/build/env.js +0 -4
- package/build/graphql/generated.d.ts +156 -4
- package/build/graphql/generated.js +4 -0
- package/build/graphql/queries/WorkflowDeviceTestCaseInsightsQuery.js +11 -0
- package/build/graphql/queries/WorkflowsInsightsQuery.js +10 -0
- package/build/insights/metrics.d.ts +11 -0
- package/build/insights/metrics.js +14 -0
- package/build/project/projectUtils.d.ts +0 -1
- package/build/project/projectUtils.js +0 -13
- package/build/workflow/insights/formatInsights.d.ts +5 -1
- package/build/workflow/insights/formatInsights.js +36 -1
- package/build/workflow/insights/formatMaestroInsights.d.ts +9 -7
- package/build/workflow/insights/formatMaestroInsights.js +31 -14
- package/build/workflow/insights/maestroFilters.d.ts +5 -3
- package/build/workflow/insights/maestroFilters.js +5 -0
- package/oclif.manifest.json +156 -145
- package/package.json +9 -9
|
@@ -16,7 +16,6 @@ export declare function isExpoUpdatesInstalledAsDevDependency(projectDir: string
|
|
|
16
16
|
export declare function isExpoUpdatesInstalledOrAvailable(projectDir: string, sdkVersion?: string): boolean;
|
|
17
17
|
export declare function isUsingEASUpdate(exp: ExpoConfig, projectId: string, manifestHostOverride: string | null): boolean;
|
|
18
18
|
export declare function getExpoUpdatesPackageVersionIfInstalledAsync(projectDir: string): Promise<string | null>;
|
|
19
|
-
export declare function validateAppVersionRuntimePolicySupportAsync(projectDir: string, exp: ExpoConfig): Promise<void>;
|
|
20
19
|
export declare function enforceRollBackToEmbeddedUpdateSupportAsync(projectDir: string): Promise<void>;
|
|
21
20
|
export declare function isModernExpoUpdatesCLIWithRuntimeVersionCommandSupportedAsync(projectDir: string): Promise<boolean>;
|
|
22
21
|
export declare function installExpoUpdatesAsync(projectDir: string, options?: {
|
|
@@ -8,7 +8,6 @@ exports.isExpoUpdatesInstalledAsDevDependency = isExpoUpdatesInstalledAsDevDepen
|
|
|
8
8
|
exports.isExpoUpdatesInstalledOrAvailable = isExpoUpdatesInstalledOrAvailable;
|
|
9
9
|
exports.isUsingEASUpdate = isUsingEASUpdate;
|
|
10
10
|
exports.getExpoUpdatesPackageVersionIfInstalledAsync = getExpoUpdatesPackageVersionIfInstalledAsync;
|
|
11
|
-
exports.validateAppVersionRuntimePolicySupportAsync = validateAppVersionRuntimePolicySupportAsync;
|
|
12
11
|
exports.enforceRollBackToEmbeddedUpdateSupportAsync = enforceRollBackToEmbeddedUpdateSupportAsync;
|
|
13
12
|
exports.isModernExpoUpdatesCLIWithRuntimeVersionCommandSupportedAsync = isModernExpoUpdatesCLIWithRuntimeVersionCommandSupportedAsync;
|
|
14
13
|
exports.installExpoUpdatesAsync = installExpoUpdatesAsync;
|
|
@@ -98,18 +97,6 @@ async function getExpoUpdatesPackageVersionIfInstalledAsync(projectDir) {
|
|
|
98
97
|
const { version } = await fs_extra_1.default.readJson(maybePackageJson);
|
|
99
98
|
return version ?? null;
|
|
100
99
|
}
|
|
101
|
-
async function validateAppVersionRuntimePolicySupportAsync(projectDir, exp) {
|
|
102
|
-
if (typeof exp.runtimeVersion !== 'object' || exp.runtimeVersion?.policy !== 'appVersion') {
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
const expoUpdatesPackageVersion = await getExpoUpdatesPackageVersionIfInstalledAsync(projectDir);
|
|
106
|
-
if (expoUpdatesPackageVersion !== null &&
|
|
107
|
-
(semver_1.default.gte(expoUpdatesPackageVersion, '0.14.4') ||
|
|
108
|
-
expoUpdatesPackageVersion.includes('canary'))) {
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
log_1.default.warn(`You need to be on SDK 46 or higher, and use expo-updates >= 0.14.4 to use appVersion runtime policy.`);
|
|
112
|
-
}
|
|
113
100
|
async function enforceRollBackToEmbeddedUpdateSupportAsync(projectDir) {
|
|
114
101
|
const expoUpdatesPackageVersion = await getExpoUpdatesPackageVersionIfInstalledAsync(projectDir);
|
|
115
102
|
if (expoUpdatesPackageVersion !== null &&
|
|
@@ -2,7 +2,7 @@ import { WorkflowsInsightsRunsOverTimeGranularity } from '../../graphql/generate
|
|
|
2
2
|
import { AppWithWorkflowsInsightsObject } from '../../graphql/queries/WorkflowsInsightsQuery';
|
|
3
3
|
import { InsightsTimespanFields } from '../../insights/formatTimespan';
|
|
4
4
|
import { AppliedWorkflowsInsightsFilters } from './filters';
|
|
5
|
-
import { InsightsMetricSummary } from '../../insights/metrics';
|
|
5
|
+
import { InsightsMetricSummary, NullableMetricSummary } from '../../insights/metrics';
|
|
6
6
|
export interface WorkflowsInsightsBucket {
|
|
7
7
|
start: string;
|
|
8
8
|
totalRuns: number;
|
|
@@ -19,6 +19,8 @@ export interface WorkflowsInsightsWorkflowSummary {
|
|
|
19
19
|
failedRuns: number;
|
|
20
20
|
canceledRuns: number;
|
|
21
21
|
successRatePercent: number;
|
|
22
|
+
avgDurationMs: number | null;
|
|
23
|
+
p75DurationMs: number | null;
|
|
22
24
|
lastRunAt: string;
|
|
23
25
|
}
|
|
24
26
|
export interface WorkflowsInsightsSummary extends InsightsTimespanFields {
|
|
@@ -30,6 +32,8 @@ export interface WorkflowsInsightsSummary extends InsightsTimespanFields {
|
|
|
30
32
|
successRatePercent: InsightsMetricSummary;
|
|
31
33
|
activeWorkflows: InsightsMetricSummary;
|
|
32
34
|
failedRuns: InsightsMetricSummary;
|
|
35
|
+
avgDurationMs: NullableMetricSummary;
|
|
36
|
+
p75DurationMs: NullableMetricSummary;
|
|
33
37
|
};
|
|
34
38
|
runsOverTime: WorkflowsInsightsBucket[];
|
|
35
39
|
workflows: WorkflowsInsightsWorkflowSummary[];
|
|
@@ -11,6 +11,7 @@ const formatTimespan_1 = require("../../insights/formatTimespan");
|
|
|
11
11
|
const formatFilters_1 = require("../../insights/formatFilters");
|
|
12
12
|
const formatFields_1 = tslib_1.__importDefault(require("../../utils/formatFields"));
|
|
13
13
|
const renderTextTable_1 = tslib_1.__importDefault(require("../../utils/renderTextTable"));
|
|
14
|
+
const timer_1 = require("../../utils/timer");
|
|
14
15
|
const metrics_1 = require("../../insights/metrics");
|
|
15
16
|
// Dataset ids assigned by the server's `runsOverTime` resolver.
|
|
16
17
|
const RUNS_OVER_TIME_DATASET_IDS = {
|
|
@@ -37,6 +38,8 @@ function toWorkflowsInsightsSummary(app, { timespan, granularity, filters, }) {
|
|
|
37
38
|
},
|
|
38
39
|
activeWorkflows: (0, metrics_1.toMetricSummary)(overviewMetrics.activeWorkflows),
|
|
39
40
|
failedRuns: (0, metrics_1.toMetricSummary)(overviewMetrics.failedRuns),
|
|
41
|
+
avgDurationMs: (0, metrics_1.toNullableMetricSummary)(overviewMetrics.avgDurationMs),
|
|
42
|
+
p75DurationMs: (0, metrics_1.toNullableMetricSummary)(overviewMetrics.p75DurationMs),
|
|
40
43
|
},
|
|
41
44
|
runsOverTime: toBuckets(runsOverTime.lineChart),
|
|
42
45
|
workflows: workflows.edges.map(({ node }) => ({
|
|
@@ -48,6 +51,8 @@ function toWorkflowsInsightsSummary(app, { timespan, granularity, filters, }) {
|
|
|
48
51
|
failedRuns: node.failedRuns,
|
|
49
52
|
canceledRuns: node.canceledRuns,
|
|
50
53
|
successRatePercent: (0, metrics_1.ratePercent)(node.successfulRuns, node.totalRuns),
|
|
54
|
+
avgDurationMs: node.avgDurationMs ?? null,
|
|
55
|
+
p75DurationMs: node.p75DurationMs ?? null,
|
|
51
56
|
lastRunAt: node.lastRunAt,
|
|
52
57
|
})),
|
|
53
58
|
hasMoreWorkflows: workflows.pageInfo.hasNextPage,
|
|
@@ -109,6 +114,18 @@ function buildWorkflowsInsightsTable(summary) {
|
|
|
109
114
|
label: 'Failed runs',
|
|
110
115
|
value: (0, metrics_1.formatCountWithTrend)(overview.failedRuns, { lowerIsBetter: true }),
|
|
111
116
|
},
|
|
117
|
+
{
|
|
118
|
+
label: 'Avg duration',
|
|
119
|
+
value: (0, metrics_1.formatNullableMetricWithTrend)(overview.avgDurationMs, formatRunDuration, {
|
|
120
|
+
lowerIsBetter: true,
|
|
121
|
+
}),
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
label: 'P75 duration',
|
|
125
|
+
value: (0, metrics_1.formatNullableMetricWithTrend)(overview.p75DurationMs, formatRunDuration, {
|
|
126
|
+
lowerIsBetter: true,
|
|
127
|
+
}),
|
|
128
|
+
},
|
|
112
129
|
]));
|
|
113
130
|
sections.push(...(0, formatRunsOverTime_1.buildRunsOverTimeSection)(summary.runsOverTime, summary.granularity, {
|
|
114
131
|
runs: bucket => bucket.totalRuns,
|
|
@@ -143,13 +160,31 @@ function formatFilters(filters) {
|
|
|
143
160
|
]);
|
|
144
161
|
}
|
|
145
162
|
function renderWorkflowsTable(workflows) {
|
|
146
|
-
return (0, renderTextTable_1.default)([
|
|
163
|
+
return (0, renderTextTable_1.default)([
|
|
164
|
+
'Workflow',
|
|
165
|
+
'Runs',
|
|
166
|
+
'Successful',
|
|
167
|
+
'Failed',
|
|
168
|
+
'Canceled',
|
|
169
|
+
'Success rate',
|
|
170
|
+
'Avg duration',
|
|
171
|
+
'P75 duration',
|
|
172
|
+
'Last run',
|
|
173
|
+
], workflows.map(workflow => [
|
|
147
174
|
workflow.fileName,
|
|
148
175
|
workflow.totalRuns.toLocaleString(),
|
|
149
176
|
workflow.successfulRuns.toLocaleString(),
|
|
150
177
|
workflow.failedRuns.toLocaleString(),
|
|
151
178
|
workflow.canceledRuns.toLocaleString(),
|
|
152
179
|
(0, metrics_1.formatPercent)(workflow.successRatePercent),
|
|
180
|
+
formatRunDuration(workflow.avgDurationMs),
|
|
181
|
+
formatRunDuration(workflow.p75DurationMs),
|
|
153
182
|
(0, formatTimespan_1.toDateTime)(workflow.lastRunAt),
|
|
154
183
|
]));
|
|
155
184
|
}
|
|
185
|
+
function formatRunDuration(ms) {
|
|
186
|
+
if (ms === null) {
|
|
187
|
+
return 'n/a';
|
|
188
|
+
}
|
|
189
|
+
return ms < 1000 ? `${Math.round(ms)}ms` : (0, timer_1.formatMilliseconds)(ms);
|
|
190
|
+
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { WorkflowDeviceTestCaseInsightsTimeSeriesGranularity, WorkflowDeviceTestCaseStatus } from '../../graphql/generated';
|
|
1
|
+
import { AppPlatform, WorkflowDeviceTestCaseInsightsTimeSeriesGranularity, WorkflowDeviceTestCaseStatus } from '../../graphql/generated';
|
|
2
2
|
import { AppWithMaestroFlowHistoryObject, AppWithMaestroInsightsObject } from '../../graphql/queries/WorkflowDeviceTestCaseInsightsQuery';
|
|
3
3
|
import { InsightsTimespanFields } from '../../insights/formatTimespan';
|
|
4
4
|
import { AppliedMaestroInsightsFilters } from './maestroFilters';
|
|
5
5
|
import { MaestroSortDirection, MaestroSortOption } from './maestroSort';
|
|
6
|
-
import { InsightsMetricSummary } from '../../insights/metrics';
|
|
7
|
-
/**
|
|
8
|
-
export interface
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
import { InsightsMetricSummary, NullableMetricSummary } from '../../insights/metrics';
|
|
7
|
+
/** Runs on one platform; `platform` is null for runs whose platform is not recorded. */
|
|
8
|
+
export interface MaestroPlatformTotals {
|
|
9
|
+
platform: AppPlatform | null;
|
|
10
|
+
totalRuns: InsightsMetricSummary;
|
|
11
|
+
distinctFlows: InsightsMetricSummary;
|
|
11
12
|
}
|
|
12
13
|
/** The Maestro tab's overview tiles. */
|
|
13
14
|
export interface MaestroInsightsTotals {
|
|
@@ -15,6 +16,7 @@ export interface MaestroInsightsTotals {
|
|
|
15
16
|
passRatePercent: InsightsMetricSummary;
|
|
16
17
|
distinctFlakyFlows: InsightsMetricSummary;
|
|
17
18
|
avgDurationMs: NullableMetricSummary;
|
|
19
|
+
platforms: MaestroPlatformTotals[];
|
|
18
20
|
}
|
|
19
21
|
/** The tiles of one flow's detail view, which shows no previous-period comparison. */
|
|
20
22
|
export interface MaestroFlowTotals {
|
|
@@ -74,7 +76,7 @@ export interface MaestroFlowHistorySummary extends InsightsTimespanFields {
|
|
|
74
76
|
appFullName: string;
|
|
75
77
|
flowPath: string;
|
|
76
78
|
granularity: WorkflowDeviceTestCaseInsightsTimeSeriesGranularity;
|
|
77
|
-
filters?: Pick<AppliedMaestroInsightsFilters, 'workflows' | 'gitRef'>;
|
|
79
|
+
filters?: Pick<AppliedMaestroInsightsFilters, 'workflows' | 'gitRef' | 'platforms'>;
|
|
78
80
|
totals: MaestroFlowTotals;
|
|
79
81
|
runsOverTime: MaestroInsightsBucket[];
|
|
80
82
|
errorPatterns: MaestroErrorPatternSummary[];
|
|
@@ -13,6 +13,7 @@ const indent_string_1 = tslib_1.__importDefault(require("indent-string"));
|
|
|
13
13
|
const formatRunsOverTime_1 = require("../../insights/formatRunsOverTime");
|
|
14
14
|
const formatTimespan_1 = require("../../insights/formatTimespan");
|
|
15
15
|
const formatFilters_1 = require("../../insights/formatFilters");
|
|
16
|
+
const platform_1 = require("../../platform");
|
|
16
17
|
const formatFields_1 = tslib_1.__importDefault(require("../../utils/formatFields"));
|
|
17
18
|
const renderTextTable_1 = tslib_1.__importDefault(require("../../utils/renderTextTable"));
|
|
18
19
|
const terminalText_1 = require("../../utils/terminalText");
|
|
@@ -83,10 +84,12 @@ function toOverviewTotals(totals) {
|
|
|
83
84
|
previous: (0, metrics_1.ratePercent)(passedClean.previous + flaky.previous, totalRuns.previous),
|
|
84
85
|
},
|
|
85
86
|
distinctFlakyFlows: (0, metrics_1.toMetricSummary)(totals.distinctFlakyTestCount),
|
|
86
|
-
avgDurationMs:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
avgDurationMs: (0, metrics_1.toNullableMetricSummary)(totals.avgDurationMs),
|
|
88
|
+
platforms: totals.platforms.map(entry => ({
|
|
89
|
+
platform: entry.platform ?? null,
|
|
90
|
+
totalRuns: (0, metrics_1.toMetricSummary)(entry.totalRuns),
|
|
91
|
+
distinctFlows: (0, metrics_1.toMetricSummary)(entry.distinctTestCount),
|
|
92
|
+
})),
|
|
90
93
|
};
|
|
91
94
|
}
|
|
92
95
|
function toFlowTotals(totals) {
|
|
@@ -145,6 +148,7 @@ function buildMaestroInsightsTable(summary) {
|
|
|
145
148
|
sections.push('');
|
|
146
149
|
sections.push(chalk_1.default.bold('Overview (compared with the previous period):'));
|
|
147
150
|
sections.push((0, formatFields_1.default)(buildOverviewTotalsFields(summary.totals)));
|
|
151
|
+
sections.push(...buildPlatformTotalsSection(summary.totals.platforms));
|
|
148
152
|
sections.push(...buildMaestroRunsOverTimeSection(summary.runsOverTime, summary.granularity));
|
|
149
153
|
sections.push('');
|
|
150
154
|
if (summary.flows.length === 0) {
|
|
@@ -203,7 +207,28 @@ function buildOverviewTotalsFields(totals) {
|
|
|
203
207
|
label: 'Flaky flows',
|
|
204
208
|
value: (0, metrics_1.formatCountWithTrend)(totals.distinctFlakyFlows, { lowerIsBetter: true }),
|
|
205
209
|
},
|
|
206
|
-
{
|
|
210
|
+
{
|
|
211
|
+
label: 'Avg duration',
|
|
212
|
+
value: (0, metrics_1.formatNullableMetricWithTrend)(totals.avgDurationMs, formatDurationMs, {
|
|
213
|
+
lowerIsBetter: true,
|
|
214
|
+
}),
|
|
215
|
+
},
|
|
216
|
+
];
|
|
217
|
+
}
|
|
218
|
+
function buildPlatformTotalsSection(platforms) {
|
|
219
|
+
if (platforms.length === 0) {
|
|
220
|
+
return [];
|
|
221
|
+
}
|
|
222
|
+
return [
|
|
223
|
+
'',
|
|
224
|
+
chalk_1.default.bold('By platform (compared with the previous period):'),
|
|
225
|
+
(0, formatFields_1.default)(platforms.flatMap(entry => {
|
|
226
|
+
const name = entry.platform === null ? 'Unknown' : platform_1.appPlatformDisplayNames[entry.platform];
|
|
227
|
+
return [
|
|
228
|
+
{ label: `${name} runs`, value: (0, metrics_1.formatCountWithTrend)(entry.totalRuns) },
|
|
229
|
+
{ label: `${name} flows`, value: (0, metrics_1.formatCountWithTrend)(entry.distinctFlows) },
|
|
230
|
+
];
|
|
231
|
+
})),
|
|
207
232
|
];
|
|
208
233
|
}
|
|
209
234
|
function buildFlowTotalsFields(totals) {
|
|
@@ -268,6 +293,7 @@ function formatFilters(filters) {
|
|
|
268
293
|
['workflows', filters.workflows],
|
|
269
294
|
['statuses', filters.statuses],
|
|
270
295
|
['tags', filters.tags],
|
|
296
|
+
['platforms', filters.platforms?.map(platform => platform_1.appPlatformDisplayNames[platform])],
|
|
271
297
|
['search', filters.search],
|
|
272
298
|
['git ref', filters.gitRef],
|
|
273
299
|
]);
|
|
@@ -287,12 +313,3 @@ function formatDurationMs(ms) {
|
|
|
287
313
|
}
|
|
288
314
|
return `${(ms / 1000).toFixed(1)}s`;
|
|
289
315
|
}
|
|
290
|
-
function formatDurationWithTrend(metric) {
|
|
291
|
-
if (metric.current === null) {
|
|
292
|
-
return chalk_1.default.dim('n/a');
|
|
293
|
-
}
|
|
294
|
-
const trend = metric.previous === null
|
|
295
|
-
? chalk_1.default.dim('n/a')
|
|
296
|
-
: (0, metrics_1.formatTrend)({ current: metric.current, previous: metric.previous }, { lowerIsBetter: true });
|
|
297
|
-
return `${formatDurationMs(metric.current)} (${trend})`;
|
|
298
|
-
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { Platform } from '@expo/eas-build-job';
|
|
1
2
|
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
-
import { WorkflowDeviceTestCaseHistoryFiltersInput, WorkflowDeviceTestCaseInsightsFiltersInput } from '../../graphql/generated';
|
|
3
|
+
import { AppPlatform, WorkflowDeviceTestCaseHistoryFiltersInput, WorkflowDeviceTestCaseInsightsFiltersInput } from '../../graphql/generated';
|
|
3
4
|
/** Statuses as the dashboard names them; `PASSED` means passed on the first attempt. */
|
|
4
5
|
export declare const MAESTRO_STATUS_OPTIONS: readonly ["PASSED", "FLAKY", "FAILED"];
|
|
5
6
|
export type MaestroStatusOption = (typeof MAESTRO_STATUS_OPTIONS)[number];
|
|
@@ -7,17 +8,18 @@ export interface MaestroInsightsFilterFlags {
|
|
|
7
8
|
workflow?: string[];
|
|
8
9
|
status?: MaestroStatusOption[];
|
|
9
10
|
tag?: string[];
|
|
11
|
+
platform?: Platform[];
|
|
10
12
|
search?: string;
|
|
11
13
|
'git-ref'?: string;
|
|
12
14
|
}
|
|
13
|
-
/** The filters as the user typed them, before workflow file names are resolved to IDs. */
|
|
14
15
|
export interface AppliedMaestroInsightsFilters {
|
|
15
16
|
workflows?: string[];
|
|
16
17
|
statuses?: MaestroStatusOption[];
|
|
17
18
|
tags?: string[];
|
|
19
|
+
platforms?: AppPlatform[];
|
|
18
20
|
search?: string;
|
|
19
21
|
gitRef?: string;
|
|
20
22
|
}
|
|
21
|
-
export declare function resolveMaestroHistoryFiltersInputAsync(graphqlClient: ExpoGraphqlClient, appId: string, flags: Pick<MaestroInsightsFilterFlags, 'workflow' | 'git-ref'>): Promise<WorkflowDeviceTestCaseHistoryFiltersInput | undefined>;
|
|
23
|
+
export declare function resolveMaestroHistoryFiltersInputAsync(graphqlClient: ExpoGraphqlClient, appId: string, flags: Pick<MaestroInsightsFilterFlags, 'workflow' | 'git-ref' | 'platform'>): Promise<WorkflowDeviceTestCaseHistoryFiltersInput | undefined>;
|
|
22
24
|
export declare function resolveMaestroInsightsFiltersInputAsync(graphqlClient: ExpoGraphqlClient, appId: string, flags: MaestroInsightsFilterFlags): Promise<WorkflowDeviceTestCaseInsightsFiltersInput | undefined>;
|
|
23
25
|
export declare function getAppliedMaestroInsightsFilters(flags: MaestroInsightsFilterFlags): AppliedMaestroInsightsFilters | undefined;
|
|
@@ -5,6 +5,7 @@ exports.resolveMaestroHistoryFiltersInputAsync = resolveMaestroHistoryFiltersInp
|
|
|
5
5
|
exports.resolveMaestroInsightsFiltersInputAsync = resolveMaestroInsightsFiltersInputAsync;
|
|
6
6
|
exports.getAppliedMaestroInsightsFilters = getAppliedMaestroInsightsFilters;
|
|
7
7
|
const generated_1 = require("../../graphql/generated");
|
|
8
|
+
const AppPlatform_1 = require("../../graphql/types/AppPlatform");
|
|
8
9
|
const filters_1 = require("./filters");
|
|
9
10
|
/** Statuses as the dashboard names them; `PASSED` means passed on the first attempt. */
|
|
10
11
|
exports.MAESTRO_STATUS_OPTIONS = ['PASSED', 'FLAKY', 'FAILED'];
|
|
@@ -21,6 +22,9 @@ async function resolveMaestroHistoryFiltersInputAsync(graphqlClient, appId, flag
|
|
|
21
22
|
if (flags['git-ref']) {
|
|
22
23
|
input.gitRefs = [(0, filters_1.normalizeGitRef)(flags['git-ref'])];
|
|
23
24
|
}
|
|
25
|
+
if (flags.platform?.length) {
|
|
26
|
+
input.platforms = flags.platform.map(AppPlatform_1.toAppPlatform);
|
|
27
|
+
}
|
|
24
28
|
return Object.keys(input).length === 0 ? undefined : input;
|
|
25
29
|
}
|
|
26
30
|
async function resolveMaestroInsightsFiltersInputAsync(graphqlClient, appId, flags) {
|
|
@@ -40,6 +44,7 @@ function getAppliedMaestroInsightsFilters(flags) {
|
|
|
40
44
|
...(flags.workflow?.length ? { workflows: flags.workflow } : {}),
|
|
41
45
|
...(flags.status?.length ? { statuses: flags.status } : {}),
|
|
42
46
|
...(flags.tag?.length ? { tags: flags.tag } : {}),
|
|
47
|
+
...(flags.platform?.length ? { platforms: flags.platform.map(AppPlatform_1.toAppPlatform) } : {}),
|
|
43
48
|
...(flags.search ? { search: flags.search } : {}),
|
|
44
49
|
...(flags['git-ref'] ? { gitRef: (0, filters_1.normalizeGitRef)(flags['git-ref']) } : {}),
|
|
45
50
|
};
|