eas-cli 24.13.0 → 25.0.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 +185 -166
- package/build/billing/resolveAccount.js +38 -14
- package/build/build/utils/url.d.ts +1 -0
- package/build/build/utils/url.js +4 -0
- package/build/commandUtils/EasCommand.js +11 -5
- package/build/commandUtils/context/contextUtils/getProjectIdAsync.js +1 -1
- package/build/commandUtils/new/configs.d.ts +2 -2
- package/build/commandUtils/new/configs.js +8 -20
- package/build/commands/account/view.d.ts +6 -1
- package/build/commands/account/view.js +38 -8
- package/build/commands/channel/protect.js +1 -1
- package/build/commands/channel/unprotect.js +1 -1
- package/build/commands/simulator/get.js +5 -2
- package/build/commands/simulator/index.d.ts +1 -0
- package/build/commands/simulator/index.js +10 -2
- package/build/commands/workflow/insights/maestro.d.ts +2 -0
- package/build/commands/workflow/insights/maestro.js +6 -0
- package/build/easSelect.d.ts +30 -0
- package/build/easSelect.js +57 -0
- package/build/graphql/generated.d.ts +344 -949
- package/build/graphql/generated.js +5 -74
- package/build/graphql/queries/AccountQuery.js +2 -1
- package/build/graphql/queries/DeviceRunSessionQuery.js +1 -0
- package/build/graphql/queries/WorkflowDeviceTestCaseInsightsQuery.js +11 -0
- package/build/graphql/types/Account.js +3 -2
- package/build/project/accountSelection.d.ts +2 -3
- package/build/project/accountSelection.js +12 -15
- package/build/project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync.js +4 -4
- package/build/project/projectInitialization.js +7 -6
- package/build/prompts.d.ts +2 -1
- package/build/prompts.js +2 -0
- package/build/simulator/utils.d.ts +8 -5
- package/build/simulator/utils.js +56 -20
- package/build/user/User.d.ts +17 -1
- package/build/user/User.js +37 -2
- package/build/user/roles.d.ts +6 -0
- package/build/user/roles.js +35 -0
- package/build/workflow/insights/formatMaestroInsights.d.ts +9 -2
- package/build/workflow/insights/formatMaestroInsights.js +24 -0
- package/build/workflow/insights/maestroFilters.d.ts +5 -3
- package/build/workflow/insights/maestroFilters.js +5 -0
- package/oclif.manifest.json +439 -422
- package/package.json +6 -6
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRoleForPermissions = getRoleForPermissions;
|
|
4
|
+
const generated_1 = require("../graphql/generated");
|
|
5
|
+
/**
|
|
6
|
+
* Derives a member's role from their exact permission set. Mirrors `getRoleForPermissions` in www
|
|
7
|
+
* (server/www/src/utils/roles.ts): any other combination is CUSTOM.
|
|
8
|
+
*/
|
|
9
|
+
function getRoleForPermissions(permissions) {
|
|
10
|
+
const canOwn = permissions.includes(generated_1.Permission.Own);
|
|
11
|
+
const canAdmin = permissions.includes(generated_1.Permission.Admin);
|
|
12
|
+
const canPublishProtected = permissions.includes(generated_1.Permission.PublishProtected);
|
|
13
|
+
const canPublish = permissions.includes(generated_1.Permission.Publish);
|
|
14
|
+
const canRun = permissions.includes(generated_1.Permission.Run);
|
|
15
|
+
const canView = permissions.includes(generated_1.Permission.View);
|
|
16
|
+
if (canOwn && canAdmin && canPublishProtected && canPublish && canRun && canView) {
|
|
17
|
+
return generated_1.Role.Owner;
|
|
18
|
+
}
|
|
19
|
+
else if (!canOwn && canAdmin && canPublishProtected && canPublish && canRun && canView) {
|
|
20
|
+
return generated_1.Role.Admin;
|
|
21
|
+
}
|
|
22
|
+
else if (!canOwn && !canAdmin && canPublishProtected && canPublish && canRun && canView) {
|
|
23
|
+
return generated_1.Role.ReleaseManager;
|
|
24
|
+
}
|
|
25
|
+
else if (!canOwn && !canAdmin && !canPublishProtected && canPublish && canRun && canView) {
|
|
26
|
+
return generated_1.Role.Developer;
|
|
27
|
+
}
|
|
28
|
+
else if (!canOwn && !canAdmin && !canPublishProtected && !canPublish && canRun && canView) {
|
|
29
|
+
return generated_1.Role.Runner;
|
|
30
|
+
}
|
|
31
|
+
else if (!canOwn && !canAdmin && !canPublishProtected && !canPublish && !canRun && canView) {
|
|
32
|
+
return generated_1.Role.ViewOnly;
|
|
33
|
+
}
|
|
34
|
+
return generated_1.Role.Custom;
|
|
35
|
+
}
|
|
@@ -1,15 +1,22 @@
|
|
|
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
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;
|
|
12
|
+
}
|
|
7
13
|
/** The Maestro tab's overview tiles. */
|
|
8
14
|
export interface MaestroInsightsTotals {
|
|
9
15
|
totalRuns: InsightsMetricSummary;
|
|
10
16
|
passRatePercent: InsightsMetricSummary;
|
|
11
17
|
distinctFlakyFlows: InsightsMetricSummary;
|
|
12
18
|
avgDurationMs: NullableMetricSummary;
|
|
19
|
+
platforms: MaestroPlatformTotals[];
|
|
13
20
|
}
|
|
14
21
|
/** The tiles of one flow's detail view, which shows no previous-period comparison. */
|
|
15
22
|
export interface MaestroFlowTotals {
|
|
@@ -69,7 +76,7 @@ export interface MaestroFlowHistorySummary extends InsightsTimespanFields {
|
|
|
69
76
|
appFullName: string;
|
|
70
77
|
flowPath: string;
|
|
71
78
|
granularity: WorkflowDeviceTestCaseInsightsTimeSeriesGranularity;
|
|
72
|
-
filters?: Pick<AppliedMaestroInsightsFilters, 'workflows' | 'gitRef'>;
|
|
79
|
+
filters?: Pick<AppliedMaestroInsightsFilters, 'workflows' | 'gitRef' | 'platforms'>;
|
|
73
80
|
totals: MaestroFlowTotals;
|
|
74
81
|
runsOverTime: MaestroInsightsBucket[];
|
|
75
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");
|
|
@@ -84,6 +85,11 @@ function toOverviewTotals(totals) {
|
|
|
84
85
|
},
|
|
85
86
|
distinctFlakyFlows: (0, metrics_1.toMetricSummary)(totals.distinctFlakyTestCount),
|
|
86
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
|
+
})),
|
|
87
93
|
};
|
|
88
94
|
}
|
|
89
95
|
function toFlowTotals(totals) {
|
|
@@ -142,6 +148,7 @@ function buildMaestroInsightsTable(summary) {
|
|
|
142
148
|
sections.push('');
|
|
143
149
|
sections.push(chalk_1.default.bold('Overview (compared with the previous period):'));
|
|
144
150
|
sections.push((0, formatFields_1.default)(buildOverviewTotalsFields(summary.totals)));
|
|
151
|
+
sections.push(...buildPlatformTotalsSection(summary.totals.platforms));
|
|
145
152
|
sections.push(...buildMaestroRunsOverTimeSection(summary.runsOverTime, summary.granularity));
|
|
146
153
|
sections.push('');
|
|
147
154
|
if (summary.flows.length === 0) {
|
|
@@ -208,6 +215,22 @@ function buildOverviewTotalsFields(totals) {
|
|
|
208
215
|
},
|
|
209
216
|
];
|
|
210
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
|
+
})),
|
|
232
|
+
];
|
|
233
|
+
}
|
|
211
234
|
function buildFlowTotalsFields(totals) {
|
|
212
235
|
return [
|
|
213
236
|
{ label: 'Maestro runs', value: totals.totalRuns.toLocaleString() },
|
|
@@ -270,6 +293,7 @@ function formatFilters(filters) {
|
|
|
270
293
|
['workflows', filters.workflows],
|
|
271
294
|
['statuses', filters.statuses],
|
|
272
295
|
['tags', filters.tags],
|
|
296
|
+
['platforms', filters.platforms?.map(platform => platform_1.appPlatformDisplayNames[platform])],
|
|
273
297
|
['search', filters.search],
|
|
274
298
|
['git ref', filters.gitRef],
|
|
275
299
|
]);
|
|
@@ -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
|
};
|