mirror of
https://github.com/expo/eas-cli.git
synced 2026-11-23 16:00:26 -10:00
Compare commits
113
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e9cc46c1d9 | ||
|
|
50d0cd6178 | ||
|
|
695a9f9965 | ||
|
|
796f5bebb0 | ||
|
|
a12b70a2b0 | ||
|
|
4adc983647 | ||
|
|
c21f24158d | ||
|
|
523d7dd3cc | ||
|
|
3cbea341f3 | ||
|
|
30b1018d30 | ||
|
|
7da86ccab4 | ||
|
|
74c9eae5f6 | ||
|
|
218fc0280b | ||
|
|
c4beb8d1d9 | ||
|
|
8706252ab9 | ||
|
|
f5a1ab7eb5 | ||
|
|
36e5808521 | ||
|
|
bd6af12110 | ||
|
|
5287f2a60e | ||
|
|
f6a411eb7d | ||
|
|
03f9690d4f | ||
|
|
aecc6e5a0b | ||
|
|
c04843393f | ||
|
|
83cbfeb132 | ||
|
|
08dc6c48f9 | ||
|
|
86b68eb790 | ||
|
|
60b08403c2 | ||
|
|
497cb86e8e | ||
|
|
d4e7848353 | ||
|
|
1d8033904e | ||
|
|
505e91d2f3 | ||
|
|
e8a6a2149e | ||
|
|
c2564f520c | ||
|
|
a064599d97 | ||
|
|
b9989b2168 | ||
|
|
591e88bb3f | ||
|
|
7159c9b123 | ||
|
|
66b2726108 | ||
|
|
6247180a10 | ||
|
|
3dcef3ae5a | ||
|
|
4f05b96052 | ||
|
|
1de4c20d3f | ||
|
|
47e2ead086 | ||
|
|
05226eb77c | ||
|
|
f109a9798f | ||
|
|
d6db6f6ec6 | ||
|
|
9eeb2de7c5 | ||
|
|
9c7be9ab93 | ||
|
|
b7d6856183 | ||
|
|
d3ec4feada | ||
|
|
e731ac8f18 | ||
|
|
35d5409cc2 | ||
|
|
6a39e1b5ee | ||
|
|
d63cb6db75 | ||
|
|
d5a939572b | ||
|
|
9ba08884f3 | ||
|
|
8e1d9ad87c | ||
|
|
fb8a87ecd6 | ||
|
|
181a902986 | ||
|
|
fde3ff8bd9 | ||
|
|
8039db75fb | ||
|
|
5f2fdf4314 | ||
|
|
e911ad6924 | ||
|
|
be61a921eb | ||
|
|
69a3a1fa6a | ||
|
|
a2a916a9ac | ||
|
|
fcf2ec4100 | ||
|
|
6a95d4b1ab | ||
|
|
ab8aa9d0e2 | ||
|
|
4956551d28 | ||
|
|
dd047782c7 | ||
|
|
ff27838146 | ||
|
|
654b9f9f10 | ||
|
|
1083ff0576 | ||
|
|
e83fcf4e5f | ||
|
|
0d7945d8e8 | ||
|
|
a48038ffee | ||
|
|
05957f021e | ||
|
|
1caa82cef1 | ||
|
|
495a51756f | ||
|
|
963573e78d | ||
|
|
8c7d43d4a6 | ||
|
|
81f386fa70 | ||
|
|
a2916ba845 | ||
|
|
802c625b78 | ||
|
|
adb2894929 | ||
|
|
9583825c8c | ||
|
|
3695045516 | ||
|
|
4febaa5e13 | ||
|
|
4a90c66a70 | ||
|
|
d7f3890d32 | ||
|
|
b46f00a805 | ||
|
|
83333f5bf9 | ||
|
|
b6a213a6fc | ||
|
|
288ee9627d | ||
|
|
08c0b6f1e6 | ||
|
|
ad7ae463e5 | ||
|
|
9de77f29d6 | ||
|
|
e4ceb4ab94 | ||
|
|
f8bd548924 | ||
|
|
d53c874ad0 | ||
|
|
292cf995b6 | ||
|
|
f41156802c | ||
|
|
75656f3452 | ||
|
|
77bbc62394 | ||
|
|
485e8d82e5 | ||
|
|
470aa638c5 | ||
|
|
8b4371ee99 | ||
|
|
521549e7e7 | ||
|
|
6b2dfc660a | ||
|
|
1395bd97f9 | ||
|
|
f2001fd269 | ||
|
|
b3ecc60c4c |
No files matched your search
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@expo/build-tools': minor
|
||||
---
|
||||
|
||||
Count Android web preview input as session activity, so `max_idle_time_minutes` works on Android sessions. `eas/start_serve_sim_remote_session` no longer rejects it on Android; the API does not accept an idle timeout for Android web-preview-only sessions yet.
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
'@expo/build-tools': patch
|
||||
---
|
||||
|
||||
Send an `Idempotency-Key` header when creating device run session and sandbox artifact upload sessions, reuse it when an upload is retried, and stop retrying an upload that EAS rejects.
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
'@expo/build-tools': minor
|
||||
---
|
||||
|
||||
Run the `after_checkout` workflow hook in build jobs that do not use custom steps.
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
'eas-cli': patch
|
||||
---
|
||||
|
||||
Stop selecting the deprecated `Build.logFiles`, `Build.queuePosition`, `Build.initialQueuePosition`, `Build.estimatedWaitTimeLeftSeconds` and `AndroidSubmissionConfig.applicationIdentifier` GraphQL fields.
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
'@expo/build-tools': patch
|
||||
---
|
||||
|
||||
Report an iOS Simulator app install that fails with "Requires a Newer Version of iOS" as the user error `EAS_INSTALL_APPLICATION_REQUIRES_NEWER_IOS`, with a message that asks for a Simulator device whose iOS version meets the app's minimum, or a lower iOS deployment target. Other install failures still report `SERVER_ERROR`.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'eas-cli': minor
|
||||
---
|
||||
|
||||
Add `--network-capture-recording` to keep captured traffic as HAR session artifacts.
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
'eas-cli': minor
|
||||
---
|
||||
|
||||
Add `eas project:icon:unset`, and make `eas project:icon:set` use the icon from the app config when no path is given.
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
'eas-cli': minor
|
||||
---
|
||||
|
||||
Show the display name, slug and icon in `eas project:info`, and describe how `eas project:icon:set` processes the image.
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
'eas-cli': minor
|
||||
---
|
||||
|
||||
Add `eas project:name:set` to set the project display name shown on the EAS dashboard.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@expo/build-tools': minor
|
||||
---
|
||||
|
||||
Add start and collect steps that attach serve-sim simulator crash reports to device run sessions as IPS files.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@expo/build-tools': minor
|
||||
---
|
||||
|
||||
Add start and collect steps that attach serve-sim network captures to device run sessions as HAR files.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'eas-cli': minor
|
||||
---
|
||||
|
||||
Add `simulator:crashes` to inspect live crashes and download individual saved IPS reports.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'eas-cli': patch
|
||||
---
|
||||
|
||||
Mark the default device for each platform in `eas simulator:devices` and include `isDefault` in JSON output.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'eas-cli': minor
|
||||
---
|
||||
|
||||
Add `simulator:network-requests` to list, follow, and inspect captured requests and download HAR files.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@expo/build-tools': patch
|
||||
---
|
||||
|
||||
A successful remote device run session no longer fails when its agent-device, Appium, or Argent tunnel does not stop within its time-out.
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
'@expo/build-tools': patch
|
||||
---
|
||||
|
||||
Send the reason when the worker stops a Simulator session: `idle_timeout` after the idle timeout, and `max_duration` when the session reaches its maximum duration, which now also stops the session through the worker stop route. A canceled build step sends no stop.
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
'eas-cli': patch
|
||||
---
|
||||
|
||||
Fix the log URL of `eas workflow:view` for a project that has a display name.
|
||||
@@ -2,24 +2,6 @@
|
||||
|
||||
This is the log of notable changes to EAS CLI and related packages.
|
||||
|
||||
## [27.11.0](https://github.com/expo/eas-cli/releases/tag/v27.11.0) - 2026-11-19
|
||||
|
||||
### 🎉 New features
|
||||
|
||||
- [build-tools] Report the identifier of the installed app as `applicationIdentifier` in the agent-device remote config, so clients can attach to the app of an `application_archive_url` session. ([#4831](https://github.com/expo/eas-cli/pull/4831) by [@expo-tuft](https://github.com/apps/expo-tuft))
|
||||
- [build-tools] Count Android web preview input as session activity, so `max_idle_time_minutes` works on Android sessions. `eas/start_serve_sim_remote_session` no longer rejects it on Android; the API does not accept an idle timeout for Android web-preview-only sessions yet. ([#4890](https://github.com/expo/eas-cli/pull/4890) by [@szdziedzic](https://github.com/szdziedzic))
|
||||
- [eas-build-job] Accept `issue_comment` as a `github.event_name` value in the workflow interpolation context. ([#4906](https://github.com/expo/eas-cli/pull/4906) by [@sswrk](https://github.com/sswrk))
|
||||
- [eas-build-job] Support error occurrence events in Observe workflow context. ([#4860](https://github.com/expo/eas-cli/pull/4860) by [@AbbanMustafa](https://github.com/AbbanMustafa))
|
||||
- [build-tools] Add start and collect steps that attach serve-sim simulator crash reports to device run sessions as IPS files. ([#4596](https://github.com/expo/eas-cli/pull/4596) by [@gwdp](https://github.com/gwdp))
|
||||
- [build-tools] Add start and collect steps that attach serve-sim network captures to device run sessions as HAR files. ([#4495](https://github.com/expo/eas-cli/pull/4495) by [@gwdp](https://github.com/gwdp))
|
||||
|
||||
### 🐛 Bug fixes
|
||||
|
||||
- [eas-cli] Detect Factory Droid, Grok Bot, Claude Cowork, and Muse in EAS CLI telemetry. ([#4912](https://github.com/expo/eas-cli/pull/4912) by [@davidmokos](https://github.com/davidmokos))
|
||||
- [build-tools] Default `fastlane gym` dSYM compression level to 1. ([#4909](https://github.com/expo/eas-cli/pull/4909) by [@AHGIJMKLKKZNPJKQR](https://github.com/AHGIJMKLKKZNPJKQR))
|
||||
- [eas-cli] Mark the default device for each platform in `eas simulator:devices` and include `isDefault` in JSON output. ([#4895](https://github.com/expo/eas-cli/pull/4895) by [@gwdp](https://github.com/gwdp))
|
||||
- [build-tools] A successful remote device run session no longer fails when its agent-device, Appium, or Argent tunnel does not stop within its time-out. ([#4893](https://github.com/expo/eas-cli/pull/4893) by [@szdziedzic](https://github.com/szdziedzic))
|
||||
|
||||
## [27.10.0](https://github.com/expo/eas-cli/releases/tag/v27.10.0) - 2026-11-13
|
||||
|
||||
### 🎉 New features
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"STAGING": "27.11.0",
|
||||
"PRODUCTION": "27.11.0"
|
||||
"STAGING": "27.10.0",
|
||||
"PRODUCTION": "27.10.0"
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"npmClient": "yarn",
|
||||
"version": "27.11.0",
|
||||
"version": "27.10.0",
|
||||
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
|
||||
}
|
||||
@@ -1,19 +1,5 @@
|
||||
# @expo/build-tools
|
||||
|
||||
## 27.11.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- Report the identifier of the installed app as `applicationIdentifier` in the agent-device remote config, so clients can attach to the app of an `application_archive_url` session. ([#4831](https://github.com/expo/eas-cli/pull/4831) by [@expo-tuft](https://github.com/apps/expo-tuft))
|
||||
- Count Android web preview input as session activity, so `max_idle_time_minutes` works on Android sessions. `eas/start_serve_sim_remote_session` no longer rejects it on Android; the API does not accept an idle timeout for Android web-preview-only sessions yet. ([#4890](https://github.com/expo/eas-cli/pull/4890) by [@szdziedzic](https://github.com/szdziedzic))
|
||||
- Add start and collect steps that attach serve-sim simulator crash reports to device run sessions as IPS files. ([#4596](https://github.com/expo/eas-cli/pull/4596) by [@gwdp](https://github.com/gwdp))
|
||||
- Add start and collect steps that attach serve-sim network captures to device run sessions as HAR files. ([#4495](https://github.com/expo/eas-cli/pull/4495) by [@gwdp](https://github.com/gwdp))
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Default `fastlane gym` dSYM compression level to 1. ([#4909](https://github.com/expo/eas-cli/pull/4909) by [@AHGIJMKLKKZNPJKQR](https://github.com/AHGIJMKLKKZNPJKQR))
|
||||
- A successful remote device run session no longer fails when its agent-device, Appium, or Argent tunnel does not stop within its time-out. ([#4893](https://github.com/expo/eas-cli/pull/4893) by [@szdziedzic](https://github.com/szdziedzic))
|
||||
|
||||
## 27.10.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@expo/build-tools",
|
||||
"version": "27.11.0",
|
||||
"version": "27.10.0",
|
||||
"bugs": "https://github.com/expo/eas-cli/issues",
|
||||
"license": "BUSL-1.1",
|
||||
"author": "Expo <[email protected]>",
|
||||
@@ -42,17 +42,17 @@
|
||||
"dependencies": {
|
||||
"@expo/config": "55.0.10",
|
||||
"@expo/config-plugins": "55.0.7",
|
||||
"@expo/downloader": "27.11.0",
|
||||
"@expo/eas-build-job": "27.11.0",
|
||||
"@expo/downloader": "27.10.0",
|
||||
"@expo/eas-build-job": "27.10.0",
|
||||
"@expo/env": "^0.4.0",
|
||||
"@expo/logger": "27.11.0",
|
||||
"@expo/logger": "27.10.0",
|
||||
"@expo/package-manager": "1.9.10",
|
||||
"@expo/plist": "^0.3.5",
|
||||
"@expo/results": "^1.0.0",
|
||||
"@expo/spawn-async": "1.7.2",
|
||||
"@expo/steps": "27.11.0",
|
||||
"@expo/template-file": "27.11.0",
|
||||
"@expo/turtle-spawn": "27.11.0",
|
||||
"@expo/steps": "27.10.0",
|
||||
"@expo/template-file": "27.10.0",
|
||||
"@expo/turtle-spawn": "27.10.0",
|
||||
"@expo/xcpretty": "^4.4.7",
|
||||
"@ngrok/ngrok": "1.7.0",
|
||||
"@sentry/node": "7.77.0",
|
||||
|
||||
@@ -91,7 +91,7 @@ describe(androidBuilder, () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('passes a hooks ref to setupAsync', async () => {
|
||||
it('passes the install_node_modules anchor and a hooks ref to setupAsync', async () => {
|
||||
const ctx = new BuildContext(createTestAndroidJob(), {
|
||||
workingdir: '/workingdir',
|
||||
logBuffer: { getLogs: () => [], getPhaseLogs: () => [] },
|
||||
@@ -105,6 +105,7 @@ describe(androidBuilder, () => {
|
||||
expect(setupAsync).toHaveBeenCalledWith(
|
||||
expect.anything(),
|
||||
expect.objectContaining({
|
||||
wrappedAnchors: ['install_node_modules'],
|
||||
jobHooksRef: expect.objectContaining({ current: null }),
|
||||
})
|
||||
);
|
||||
|
||||
@@ -72,7 +72,7 @@ async function buildInnerAsync(
|
||||
ctx: BuildContext<Android.Job>,
|
||||
jobHooksRef: JobHooksRef
|
||||
): Promise<void> {
|
||||
await setupAsync(ctx, { jobHooksRef });
|
||||
await setupAsync(ctx, { wrappedAnchors: ['install_node_modules'], jobHooksRef });
|
||||
const evictUsedBefore = new Date();
|
||||
const workingDirectory = ctx.getReactNativeProjectDirectory();
|
||||
const hasNativeCode = ctx.job.type === Workflow.GENERIC;
|
||||
|
||||
@@ -76,7 +76,7 @@ async function buildInnerAsync(
|
||||
ctx: BuildContext<Ios.Job>,
|
||||
jobHooksRef: JobHooksRef
|
||||
): Promise<void> {
|
||||
await setupAsync(ctx, { jobHooksRef });
|
||||
await setupAsync(ctx, { wrappedAnchors: ['install_node_modules'], jobHooksRef });
|
||||
const hasNativeCode = ctx.job.type === Workflow.GENERIC;
|
||||
const evictUsedBefore = new Date();
|
||||
const credentialsManager = new CredentialsManager(ctx);
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { BuildPhase, BuildTrigger, HookKey, Hooks, Ios } from '@expo/eas-build-job';
|
||||
import { BuildPhase, BuildTrigger, Hooks, Ios } from '@expo/eas-build-job';
|
||||
import { bunyan } from '@expo/logger';
|
||||
import { executeHookStepsAsync } from '@expo/steps';
|
||||
|
||||
import { createTestIosJob } from '../../__tests__/utils/job';
|
||||
import { BuildContext } from '../../context';
|
||||
import { runHookEntriesAsync, runHookableBuildPhaseAsync } from '../hookableBuildPhase';
|
||||
import { runHookableBuildPhaseAsync } from '../hookableBuildPhase';
|
||||
import { ParsedJobHooks, parseJobHooksAsync } from '../jobHooks';
|
||||
|
||||
// The primitive's step-execution rules (failure()/success(), no-if continuation,
|
||||
@@ -16,10 +16,7 @@ jest.mock('@expo/steps', () => ({
|
||||
}));
|
||||
const executeHookStepsMock = jest.mocked(executeHookStepsAsync);
|
||||
|
||||
async function setup(
|
||||
hooks: Hooks | undefined,
|
||||
hookKeys: readonly HookKey[] = ['before_install_node_modules', 'after_install_node_modules']
|
||||
): Promise<{
|
||||
async function setup(hooks: Hooks | undefined): Promise<{
|
||||
ctx: BuildContext<Ios.Job>;
|
||||
hooks: ParsedJobHooks | null;
|
||||
}> {
|
||||
@@ -43,7 +40,7 @@ async function setup(
|
||||
jest
|
||||
.spyOn(ctx, 'runBuildPhase')
|
||||
.mockImplementation((_phase: BuildPhase, fn: () => Promise<unknown>) => fn() as never);
|
||||
return { ctx, hooks: await parseJobHooksAsync(ctx, hookKeys) };
|
||||
return { ctx, hooks: await parseJobHooksAsync(ctx, ['install_node_modules']) };
|
||||
}
|
||||
|
||||
const runArgs = <TJob extends Ios.Job>(
|
||||
@@ -165,23 +162,3 @@ describe(runHookableBuildPhaseAsync, () => {
|
||||
expect(writeBack).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
describe(runHookEntriesAsync, () => {
|
||||
beforeEach(() => {
|
||||
executeHookStepsMock.mockReset();
|
||||
executeHookStepsMock.mockResolvedValue({ failedLocally: false, firstError: undefined });
|
||||
});
|
||||
|
||||
it('runs the after_checkout entries that the parser built', async () => {
|
||||
const { ctx, hooks } = await setup({ after_checkout: [{ run: 'echo after' }] }, [
|
||||
'after_checkout',
|
||||
]);
|
||||
await runHookEntriesAsync({ ctx, hooks: hooks!, timing: 'after', anchor: 'checkout' });
|
||||
expect(hooks!.hookEntriesByKey.after_checkout).toHaveLength(1);
|
||||
expect(executeHookStepsMock).toHaveBeenCalledWith(
|
||||
hooks!.globalContext,
|
||||
hooks!.hookEntriesByKey.after_checkout,
|
||||
{ anchor: 'checkout', timing: 'after', anchorResult: 'success' }
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -9,7 +9,7 @@ import { createTestIosJob } from '../../__tests__/utils/job';
|
||||
import { BuildContext } from '../../context';
|
||||
import { parseJobHooksAsync } from '../jobHooks';
|
||||
|
||||
const INSTALL = ['before_install_node_modules', 'after_install_node_modules'] as const;
|
||||
const INSTALL: ['install_node_modules'] = ['install_node_modules'];
|
||||
|
||||
function createCtx(
|
||||
hooks: Hooks | undefined,
|
||||
|
||||
@@ -4,7 +4,7 @@ import { createTestAndroidJob } from '../../__tests__/utils/job';
|
||||
import { createMockLogger } from '../../__tests__/utils/logger';
|
||||
import { BuildContext } from '../../context';
|
||||
import { resolveEnvFromBuildProfileAsync, runEasBuildInternalAsync } from '../easBuildInternal';
|
||||
import { runHookEntriesAsync, runHookableBuildPhaseAsync } from '../hookableBuildPhase';
|
||||
import { runHookableBuildPhaseAsync } from '../hookableBuildPhase';
|
||||
import { JobHooksRef, setupAsync } from '../setup';
|
||||
import { ParsedJobHooks, parseJobHooksAsync } from '../jobHooks';
|
||||
import { prepareProjectSourcesAsync } from '../projectSources';
|
||||
@@ -15,10 +15,7 @@ jest.mock('../easBuildInternal', () => ({
|
||||
resolveEnvFromBuildProfileAsync: jest.fn(),
|
||||
runEasBuildInternalAsync: jest.fn(),
|
||||
}));
|
||||
jest.mock('../hookableBuildPhase', () => ({
|
||||
runHookEntriesAsync: jest.fn(),
|
||||
runHookableBuildPhaseAsync: jest.fn(),
|
||||
}));
|
||||
jest.mock('../hookableBuildPhase', () => ({ runHookableBuildPhaseAsync: jest.fn() }));
|
||||
jest.mock('../jobHooks', () => ({ parseJobHooksAsync: jest.fn() }));
|
||||
jest.mock('../../utils/npmrc', () => ({ setUpNpmrcAsync: jest.fn() }));
|
||||
jest.mock('../../utils/hooks', () => ({
|
||||
@@ -82,9 +79,6 @@ describe(setupAsync, () => {
|
||||
order.push('parse-hooks');
|
||||
return PARSED;
|
||||
});
|
||||
jest.mocked(runHookEntriesAsync).mockImplementation(async () => {
|
||||
order.push('after-checkout-hooks');
|
||||
});
|
||||
jest.mocked(runHookableBuildPhaseAsync).mockImplementation(async () => {
|
||||
// Record the wrapper call; deliberately do NOT run its `fn` so the install
|
||||
// internals stay out of the ordering test.
|
||||
@@ -97,50 +91,23 @@ describe(setupAsync, () => {
|
||||
}));
|
||||
});
|
||||
|
||||
it('parses hooks after project prep + profile-env + pre-install hook, then runs the after_checkout hooks before the install wrapper', async () => {
|
||||
it('parses hooks after project prep + profile-env + pre-install hook, and before the install wrapper', async () => {
|
||||
const jobHooksRef: JobHooksRef = { current: null };
|
||||
await setupAsync(createCtx(BuildTrigger.GIT_BASED_INTEGRATION), {
|
||||
wrappedAnchors: ['install_node_modules'],
|
||||
jobHooksRef,
|
||||
});
|
||||
expect(order).toEqual([
|
||||
'prepare-project',
|
||||
'profile-env',
|
||||
'pre-install-hook',
|
||||
'parse-hooks',
|
||||
'after-checkout-hooks',
|
||||
'install-wrapper',
|
||||
]);
|
||||
expect(parseJobHooksAsync).toHaveBeenCalledWith(expect.anything(), [
|
||||
'after_checkout',
|
||||
'before_install_node_modules',
|
||||
'after_install_node_modules',
|
||||
]);
|
||||
expect(runHookEntriesAsync).toHaveBeenCalledWith(
|
||||
expect.objectContaining({ hooks: PARSED, timing: 'after', anchor: 'checkout' })
|
||||
);
|
||||
});
|
||||
|
||||
it('publishes the parsed hooks to the ref before an after_checkout hook can fail', async () => {
|
||||
jest.mocked(runHookEntriesAsync).mockRejectedValueOnce(new Error('hook boom'));
|
||||
const jobHooksRef: JobHooksRef = { current: null };
|
||||
await expect(
|
||||
setupAsync(createCtx(BuildTrigger.GIT_BASED_INTEGRATION), { jobHooksRef })
|
||||
).rejects.toThrow('hook boom');
|
||||
expect(jobHooksRef.current).toBe(PARSED);
|
||||
expect(runHookableBuildPhaseAsync).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('runs no after_checkout hooks when the job has no hooks', async () => {
|
||||
jest.mocked(parseJobHooksAsync).mockResolvedValueOnce(null);
|
||||
await setupAsync(createCtx(BuildTrigger.GIT_BASED_INTEGRATION), {
|
||||
jobHooksRef: { current: null },
|
||||
});
|
||||
expect(runHookEntriesAsync).not.toHaveBeenCalled();
|
||||
const parseAt = order.indexOf('parse-hooks');
|
||||
expect(order.indexOf('prepare-project')).toBeLessThan(parseAt);
|
||||
expect(order.indexOf('profile-env')).toBeLessThan(parseAt);
|
||||
expect(order.indexOf('pre-install-hook')).toBeLessThan(parseAt);
|
||||
expect(parseAt).toBeLessThan(order.indexOf('install-wrapper'));
|
||||
});
|
||||
|
||||
it('parses hooks unconditionally on a non-git-based build (never parked in the git-only branch)', async () => {
|
||||
const jobHooksRef: JobHooksRef = { current: null };
|
||||
await setupAsync(createCtx(BuildTrigger.EAS_CLI), {
|
||||
wrappedAnchors: ['install_node_modules'],
|
||||
jobHooksRef,
|
||||
});
|
||||
expect(parseJobHooksAsync).toHaveBeenCalledTimes(1);
|
||||
@@ -152,6 +119,7 @@ describe(setupAsync, () => {
|
||||
it('publishes the parsed hooks to the ref before the install wrapper runs', async () => {
|
||||
const jobHooksRef: JobHooksRef = { current: null };
|
||||
await setupAsync(createCtx(BuildTrigger.GIT_BASED_INTEGRATION), {
|
||||
wrappedAnchors: ['install_node_modules'],
|
||||
jobHooksRef,
|
||||
});
|
||||
expect(jobHooksRef.current).toBe(PARSED);
|
||||
|
||||
@@ -5,7 +5,3 @@ export const COMMON_FASTLANE_ENV = {
|
||||
FASTLANE_HIDE_TIMESTAMP: 'true',
|
||||
LC_ALL: 'en_US.UTF-8',
|
||||
};
|
||||
|
||||
export const DEFAULT_FASTLANE_GYM_ENV = {
|
||||
ZIPOPT: '-1',
|
||||
};
|
||||
@@ -57,7 +57,7 @@ export async function runHookableBuildPhaseAsync<TJob extends BuildJob, T>({
|
||||
return result;
|
||||
}
|
||||
|
||||
export async function runHookEntriesAsync<TJob extends BuildJob>({
|
||||
async function runHookEntriesAsync<TJob extends BuildJob>({
|
||||
ctx,
|
||||
hooks,
|
||||
timing,
|
||||
|
||||
@@ -2,6 +2,7 @@ import {
|
||||
BuildJob,
|
||||
CompositeFunctionCatalog,
|
||||
ErrorCode,
|
||||
HookAnchorId,
|
||||
HookKey,
|
||||
UserError,
|
||||
parseHookKey,
|
||||
@@ -36,12 +37,12 @@ export interface ParsedJobHooks {
|
||||
/**
|
||||
* Parses the native job's `hooks` into engine-ready entries, once, at setup
|
||||
* time. Shape-validates every registered key (reachable or not); constructs
|
||||
* entries only for the hook keys this build runs. Returns null when the
|
||||
* entries only for the anchors this build actually wraps. Returns null when the
|
||||
* job declares no hooks.
|
||||
*/
|
||||
export async function parseJobHooksAsync<TJob extends BuildJob>(
|
||||
ctx: BuildContext<TJob>,
|
||||
hookKeys: readonly HookKey[]
|
||||
wrappedAnchors: readonly HookAnchorId[]
|
||||
): Promise<ParsedJobHooks | null> {
|
||||
const hooks = ctx.job.hooks;
|
||||
if (!hooks || Object.keys(hooks).length === 0) {
|
||||
@@ -80,8 +81,8 @@ export async function parseJobHooksAsync<TJob extends BuildJob>(
|
||||
}
|
||||
}
|
||||
|
||||
// Construct entries for the given hook keys in the order given, which is
|
||||
// EXECUTION order, so generated step ids and output references follow the
|
||||
// Construct entries for the wrapped anchors in EXECUTION order (per anchor,
|
||||
// before_ then after_) so generated step ids and output references follow the
|
||||
// order steps actually run. All entries share one globalContext, so env and
|
||||
// outputs accumulate across keys.
|
||||
const hookEntriesByKey: Partial<Record<HookKey, HookEntry[]>> = {};
|
||||
@@ -91,34 +92,37 @@ export async function parseJobHooksAsync<TJob extends BuildJob>(
|
||||
ctx.getReactNativeProjectDirectory(),
|
||||
{ logger: ctx.logger }
|
||||
);
|
||||
for (const key of hookKeys) {
|
||||
const steps = hooks[key];
|
||||
if (!Array.isArray(steps) || steps.length === 0) {
|
||||
continue;
|
||||
}
|
||||
let entries: HookEntry[];
|
||||
try {
|
||||
// Extended per key so a bad `uses:` path is attributed to that hook key.
|
||||
await extendCompositeFunctionCatalogFromStepsAsync({
|
||||
catalog: compositeFunctionCatalog,
|
||||
rootSteps: steps,
|
||||
loadCompositeFunction,
|
||||
});
|
||||
entries = await constructHookEntriesAsync(globalContext, steps, {
|
||||
externalFunctions,
|
||||
externalFunctionGroups,
|
||||
compositeFunctionCatalog,
|
||||
});
|
||||
} catch (err) {
|
||||
throw new UserError(
|
||||
ErrorCode.HOOKS_ERROR,
|
||||
`Failed to parse hooks.${key}: ${err instanceof Error ? err.message : String(err)}. Hooks use the same syntax as workflow steps.`,
|
||||
{ cause: err }
|
||||
);
|
||||
}
|
||||
hookEntriesByKey[key] = entries;
|
||||
for (const entry of entries) {
|
||||
orderedSteps.push(...entry.steps);
|
||||
for (const anchor of wrappedAnchors) {
|
||||
for (const side of ['before', 'after'] as const) {
|
||||
const key: HookKey = `${side}_${anchor}`;
|
||||
const steps = hooks[key];
|
||||
if (!Array.isArray(steps) || steps.length === 0) {
|
||||
continue;
|
||||
}
|
||||
let entries: HookEntry[];
|
||||
try {
|
||||
// Extended per key so a bad `uses:` path is attributed to that hook key.
|
||||
await extendCompositeFunctionCatalogFromStepsAsync({
|
||||
catalog: compositeFunctionCatalog,
|
||||
rootSteps: steps,
|
||||
loadCompositeFunction,
|
||||
});
|
||||
entries = await constructHookEntriesAsync(globalContext, steps, {
|
||||
externalFunctions,
|
||||
externalFunctionGroups,
|
||||
compositeFunctionCatalog,
|
||||
});
|
||||
} catch (err) {
|
||||
throw new UserError(
|
||||
ErrorCode.HOOKS_ERROR,
|
||||
`Failed to parse hooks.${key}: ${err instanceof Error ? err.message : String(err)}. Hooks use the same syntax as workflow steps.`,
|
||||
{ cause: err }
|
||||
);
|
||||
}
|
||||
hookEntriesByKey[key] = entries;
|
||||
for (const entry of entries) {
|
||||
orderedSteps.push(...entry.steps);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import {
|
||||
BuildJob,
|
||||
BuildPhase,
|
||||
BuildTrigger,
|
||||
HookAnchorId,
|
||||
Ios,
|
||||
Job,
|
||||
Platform,
|
||||
@@ -14,7 +15,7 @@ import nullthrows from 'nullthrows';
|
||||
import path from 'path';
|
||||
|
||||
import { resolveEnvFromBuildProfileAsync, runEasBuildInternalAsync } from './easBuildInternal';
|
||||
import { runHookEntriesAsync, runHookableBuildPhaseAsync } from './hookableBuildPhase';
|
||||
import { runHookableBuildPhaseAsync } from './hookableBuildPhase';
|
||||
import { installDependenciesAsync, resolvePackagerDir } from './installDependencies';
|
||||
import { ParsedJobHooks, parseJobHooksAsync } from './jobHooks';
|
||||
import { prepareProjectSourcesAsync } from './projectSources';
|
||||
@@ -49,7 +50,10 @@ export interface JobHooksRef {
|
||||
|
||||
export async function setupAsync<TJob extends BuildJob>(
|
||||
ctx: BuildContext<TJob>,
|
||||
{ jobHooksRef }: { jobHooksRef: JobHooksRef }
|
||||
{
|
||||
wrappedAnchors,
|
||||
jobHooksRef,
|
||||
}: { wrappedAnchors: readonly HookAnchorId[]; jobHooksRef: JobHooksRef }
|
||||
): Promise<void> {
|
||||
await ctx.runBuildPhase(BuildPhase.PREPARE_PROJECT, async () => {
|
||||
await retryAsync(
|
||||
@@ -107,19 +111,7 @@ export async function setupAsync<TJob extends BuildJob>(
|
||||
// Parse hooks unconditionally, after every pre-install env mutation
|
||||
// (PREPARE_PROJECT, the git-based profile-env block, PRE_INSTALL_HOOK) and
|
||||
// before the first wrapped phase.
|
||||
jobHooksRef.current = await parseJobHooksAsync(ctx, [
|
||||
'after_checkout',
|
||||
'before_install_node_modules',
|
||||
'after_install_node_modules',
|
||||
]);
|
||||
if (jobHooksRef.current) {
|
||||
await runHookEntriesAsync({
|
||||
ctx,
|
||||
hooks: jobHooksRef.current,
|
||||
timing: 'after',
|
||||
anchor: 'checkout',
|
||||
});
|
||||
}
|
||||
jobHooksRef.current = await parseJobHooksAsync(ctx, wrappedAnchors);
|
||||
|
||||
await runHookableBuildPhaseAsync({
|
||||
ctx,
|
||||
|
||||
@@ -23,19 +23,13 @@ const WORKING_DIR = '/workingdir';
|
||||
// BuildContext.getReactNativeProjectDirectory() nests the RN project under `${workingdir}/build`.
|
||||
const IOS_DIR = path.join(WORKING_DIR, 'build', 'ios');
|
||||
|
||||
function makeIosBuildContext({
|
||||
simulator,
|
||||
env = {},
|
||||
}: {
|
||||
simulator: boolean;
|
||||
env?: Record<string, string>;
|
||||
}): BuildContext<Ios.Job> {
|
||||
function makeIosBuildContext({ simulator }: { simulator: boolean }): BuildContext<Ios.Job> {
|
||||
const job: Ios.Job = { ...createTestIosJob(), simulator };
|
||||
return new BuildContext(job, {
|
||||
workingdir: WORKING_DIR,
|
||||
logger: createMockLogger(),
|
||||
logBuffer: { getLogs: () => [], getPhaseLogs: () => [] },
|
||||
env: { __API_SERVER_URL: 'http://api.expo.test', ...env },
|
||||
env: { __API_SERVER_URL: 'http://api.expo.test' },
|
||||
uploadArtifact: jest.fn(),
|
||||
});
|
||||
}
|
||||
@@ -131,25 +125,4 @@ describe(runFastlaneGym, () => {
|
||||
workspacePath: IOS_DIR,
|
||||
});
|
||||
});
|
||||
|
||||
it.each<{ name: string; env: Record<string, string>; expectedZipopt: string }>([
|
||||
{ name: 'defaults ZIPOPT to -1', env: {}, expectedZipopt: '-1' },
|
||||
{ name: 'keeps ZIPOPT from the build env', env: { ZIPOPT: '-9' }, expectedZipopt: '-9' },
|
||||
])('$name', async ({ env, expectedZipopt }) => {
|
||||
const ctx = makeIosBuildContext({ simulator: false, env });
|
||||
|
||||
await runFastlaneGym(ctx, {
|
||||
scheme: 'App',
|
||||
credentials: ARCHIVE_CREDENTIALS,
|
||||
entitlements: null,
|
||||
});
|
||||
|
||||
expect(spawn).toHaveBeenCalledWith(
|
||||
'fastlane',
|
||||
['gym'],
|
||||
expect.objectContaining({
|
||||
env: expect.objectContaining({ ZIPOPT: expectedZipopt }),
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -10,7 +10,7 @@ import type { Credentials } from './credentials/manager';
|
||||
import { createFastfileForResigningBuild } from './fastfile';
|
||||
import { createGymfileForArchiveBuild, createGymfileForSimulatorBuild } from './gymfile';
|
||||
import { isTVOS } from './tvos';
|
||||
import { COMMON_FASTLANE_ENV, DEFAULT_FASTLANE_GYM_ENV } from '../common/fastlane';
|
||||
import { COMMON_FASTLANE_ENV } from '../common/fastlane';
|
||||
import { XcodeBuildLogger } from '../common/xcpretty';
|
||||
import { BuildContext, SkipNativeBuildError } from '../context';
|
||||
|
||||
@@ -52,7 +52,7 @@ export async function runFastlaneGym<TJob extends Ios.Job>(
|
||||
await runFastlane(['gym'], {
|
||||
cwd: workspacePath,
|
||||
logger: ctx.logger,
|
||||
env: { ...DEFAULT_FASTLANE_GYM_ENV, ...ctx.env, ...extraEnv },
|
||||
env: { ...ctx.env, ...extraEnv },
|
||||
});
|
||||
} finally {
|
||||
await buildLogger.flush();
|
||||
|
||||
-30
@@ -216,36 +216,6 @@ describe('runAgentDeviceRemoteSessionAsync orchestration', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it.each([
|
||||
[
|
||||
BuildRuntimePlatform.DARWIN,
|
||||
{
|
||||
iosSimulatorUdid: 'selected-udid',
|
||||
application: Promise.resolve({
|
||||
installAppPath: '/tmp/App.app',
|
||||
launchAppIdentifier: 'com.example.archive',
|
||||
}),
|
||||
},
|
||||
],
|
||||
[
|
||||
BuildRuntimePlatform.LINUX,
|
||||
{ booted: Promise.resolve(), ready: Promise.resolve('com.example.archive') },
|
||||
],
|
||||
])(
|
||||
'reports the identifier of the app the %s device launched',
|
||||
async (runtimePlatform, device) => {
|
||||
const logger = { info: jest.fn(), warn: jest.fn(), child: jest.fn().mockReturnThis() };
|
||||
|
||||
await runAsync(logger, runtimePlatform, { device });
|
||||
|
||||
expect(uploadRemoteSessionConfigAsync).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
remoteConfig: expect.objectContaining({ applicationIdentifier: 'com.example.archive' }),
|
||||
})
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
it('uses the warm daemon after adoption and starts no daemon of its own', async () => {
|
||||
const logger = { info: jest.fn(), warn: jest.fn(), child: jest.fn().mockReturnThis() };
|
||||
const warmServer = { port: 3200 } as never;
|
||||
|
||||
@@ -517,10 +517,6 @@ describe(createStartAgentDeviceSessionBuildFunction, () => {
|
||||
expect(launchApplicationAsync).toHaveBeenCalledWith(
|
||||
expect.objectContaining({ applicationIdentifier: 'dev.example.app', activityName: '.Main' })
|
||||
);
|
||||
// The remote session reports it so clients can attach to an archive session's app.
|
||||
await expect((sessionDevice() as { ready: Promise<unknown> }).ready).resolves.toBe(
|
||||
'dev.example.app'
|
||||
);
|
||||
});
|
||||
|
||||
it('stops the download and waits for it when Android boot fails', async () => {
|
||||
|
||||
@@ -126,8 +126,7 @@ export async function runAgentDeviceRemoteSessionAsync(
|
||||
device:
|
||||
| {
|
||||
booted: Promise<unknown>;
|
||||
/** Resolves with the identifier of the app it installed, if any. */
|
||||
ready: Promise<string | void>;
|
||||
ready: Promise<unknown>;
|
||||
}
|
||||
| {
|
||||
iosSimulatorUdid: string;
|
||||
@@ -245,7 +244,6 @@ export async function runAgentDeviceRemoteSessionAsync(
|
||||
const [
|
||||
{ port: daemonPort, token: daemonToken, remoteSessionUrl: agentDeviceRemoteSessionUrl },
|
||||
webPreview,
|
||||
installedApplicationIdentifier,
|
||||
] = await Promise.all([agentDeviceStartup, sessionHostStartup, deviceReady]).catch(
|
||||
(err: unknown) => {
|
||||
// Also aborts for a `device.ready` that does not come from `tasks.run`.
|
||||
@@ -255,11 +253,6 @@ export async function runAgentDeviceRemoteSessionAsync(
|
||||
);
|
||||
tasks.signal.throwIfAborted();
|
||||
logger.info(tasks.summary());
|
||||
// Reported so clients can attach to the app of a session with no build record, like an
|
||||
// `application_archive_url` one. The session host already launched the iOS app.
|
||||
const applicationIdentifier = hostBootedDevice?.application
|
||||
? (await tasks.untilAborted(hostBootedDevice.application))?.launchAppIdentifier
|
||||
: installedApplicationIdentifier;
|
||||
|
||||
const sessionStart = await uploadRemoteSessionConfigWithLocalEgressAsync({
|
||||
env,
|
||||
@@ -272,7 +265,6 @@ export async function runAgentDeviceRemoteSessionAsync(
|
||||
webPreviewUrl: webPreview.previewPageUrl,
|
||||
previewApiUrl: webPreview.apiUrl,
|
||||
...(webPreview.previewToken ? { webPreviewToken: webPreview.previewToken } : {}),
|
||||
...(applicationIdentifier ? { applicationIdentifier } : {}),
|
||||
},
|
||||
logger,
|
||||
});
|
||||
|
||||
@@ -226,7 +226,6 @@ export function createStartAgentDeviceSessionBuildFunction(
|
||||
let sessionOwnsTeardown = false;
|
||||
let downloaded: Promise<string> | undefined;
|
||||
let applicationReady: Promise<ServeSimApplicationOptions | void> | undefined;
|
||||
let installedAndroidApplication: Promise<string> | undefined;
|
||||
|
||||
try {
|
||||
if (isIos) {
|
||||
@@ -322,7 +321,7 @@ export function createStartAgentDeviceSessionBuildFunction(
|
||||
installAppPath,
|
||||
});
|
||||
} else if (!isIos && (installAppPath || downloadedApp)) {
|
||||
installedAndroidApplication = tasks.run('app install and launch', async taskLogger => {
|
||||
applicationReady = tasks.run('app install and launch', async taskLogger => {
|
||||
await tasks.untilAborted(booted!);
|
||||
const artifactPath = installAppPath ?? (await downloadedApp);
|
||||
if (!artifactPath) {
|
||||
@@ -345,7 +344,6 @@ export function createStartAgentDeviceSessionBuildFunction(
|
||||
env,
|
||||
logger: taskLogger,
|
||||
});
|
||||
return applicationIdentifier;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -376,7 +374,7 @@ export function createStartAgentDeviceSessionBuildFunction(
|
||||
}
|
||||
: {
|
||||
booted,
|
||||
ready: installedAndroidApplication ?? tasks.untilAborted(booted),
|
||||
ready: applicationReady ?? tasks.untilAborted(booted),
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
@@ -390,12 +388,7 @@ export function createStartAgentDeviceSessionBuildFunction(
|
||||
throw error;
|
||||
} finally {
|
||||
tasks.abort(new Error('Agent-device session ended.'));
|
||||
await Promise.allSettled([
|
||||
booted,
|
||||
downloaded,
|
||||
applicationReady,
|
||||
installedAndroidApplication,
|
||||
]);
|
||||
await Promise.allSettled([booted, downloaded, applicationReady]);
|
||||
}
|
||||
};
|
||||
try {
|
||||
|
||||
@@ -5,20 +5,14 @@ import timers from 'node:timers/promises';
|
||||
|
||||
import { CustomBuildContext } from '../../../customBuildContext';
|
||||
import { Sentry } from '../../../sentry';
|
||||
import {
|
||||
DeviceRunSessionArtifactRejectedError,
|
||||
uploadDeviceRunSessionArtifactAsync,
|
||||
} from '../deviceRunSessionArtifacts';
|
||||
import { uploadDeviceRunSessionArtifactAsync } from '../deviceRunSessionArtifacts';
|
||||
import {
|
||||
listAgentDeviceArtifactsAsync,
|
||||
pollAgentDeviceArtifactsForUploadAsync,
|
||||
uploadAgentDeviceArtifactAsync,
|
||||
} from '../agentDeviceArtifacts';
|
||||
|
||||
jest.mock('../deviceRunSessionArtifacts', () => ({
|
||||
...jest.requireActual('../deviceRunSessionArtifacts'),
|
||||
uploadDeviceRunSessionArtifactAsync: jest.fn(),
|
||||
}));
|
||||
jest.mock('../deviceRunSessionArtifacts');
|
||||
jest.mock('../../../sentry');
|
||||
jest.mock('node-fetch');
|
||||
|
||||
@@ -38,16 +32,6 @@ async function flushPromisesAsync(): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
async function waitForUploadCallsAsync(count: number): Promise<void> {
|
||||
for (
|
||||
let i = 0;
|
||||
i < 100 && jest.mocked(uploadDeviceRunSessionArtifactAsync).mock.calls.length < count;
|
||||
i++
|
||||
) {
|
||||
await jest.advanceTimersByTimeAsync(0);
|
||||
}
|
||||
}
|
||||
|
||||
function createLoggerMock(): bunyan {
|
||||
return {
|
||||
info: jest.fn(),
|
||||
@@ -179,7 +163,6 @@ describe(uploadAgentDeviceArtifactAsync, () => {
|
||||
deviceRunSessionId: 'drs-id',
|
||||
daemonUrl: 'http://127.0.0.1:1234',
|
||||
daemonToken: 'daemon-token',
|
||||
request: { idempotencyKey: 'idempotency-key' },
|
||||
logger,
|
||||
artifact: {
|
||||
id: 'artifact-id',
|
||||
@@ -199,7 +182,6 @@ describe(uploadAgentDeviceArtifactAsync, () => {
|
||||
kind: 'agent-device-test-report',
|
||||
size: data.length,
|
||||
openStream: expect.any(Function),
|
||||
idempotencyKey: 'idempotency-key',
|
||||
});
|
||||
});
|
||||
|
||||
@@ -219,7 +201,6 @@ describe(uploadAgentDeviceArtifactAsync, () => {
|
||||
deviceRunSessionId: 'drs-id',
|
||||
daemonUrl: 'http://127.0.0.1:1234',
|
||||
daemonToken: 'daemon-token',
|
||||
request: { idempotencyKey: 'idempotency-key' },
|
||||
logger,
|
||||
artifact: {
|
||||
id: 'artifact-id',
|
||||
@@ -255,7 +236,6 @@ describe(uploadAgentDeviceArtifactAsync, () => {
|
||||
deviceRunSessionId: 'drs-id',
|
||||
daemonUrl: 'http://127.0.0.1:1234',
|
||||
daemonToken: 'daemon-token',
|
||||
request: { idempotencyKey: 'idempotency-key' },
|
||||
logger,
|
||||
artifact: {
|
||||
id: 'artifact-id',
|
||||
@@ -296,7 +276,6 @@ describe(uploadAgentDeviceArtifactAsync, () => {
|
||||
deviceRunSessionId: 'drs-id',
|
||||
daemonUrl: 'http://127.0.0.1:1234',
|
||||
daemonToken: 'daemon-token',
|
||||
request: { idempotencyKey: 'idempotency-key' },
|
||||
logger,
|
||||
artifact: { id: 'artifact-id', artifactType: 'screenshot', filename: 'shot.png' },
|
||||
});
|
||||
@@ -326,7 +305,6 @@ describe(uploadAgentDeviceArtifactAsync, () => {
|
||||
deviceRunSessionId: 'drs-id',
|
||||
daemonUrl: 'http://127.0.0.1:1234',
|
||||
daemonToken: 'daemon-token',
|
||||
request: { idempotencyKey: 'idempotency-key' },
|
||||
logger: createLoggerMock(),
|
||||
artifact: { id: 'artifact-id', artifactType: 'screen-recording', filename: 'session.mp4' },
|
||||
});
|
||||
@@ -649,7 +627,7 @@ describe(pollAgentDeviceArtifactsForUploadAsync, () => {
|
||||
expect(Sentry.capture).toHaveBeenCalledTimes(2);
|
||||
});
|
||||
|
||||
it('retries an artifact with its first idempotency key and gives each artifact its own key', async () => {
|
||||
it('retries an artifact after a failed upload', async () => {
|
||||
const data = Buffer.from('artifact-data');
|
||||
const logger = createLoggerMock();
|
||||
const ctx = {} as unknown as CustomBuildContext;
|
||||
@@ -657,24 +635,18 @@ describe(pollAgentDeviceArtifactsForUploadAsync, () => {
|
||||
id: 'artifact-id',
|
||||
filename: 'report.json',
|
||||
};
|
||||
const otherArtifact = {
|
||||
id: 'other-artifact-id',
|
||||
filename: 'other.json',
|
||||
};
|
||||
const listResponse = () =>
|
||||
new Response(JSON.stringify({ artifacts: [artifact, otherArtifact] }));
|
||||
const listResponse = () => new Response(JSON.stringify({ artifacts: [artifact] }));
|
||||
|
||||
jest
|
||||
.mocked(fetch)
|
||||
.mockResolvedValueOnce(listResponse())
|
||||
.mockResolvedValueOnce(new Response(Readable.from([data])))
|
||||
.mockResolvedValueOnce(new Response(Readable.from([data])))
|
||||
.mockResolvedValueOnce(listResponse())
|
||||
.mockResolvedValueOnce(new Response(Readable.from([data])));
|
||||
jest
|
||||
.mocked(uploadDeviceRunSessionArtifactAsync)
|
||||
.mockRejectedValueOnce(new Error('upload failed'))
|
||||
.mockImplementation(async (_ctx, { openStream }) => {
|
||||
.mockImplementationOnce(async (_ctx, { openStream }) => {
|
||||
await readStreamAsync(openStream());
|
||||
});
|
||||
|
||||
@@ -686,98 +658,12 @@ describe(pollAgentDeviceArtifactsForUploadAsync, () => {
|
||||
});
|
||||
|
||||
await flushPromisesAsync();
|
||||
expect(jest.mocked(uploadDeviceRunSessionArtifactAsync)).toHaveBeenCalledTimes(2);
|
||||
|
||||
await jest.advanceTimersByTimeAsync(5_000);
|
||||
await flushPromisesAsync();
|
||||
|
||||
const calls = jest
|
||||
.mocked(uploadDeviceRunSessionArtifactAsync)
|
||||
.mock.calls.map(([, { artifactId, idempotencyKey }]) => ({ artifactId, idempotencyKey }));
|
||||
expect(calls.map(call => call.artifactId)).toEqual([
|
||||
'artifact-id',
|
||||
'other-artifact-id',
|
||||
'artifact-id',
|
||||
]);
|
||||
expect(calls[0].idempotencyKey).toEqual(expect.any(String));
|
||||
expect(calls[2].idempotencyKey).toBe(calls[0].idempotencyKey);
|
||||
expect(calls[1].idempotencyKey).not.toBe(calls[0].idempotencyKey);
|
||||
});
|
||||
|
||||
it('does not retry an artifact that EAS rejects', async () => {
|
||||
const data = Buffer.from('artifact-data');
|
||||
const logger = createLoggerMock();
|
||||
const ctx = {} as unknown as CustomBuildContext;
|
||||
const listResponse = () =>
|
||||
new Response(JSON.stringify({ artifacts: [{ id: 'artifact-id', filename: 'report.json' }] }));
|
||||
|
||||
jest
|
||||
.mocked(fetch)
|
||||
.mockResolvedValueOnce(listResponse())
|
||||
.mockResolvedValueOnce(new Response(Readable.from([data])))
|
||||
.mockResolvedValueOnce(listResponse());
|
||||
jest
|
||||
.mocked(uploadDeviceRunSessionArtifactAsync)
|
||||
.mockRejectedValueOnce(new DeviceRunSessionArtifactRejectedError('Rejected.'));
|
||||
|
||||
void pollAgentDeviceArtifactsForUploadAsync(ctx, {
|
||||
deviceRunSessionId: 'drs-id',
|
||||
daemonUrl: 'http://127.0.0.1:1234',
|
||||
daemonToken: 'daemon-token',
|
||||
logger,
|
||||
});
|
||||
|
||||
await flushPromisesAsync();
|
||||
await jest.advanceTimersByTimeAsync(5_000);
|
||||
await flushPromisesAsync();
|
||||
|
||||
expect(jest.mocked(fetch)).toHaveBeenCalledTimes(3);
|
||||
expect(jest.mocked(uploadDeviceRunSessionArtifactAsync)).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('sends the first metadata again when it retries an artifact', async () => {
|
||||
const png = Buffer.from(
|
||||
'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+aF9sAAAAASUVORK5CYII=',
|
||||
'base64'
|
||||
);
|
||||
const logger = createLoggerMock();
|
||||
const ctx = {} as unknown as CustomBuildContext;
|
||||
const listResponse = () =>
|
||||
new Response(
|
||||
JSON.stringify({
|
||||
artifacts: [{ id: 'artifact-id', artifactType: 'screenshot', filename: 'shot.png' }],
|
||||
})
|
||||
);
|
||||
|
||||
jest
|
||||
.mocked(fetch)
|
||||
.mockResolvedValueOnce(listResponse())
|
||||
.mockResolvedValueOnce(new Response(Readable.from([Buffer.from('not-an-image')])))
|
||||
.mockResolvedValueOnce(listResponse())
|
||||
.mockResolvedValueOnce(new Response(Readable.from([png])));
|
||||
jest
|
||||
.mocked(uploadDeviceRunSessionArtifactAsync)
|
||||
.mockRejectedValueOnce(new Error('upload failed'))
|
||||
.mockImplementation(async (_ctx, { openStream }) => {
|
||||
await readStreamAsync(openStream());
|
||||
});
|
||||
|
||||
void pollAgentDeviceArtifactsForUploadAsync(ctx, {
|
||||
deviceRunSessionId: 'drs-id',
|
||||
daemonUrl: 'http://127.0.0.1:1234',
|
||||
daemonToken: 'daemon-token',
|
||||
logger,
|
||||
});
|
||||
|
||||
await waitForUploadCallsAsync(1);
|
||||
await jest.advanceTimersByTimeAsync(5_000);
|
||||
await waitForUploadCallsAsync(2);
|
||||
await flushPromisesAsync();
|
||||
|
||||
expect(
|
||||
jest
|
||||
.mocked(uploadDeviceRunSessionArtifactAsync)
|
||||
.mock.calls.map(([, { metadata }]) => metadata)
|
||||
).toEqual([{ source: 'agent-device' }, { source: 'agent-device' }]);
|
||||
expect(jest.mocked(uploadDeviceRunSessionArtifactAsync)).toHaveBeenCalledTimes(2);
|
||||
});
|
||||
|
||||
it('stops polling when the daemon does not expose artifact inventory', async () => {
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
import { SystemError } from '@expo/eas-build-job';
|
||||
import fetch from 'node-fetch';
|
||||
import { Readable } from 'node:stream';
|
||||
|
||||
import { CustomBuildContext } from '../../../customBuildContext';
|
||||
import { turtleFetch } from '../../../utils/turtleFetch';
|
||||
import {
|
||||
DeviceRunSessionArtifactRejectedError,
|
||||
uploadDeviceRunSessionArtifactAsync,
|
||||
} from '../deviceRunSessionArtifacts';
|
||||
import { uploadDeviceRunSessionArtifactAsync } from '../deviceRunSessionArtifacts';
|
||||
import { DEVICE_RUN_SESSION_TOKEN_HEADER } from '../deviceRunSessionWorkerApi';
|
||||
|
||||
jest.mock('node-fetch');
|
||||
@@ -17,26 +13,13 @@ const { Response } = jest.requireActual('node-fetch') as typeof import('node-fet
|
||||
|
||||
const TOKEN = 'device-run-session-token-value';
|
||||
|
||||
function jsonResponse(body: unknown, status = 200): InstanceType<typeof Response> {
|
||||
function jsonResponse(body: unknown): InstanceType<typeof Response> {
|
||||
return new Response(JSON.stringify(body), {
|
||||
status,
|
||||
status: 200,
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
});
|
||||
}
|
||||
|
||||
const uploadSessionResponse = () =>
|
||||
jsonResponse({ data: { uploadSession: { url: 'https://uploads.expo.test/a', headers: {} } } });
|
||||
|
||||
const artifact = {
|
||||
deviceRunSessionId: 'drs-id',
|
||||
artifactId: 'artifact-id',
|
||||
name: 'Screenshot',
|
||||
filename: 'screenshot.png',
|
||||
kind: 'screenshot',
|
||||
size: 0,
|
||||
openStream: () => Readable.from([]),
|
||||
};
|
||||
|
||||
function createCtx(): CustomBuildContext {
|
||||
return {
|
||||
env: { EAS_DEVICE_RUN_SESSION_TOKEN: TOKEN },
|
||||
@@ -77,17 +60,13 @@ describe(uploadDeviceRunSessionArtifactAsync, () => {
|
||||
metadata: { firstFrameRecordAt: 'test-time' },
|
||||
size: reportedSize,
|
||||
openStream: () => stream,
|
||||
idempotencyKey: 'idempotency-key',
|
||||
});
|
||||
|
||||
expect(jest.mocked(turtleFetch)).toHaveBeenCalledWith(
|
||||
'https://api.expo.test/v2/device-run-session-worker/artifact-upload-sessions',
|
||||
'POST',
|
||||
expect.objectContaining({
|
||||
headers: {
|
||||
[DEVICE_RUN_SESSION_TOKEN_HEADER]: TOKEN,
|
||||
'Idempotency-Key': 'idempotency-key',
|
||||
},
|
||||
headers: { [DEVICE_RUN_SESSION_TOKEN_HEADER]: TOKEN },
|
||||
json: {
|
||||
name: 'Artifact report.json (artifact-id)',
|
||||
filename: 'report.json',
|
||||
@@ -137,84 +116,4 @@ describe(uploadDeviceRunSessionArtifactAsync, () => {
|
||||
expect(allocationSignal).toBeInstanceOf(AbortSignal);
|
||||
expect(allocationSignal?.aborted).toBe(true);
|
||||
});
|
||||
|
||||
it('sends a new idempotency key for each upload without one', async () => {
|
||||
jest
|
||||
.mocked(turtleFetch)
|
||||
.mockResolvedValueOnce(uploadSessionResponse())
|
||||
.mockResolvedValueOnce(uploadSessionResponse());
|
||||
jest.mocked(fetch).mockResolvedValue(new Response('', { status: 200 }));
|
||||
|
||||
await uploadDeviceRunSessionArtifactAsync(createCtx(), artifact);
|
||||
await uploadDeviceRunSessionArtifactAsync(createCtx(), artifact);
|
||||
|
||||
const [first, second] = jest
|
||||
.mocked(turtleFetch)
|
||||
.mock.calls.map(
|
||||
([, , options]) => (options.headers as Record<string, string>)['Idempotency-Key']
|
||||
);
|
||||
expect(first).toEqual(expect.any(String));
|
||||
expect(second).toEqual(expect.any(String));
|
||||
expect(second).not.toBe(first);
|
||||
});
|
||||
|
||||
it.each([
|
||||
{
|
||||
status: 409,
|
||||
code: 'ARTIFACT_NAME_CONFLICT',
|
||||
message:
|
||||
'Device run session already has an artifact named "Screenshot". Use a different name for this artifact.',
|
||||
},
|
||||
{
|
||||
status: 400,
|
||||
code: 'VALIDATION_ERROR',
|
||||
message: 'Device run session backing job run has finished.',
|
||||
},
|
||||
{
|
||||
status: 403,
|
||||
code: 'UNAUTHORIZED',
|
||||
message:
|
||||
'You are not authorized to create artifact upload sessions for this device run session.',
|
||||
},
|
||||
{ status: 409, code: 'OTHER_CONFLICT', message: 'Failed.' },
|
||||
])(
|
||||
'reports HTTP $status $code as a rejected upload session',
|
||||
async ({ status, code, message }) => {
|
||||
jest
|
||||
.mocked(turtleFetch)
|
||||
.mockResolvedValueOnce(jsonResponse({ errors: [{ code, message }] }, status));
|
||||
|
||||
await expect(
|
||||
uploadDeviceRunSessionArtifactAsync(createCtx(), artifact)
|
||||
).rejects.toBeInstanceOf(DeviceRunSessionArtifactRejectedError);
|
||||
expect(fetch).not.toHaveBeenCalled();
|
||||
}
|
||||
);
|
||||
|
||||
it.each([
|
||||
{
|
||||
description: 'HTTP 429',
|
||||
respond: async () => jsonResponse({ errors: [{ message: 'Too many requests.' }] }, 429),
|
||||
},
|
||||
{
|
||||
description: 'HTTP 500',
|
||||
respond: async () =>
|
||||
jsonResponse({ errors: [{ code: 'UNEXPECTED_ERROR', message: 'Failed.' }] }, 500),
|
||||
},
|
||||
{
|
||||
description: 'no response',
|
||||
respond: async () => {
|
||||
throw new Error('socket hang up');
|
||||
},
|
||||
},
|
||||
])('does not report $description as a rejected upload session', async ({ respond }) => {
|
||||
jest.mocked(turtleFetch).mockImplementationOnce(respond);
|
||||
|
||||
const error = await uploadDeviceRunSessionArtifactAsync(createCtx(), artifact).catch(
|
||||
(err: unknown) => err
|
||||
);
|
||||
|
||||
expect(error).toBeInstanceOf(SystemError);
|
||||
expect(error).not.toBeInstanceOf(DeviceRunSessionArtifactRejectedError);
|
||||
});
|
||||
});
|
||||
@@ -7,21 +7,14 @@ import path from 'node:path';
|
||||
|
||||
import type { CustomBuildContext } from '../../../customBuildContext';
|
||||
import { Sentry } from '../../../sentry';
|
||||
import {
|
||||
type ArtifactUploadRequest,
|
||||
DeviceRunSessionArtifactRejectedError,
|
||||
uploadDeviceRunSessionArtifactAsync,
|
||||
} from '../deviceRunSessionArtifacts';
|
||||
import { uploadDeviceRunSessionArtifactAsync } from '../deviceRunSessionArtifacts';
|
||||
import { createScreenshotMetadataAsync } from '../deviceRunSessionScreenshotMetadata';
|
||||
import {
|
||||
startDeviceRunSessionScreenshotsAsync,
|
||||
uploadDeviceRunSessionScreenshotsAsync,
|
||||
} from '../deviceRunSessionScreenshots';
|
||||
|
||||
jest.mock('../deviceRunSessionArtifacts', () => ({
|
||||
...jest.requireActual('../deviceRunSessionArtifacts'),
|
||||
uploadDeviceRunSessionArtifactAsync: jest.fn(),
|
||||
}));
|
||||
jest.mock('../deviceRunSessionArtifacts');
|
||||
jest.mock('../deviceRunSessionScreenshotMetadata');
|
||||
jest.mock('../../../sentry');
|
||||
const ctx = {} as CustomBuildContext;
|
||||
@@ -29,10 +22,7 @@ const logger = { info: jest.fn(), warn: jest.fn() } as unknown as bunyan;
|
||||
const options = { deviceRunSessionId: 'session-id', logger };
|
||||
let directory: string;
|
||||
let uploaded: Buffer[];
|
||||
let failedUploads: Map<
|
||||
string,
|
||||
{ attempts: number; lastError: Error; request: ArtifactUploadRequest }
|
||||
>;
|
||||
let failedUploads: Map<string, { attempts: number; lastError: Error }>;
|
||||
|
||||
beforeEach(async () => {
|
||||
jest.clearAllMocks();
|
||||
@@ -101,11 +91,7 @@ it('uploads captures that never failed first, oldest first, before retrying fail
|
||||
for (const name of [newer, failed, older]) {
|
||||
await writeFile(path.join(directory, name), name);
|
||||
}
|
||||
failedUploads.set(failed, {
|
||||
attempts: 1,
|
||||
lastError: new Error('stalled'),
|
||||
request: { idempotencyKey: 'failed-key' },
|
||||
});
|
||||
failedUploads.set(failed, { attempts: 1, lastError: new Error('stalled') });
|
||||
await flush();
|
||||
expect(
|
||||
jest
|
||||
@@ -138,57 +124,6 @@ it('keeps failed uploads and retries the same artifact ID, logging the failed at
|
||||
expect(Sentry.capture).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('retries a screenshot with its first idempotency key and gives each screenshot its own key', async () => {
|
||||
const first = 'screenshot-2026-09-24T08-45-00-000Z-aaaaaaaaaaaa.png';
|
||||
const second = 'screenshot-2026-09-24T08-45-30-000Z-bbbbbbbbbbbb.png';
|
||||
await writeFile(path.join(directory, first), 'png');
|
||||
await writeFile(path.join(directory, second), 'png');
|
||||
jest.mocked(uploadDeviceRunSessionArtifactAsync).mockRejectedValueOnce(new Error('offline'));
|
||||
await flush();
|
||||
await flush();
|
||||
const calls = jest
|
||||
.mocked(uploadDeviceRunSessionArtifactAsync)
|
||||
.mock.calls.map(([, { artifactId, idempotencyKey }]) => ({ artifactId, idempotencyKey }));
|
||||
expect(calls.map(call => call.artifactId)).toEqual(
|
||||
[first, second, first].map(name => name.slice(0, -4))
|
||||
);
|
||||
expect(calls[0].idempotencyKey).toEqual(expect.any(String));
|
||||
expect(calls[2].idempotencyKey).toBe(calls[0].idempotencyKey);
|
||||
expect(calls[1].idempotencyKey).not.toBe(calls[0].idempotencyKey);
|
||||
});
|
||||
|
||||
it('keeps a screenshot that EAS rejects without retrying it', async () => {
|
||||
const filename = 'screenshot-2026-09-24T08-45-59-123Z-ffffffffffff.png';
|
||||
await writeFile(path.join(directory, filename), 'png');
|
||||
jest
|
||||
.mocked(uploadDeviceRunSessionArtifactAsync)
|
||||
.mockRejectedValueOnce(new DeviceRunSessionArtifactRejectedError('Rejected.'));
|
||||
await flush();
|
||||
await flush();
|
||||
expect(uploadDeviceRunSessionArtifactAsync).toHaveBeenCalledTimes(1);
|
||||
expect(await readdir(directory)).toEqual([filename]);
|
||||
expect(logger.warn).toHaveBeenCalledWith(
|
||||
expect.objectContaining({ attempt: 1 }),
|
||||
'EAS rejected the preview screenshot upload. Not retrying it.'
|
||||
);
|
||||
});
|
||||
|
||||
it('sends the first metadata again when it retries a screenshot', async () => {
|
||||
const filename = 'screenshot-2026-09-24T08-45-59-123Z-ffffffffffff.png';
|
||||
await writeFile(path.join(directory, filename), 'png');
|
||||
jest.mocked(createScreenshotMetadataAsync).mockResolvedValueOnce({ source: 'manual' });
|
||||
jest.mocked(uploadDeviceRunSessionArtifactAsync).mockRejectedValueOnce(new Error('offline'));
|
||||
await flush();
|
||||
await flush();
|
||||
expect(
|
||||
jest.mocked(uploadDeviceRunSessionArtifactAsync).mock.calls.map(([, { metadata }]) => metadata)
|
||||
).toEqual([
|
||||
{ __eas_type: 'screenshot', source: 'manual' },
|
||||
{ __eas_type: 'screenshot', source: 'manual' },
|
||||
]);
|
||||
expect(createScreenshotMetadataAsync).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('uploads atomic captures immediately, including a capture arriving during another upload', async () => {
|
||||
jest.useFakeTimers();
|
||||
const collector = await startDeviceRunSessionScreenshotsAsync(ctx, options);
|
||||
@@ -309,7 +244,6 @@ it('warns for the first three attempts and every tenth after, without reporting
|
||||
expect(failedUploads.get(filename)).toEqual({
|
||||
attempts: 12,
|
||||
lastError: expect.objectContaining({ message: 'offline' }),
|
||||
request: expect.objectContaining({ idempotencyKey: expect.any(String) }),
|
||||
});
|
||||
expect(Sentry.capture).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
+1
-4
@@ -210,10 +210,7 @@ it('keeps the signed upload URL out of the error when the upload connection drop
|
||||
handle = request => request.socket.destroy();
|
||||
const filename = 'screenshot-2026-09-24T08-45-59-123Z-a1b2c3d4e5f6.png';
|
||||
await writeFile(path.join(directory, filename), 'png');
|
||||
const failedUploads = new Map<
|
||||
string,
|
||||
{ attempts: number; lastError: Error; request: { idempotencyKey: string } }
|
||||
>();
|
||||
const failedUploads = new Map<string, { attempts: number; lastError: Error }>();
|
||||
const logger = { info: jest.fn(), warn: jest.fn() } as unknown as bunyan;
|
||||
await uploadDeviceRunSessionScreenshotsAsync(ctx, {
|
||||
directory,
|
||||
|
||||
@@ -136,15 +136,6 @@ describe(DeviceRunSessionWorkerApi, () => {
|
||||
data: { id: 'drs-id', status: 'stopped' },
|
||||
expected: { id: 'drs-id', status: 'stopped' },
|
||||
},
|
||||
{
|
||||
name: 'stopAsync with a reason',
|
||||
call: (api: DeviceRunSessionWorkerApi) => api.stopAsync({ reason: 'max_duration' }),
|
||||
method: 'POST',
|
||||
route: 'stop',
|
||||
json: { reason: 'max_duration' },
|
||||
data: { id: 'drs-id', status: 'stopped' },
|
||||
expected: { id: 'drs-id', status: 'stopped' },
|
||||
},
|
||||
{
|
||||
name: 'createArtifactUploadSessionAsync',
|
||||
call: (api: DeviceRunSessionWorkerApi) =>
|
||||
@@ -154,11 +145,9 @@ describe(DeviceRunSessionWorkerApi, () => {
|
||||
kind: 'screenshot',
|
||||
size: 12,
|
||||
metadata: { __eas_type: 'screenshot' },
|
||||
idempotencyKey: 'idempotency-key',
|
||||
}),
|
||||
method: 'POST',
|
||||
route: 'artifact-upload-sessions',
|
||||
headers: { 'Idempotency-Key': 'idempotency-key' },
|
||||
json: {
|
||||
name: 'Screenshot',
|
||||
filename: 'screenshot.png',
|
||||
@@ -239,7 +228,7 @@ describe(DeviceRunSessionWorkerApi, () => {
|
||||
},
|
||||
])(
|
||||
'$name calls $method /v2/device-run-session-worker/$route with the session token header',
|
||||
async ({ call, method, route, headers, json, data, expected }) => {
|
||||
async ({ call, method, route, json, data, expected }) => {
|
||||
jest.mocked(turtleFetch).mockResolvedValueOnce(jsonResponse({ data }));
|
||||
|
||||
await expect(call(createApi())).resolves.toEqual(expected);
|
||||
@@ -248,7 +237,7 @@ describe(DeviceRunSessionWorkerApi, () => {
|
||||
const [url, calledMethod, options] = jest.mocked(turtleFetch).mock.calls[0];
|
||||
expect(url).toBe(`https://api.expo.test/v2/device-run-session-worker/${route}`);
|
||||
expect(calledMethod).toBe(method);
|
||||
expect(options.headers).toEqual({ ...headers, [DEVICE_RUN_SESSION_TOKEN_HEADER]: TOKEN });
|
||||
expect(options.headers).toEqual({ [DEVICE_RUN_SESSION_TOKEN_HEADER]: TOKEN });
|
||||
expect(options.json).toEqual(json);
|
||||
expect(options).toEqual(expect.objectContaining({ retries: 0, shouldThrowOnNotOk: false }));
|
||||
}
|
||||
|
||||
-4
@@ -330,10 +330,6 @@ describe('with a device run session token', () => {
|
||||
});
|
||||
|
||||
expectWorkerApiCall('artifact-upload-sessions', 'POST', {
|
||||
headers: {
|
||||
[DEVICE_RUN_SESSION_TOKEN_HEADER]: TOKEN,
|
||||
'Idempotency-Key': expect.any(String),
|
||||
},
|
||||
json: {
|
||||
name: 'Report',
|
||||
filename: 'report.json',
|
||||
|
||||
@@ -190,14 +190,6 @@ function workerApiCallCount(route: string): number {
|
||||
.mock.calls.filter(([url]) => url === `${DEVICE_RUN_SESSION_WORKER_URL}${route}`).length;
|
||||
}
|
||||
|
||||
/** The JSON body of each stop request the worker sent. */
|
||||
function stopRequestBodies(): unknown[] {
|
||||
return jest
|
||||
.mocked(turtleFetch)
|
||||
.mock.calls.filter(([url]) => url === `${DEVICE_RUN_SESSION_WORKER_URL}stop`)
|
||||
.map(([, , options]) => (options as { json?: unknown } | undefined)?.json);
|
||||
}
|
||||
|
||||
/**
|
||||
* Serves session status polls from `results` in order, and idle stops, through the device run
|
||||
* session worker API.
|
||||
@@ -1880,7 +1872,7 @@ describe(waitForDeviceRunSessionStoppedAsync, () => {
|
||||
expect(jest.mocked(turtleFetch)).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('stops the session with max_duration when the maximum duration elapses', async () => {
|
||||
it('returns normally when the maximum duration elapses', async () => {
|
||||
const ctx = createStatusCtxMock([{ status: 'in-progress' }]);
|
||||
const logger = createLoggerMock();
|
||||
const waitPromise = waitForDeviceRunSessionStoppedAsync({
|
||||
@@ -1899,43 +1891,9 @@ describe(waitForDeviceRunSessionStoppedAsync, () => {
|
||||
expect(logger.info).toHaveBeenCalledWith(
|
||||
'Device run session drs-id reached its maximum duration.'
|
||||
);
|
||||
expect(stopRequestBodies()).toEqual([{ reason: 'max_duration' }]);
|
||||
expect(clearTimeoutCallback).toHaveBeenCalledWith(durationTimeout);
|
||||
});
|
||||
|
||||
it('stops with max_duration when the maximum duration interrupts a status poll', async () => {
|
||||
const ctx = createStatusCtxMock([{ error: new Error('The operation was aborted.') }]);
|
||||
const waitPromise = waitForDeviceRunSessionStoppedAsync({
|
||||
ctx,
|
||||
deviceRunSessionId: 'drs-id',
|
||||
logger: createLoggerMock(),
|
||||
maxDurationSeconds: 1,
|
||||
});
|
||||
|
||||
jest.mocked(setTimeoutCallback).mock.calls[0][0]();
|
||||
await waitPromise;
|
||||
|
||||
expect(stopRequestBodies()).toEqual([{ reason: 'max_duration' }]);
|
||||
});
|
||||
|
||||
it('does not stop the session when the build step is canceled', async () => {
|
||||
const ctx = createStatusCtxMock([{ status: 'in-progress' }]);
|
||||
const abortController = new AbortController();
|
||||
const waitPromise = waitForDeviceRunSessionStoppedAsync({
|
||||
ctx,
|
||||
deviceRunSessionId: 'drs-id',
|
||||
logger: createLoggerMock(),
|
||||
maxDurationSeconds: 1,
|
||||
signal: abortController.signal,
|
||||
});
|
||||
|
||||
abortController.abort();
|
||||
jest.mocked(setTimeoutCallback).mock.calls[0][0]();
|
||||
await waitPromise;
|
||||
|
||||
expect(workerApiCallCount('stop')).toBe(0);
|
||||
});
|
||||
|
||||
it('clears the duration timeout when the session stops first', async () => {
|
||||
await waitForDeviceRunSessionStoppedAsync({
|
||||
ctx: createStatusCtxMock([{ status: 'stopped' }]),
|
||||
@@ -2124,7 +2082,6 @@ describe(waitForDeviceRunSessionStoppedAsync, () => {
|
||||
// One minute at the 5-second poll interval is 12 status polls.
|
||||
expect(workerApiCallCount('session')).toBe(12);
|
||||
expect(workerApiCallCount('stop')).toBe(1);
|
||||
expect(stopRequestBodies()).toEqual([{ reason: 'idle_timeout' }]);
|
||||
expect(logger.info).toHaveBeenCalledWith(
|
||||
'Device run session drs-id had no activity for 1 minute(s) (max idle time). Stopping the session.'
|
||||
);
|
||||
@@ -2214,9 +2171,9 @@ describe(waitForDeviceRunSessionStoppedAsync, () => {
|
||||
'Could not mark device run session drs-id as stopped. The session job ends anyway.'
|
||||
);
|
||||
expect(jest.mocked(Sentry).capture).toHaveBeenCalledWith(
|
||||
'Could not mark device run session as stopped',
|
||||
'Could not mark idle device run session as stopped',
|
||||
expect.any(Error),
|
||||
{ level: 'warning', extras: { deviceRunSessionId: 'drs-id', reason: 'idle_timeout' } }
|
||||
{ level: 'warning', extras: { deviceRunSessionId: 'drs-id' } }
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -23,7 +23,7 @@ import { setTimeout as delay } from 'node:timers/promises';
|
||||
import { inspect } from 'node:util';
|
||||
|
||||
import { SandboxArtifactUploadManager, startSandboxArtifactUploadAsync } from '../sandboxArtifacts';
|
||||
import { SandboxWorkerApi } from '../sandboxWorkerApi';
|
||||
import { type SandboxWorkerApi } from '../sandboxWorkerApi';
|
||||
import { WorkerApiError } from '../workerApi';
|
||||
|
||||
const { AbortError, FetchError, Response } = jest.requireActual(
|
||||
@@ -46,7 +46,7 @@ describe('sandbox artifact uploads', () => {
|
||||
createArtifactUploadSessionAsync: jest.Mock;
|
||||
finalizeArtifactAsync: jest.Mock;
|
||||
};
|
||||
let logger: { info: jest.Mock; warn: jest.Mock; error: jest.Mock };
|
||||
let logger: { info: jest.Mock; error: jest.Mock };
|
||||
let uploadArtifactAsync: (options: {
|
||||
filePath: string;
|
||||
name: string;
|
||||
@@ -62,7 +62,7 @@ describe('sandbox artifact uploads', () => {
|
||||
createArtifactUploadSessionAsync: jest.fn(),
|
||||
finalizeArtifactAsync: jest.fn(),
|
||||
};
|
||||
logger = { info: jest.fn(), warn: jest.fn(), error: jest.fn() };
|
||||
logger = { info: jest.fn(), error: jest.fn() };
|
||||
uploadArtifactAsync = async options =>
|
||||
await startSandboxArtifactUploadAsync({
|
||||
workerApi: workerApi as unknown as SandboxWorkerApi,
|
||||
@@ -218,28 +218,13 @@ describe('sandbox artifact uploads', () => {
|
||||
});
|
||||
|
||||
it.each([
|
||||
{
|
||||
status: 409,
|
||||
code: 'ARTIFACT_NAME_CONFLICT',
|
||||
apiMessage:
|
||||
'Sandbox already has an artifact named "Crash log". Use a different name for this artifact.',
|
||||
},
|
||||
{
|
||||
status: 400,
|
||||
code: 'VALIDATION_ERROR',
|
||||
apiMessage:
|
||||
'Sandbox is stopped, so it cannot upload artifacts. Upload artifacts while the sandbox is running.',
|
||||
},
|
||||
{
|
||||
status: 403,
|
||||
code: 'UNAUTHORIZED',
|
||||
apiMessage:
|
||||
'You are not authorized to upload artifacts for this sandbox. Only the user who created the sandbox can upload its artifacts.',
|
||||
},
|
||||
{ status: 400, code: 'VALIDATION_ERROR' },
|
||||
{ status: 403, code: 'UNAUTHORIZED' },
|
||||
])(
|
||||
'rejects a $code upload session error as a bad request with the API message',
|
||||
async ({ status, code, apiMessage }) => {
|
||||
const message = `POST /v2/sandbox-worker/artifact-upload-sessions failed with status ${status}: ${apiMessage}`;
|
||||
async ({ status, code }) => {
|
||||
const message =
|
||||
'POST /v2/sandbox-worker/artifact-upload-sessions failed with status 400: Sandbox already has an artifact named "Crash log". Use a different name for this artifact.';
|
||||
workerApi.createArtifactUploadSessionAsync.mockRejectedValueOnce(
|
||||
new WorkerApiError(message, status, undefined, code)
|
||||
);
|
||||
@@ -261,7 +246,6 @@ describe('sandbox artifact uploads', () => {
|
||||
it.each([
|
||||
{ status: 500, code: 'UNEXPECTED_ERROR' },
|
||||
{ status: 401, code: 'AUTHENTICATION_ERROR' },
|
||||
{ status: 409, code: 'OTHER_CONFLICT' },
|
||||
])('rethrows a $code upload session error unchanged', async ({ status, code }) => {
|
||||
const error = new WorkerApiError('Request failed.', status, undefined, code);
|
||||
workerApi.createArtifactUploadSessionAsync.mockRejectedValueOnce(error);
|
||||
@@ -403,117 +387,6 @@ describe('sandbox artifact uploads', () => {
|
||||
await manager.stoppedPromise;
|
||||
});
|
||||
|
||||
describe('with the sandbox worker API', () => {
|
||||
const uploadSessionsUrl = 'https://api.expo.test/v2/sandbox-worker/artifact-upload-sessions';
|
||||
|
||||
afterEach(() => {
|
||||
jest.useRealTimers();
|
||||
});
|
||||
|
||||
it('retries a failed upload session request with the same idempotency key', async () => {
|
||||
jest.useFakeTimers({ doNotFake: ['nextTick', 'setImmediate', 'queueMicrotask'] });
|
||||
jest
|
||||
.mocked(fetch)
|
||||
.mockResolvedValueOnce(new Response('unavailable', { status: 503 }))
|
||||
.mockResolvedValueOnce(jsonResponse({ data: createdSession }))
|
||||
.mockResolvedValueOnce(new Response('', { status: 200 }))
|
||||
.mockResolvedValueOnce(
|
||||
jsonResponse({ data: { id: ARTIFACT_ID, downloadUrl: DOWNLOAD_URL } })
|
||||
);
|
||||
|
||||
const uploadPromise = uploadWithWorkerApiAsync();
|
||||
while (uploadSessionRequests().length === 0) {
|
||||
await new Promise(resolve => setImmediate(resolve));
|
||||
}
|
||||
await jest.advanceTimersByTimeAsync(1000);
|
||||
const upload = await uploadPromise;
|
||||
|
||||
await expect(upload.completed).resolves.toEqual({
|
||||
status: 'uploaded',
|
||||
downloadUrl: DOWNLOAD_URL,
|
||||
});
|
||||
const keys = uploadSessionRequests().map(
|
||||
([, init]) => (init?.headers as Record<string, string>)['Idempotency-Key']
|
||||
);
|
||||
expect(keys).toEqual([expect.any(String), keys[0]]);
|
||||
});
|
||||
|
||||
it('stops creating the upload session after 25 seconds, before the MCP relay timeout', async () => {
|
||||
jest.useFakeTimers({ doNotFake: ['nextTick', 'setImmediate', 'queueMicrotask'] });
|
||||
jest.mocked(fetch).mockImplementation(
|
||||
async (_url, init) =>
|
||||
await new Promise((_resolve, reject) => {
|
||||
const timer = setTimeout(
|
||||
() => reject(new FetchError('network timeout', 'request-timeout')),
|
||||
init?.timeout
|
||||
);
|
||||
init?.signal?.addEventListener('abort', () => {
|
||||
clearTimeout(timer);
|
||||
reject(new AbortError('The user aborted a request.'));
|
||||
});
|
||||
})
|
||||
);
|
||||
const manager = new SandboxArtifactUploadManager({
|
||||
workerApi: new SandboxWorkerApi('https://api.expo.test/v2/', 'sandbox-worker-token'),
|
||||
logger: logger as unknown as bunyan,
|
||||
signal: new AbortController().signal,
|
||||
});
|
||||
|
||||
const assertion = expect(
|
||||
manager.startAsync({ filePath, name: 'Crash log', yieldTimeMs: 30_000 })
|
||||
).rejects.toThrow(
|
||||
'Could not create an upload session for sandbox artifact "Crash log" within 25 seconds.'
|
||||
);
|
||||
while (uploadSessionRequests().length === 0) {
|
||||
await new Promise(resolve => setImmediate(resolve));
|
||||
}
|
||||
await jest.advanceTimersByTimeAsync(25_000);
|
||||
await assertion;
|
||||
|
||||
const keys = uploadSessionRequests().map(
|
||||
([, init]) => (init?.headers as Record<string, string>)['Idempotency-Key']
|
||||
);
|
||||
expect(keys).toEqual([expect.any(String), keys[0], keys[0]]);
|
||||
});
|
||||
|
||||
it('does not retry an artifact name conflict', async () => {
|
||||
const apiMessage =
|
||||
'Sandbox already has an artifact named "Crash log". Use a different name for this artifact.';
|
||||
jest
|
||||
.mocked(fetch)
|
||||
.mockResolvedValueOnce(
|
||||
jsonResponse({ errors: [{ code: 'ARTIFACT_NAME_CONFLICT', message: apiMessage }] }, 409)
|
||||
);
|
||||
|
||||
await expect(uploadWithWorkerApiAsync()).rejects.toMatchObject({
|
||||
code: SandboxDaemonErrorCode.BAD_REQUEST,
|
||||
message: `POST /v2/sandbox-worker/artifact-upload-sessions failed with status 409: ${apiMessage}`,
|
||||
});
|
||||
expect(fetch).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
async function uploadWithWorkerApiAsync(): ReturnType<typeof startSandboxArtifactUploadAsync> {
|
||||
return await startSandboxArtifactUploadAsync({
|
||||
workerApi: new SandboxWorkerApi('https://api.expo.test/v2/', 'sandbox-worker-token'),
|
||||
logger: logger as unknown as bunyan,
|
||||
filePath,
|
||||
name: 'Crash log',
|
||||
signal: new AbortController().signal,
|
||||
});
|
||||
}
|
||||
|
||||
function uploadSessionRequests(): Parameters<typeof fetch>[] {
|
||||
return jest.mocked(fetch).mock.calls.filter(([url]) => url === uploadSessionsUrl);
|
||||
}
|
||||
|
||||
function jsonResponse(body: unknown, status = 200): InstanceType<typeof Response> {
|
||||
return new Response(JSON.stringify(body), {
|
||||
status,
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function createManager(signal: AbortSignal): SandboxArtifactUploadManager {
|
||||
return new SandboxArtifactUploadManager({
|
||||
workerApi: workerApi as unknown as SandboxWorkerApi,
|
||||
|
||||
@@ -85,7 +85,6 @@ describe(SandboxWorkerApi, () => {
|
||||
call: (api: SandboxWorkerApi) =>
|
||||
api.createArtifactUploadSessionAsync({ name: 'Crash log', filename: 'crash.log', size: 5 }),
|
||||
route: 'artifact-upload-sessions',
|
||||
headers: { 'Idempotency-Key': expect.any(String) },
|
||||
json: { name: 'Crash log', filename: 'crash.log', size: 5 },
|
||||
data: {
|
||||
artifact: { id: ARTIFACT_ID },
|
||||
@@ -106,7 +105,7 @@ describe(SandboxWorkerApi, () => {
|
||||
},
|
||||
])(
|
||||
'$name calls POST /v2/sandbox-worker/$route with the sandbox worker token header',
|
||||
async ({ call, route, headers, json, data, expected }) => {
|
||||
async ({ call, route, json, data, expected }) => {
|
||||
jest.mocked(turtleFetch).mockResolvedValueOnce(jsonResponse({ data }));
|
||||
|
||||
await expect(call(new SandboxWorkerApi(BASE_URL, TOKEN))).resolves.toEqual(expected);
|
||||
@@ -114,35 +113,11 @@ describe(SandboxWorkerApi, () => {
|
||||
const [url, method, options] = jest.mocked(turtleFetch).mock.calls[0];
|
||||
expect(url).toBe(`https://api.expo.test/v2/sandbox-worker/${route}`);
|
||||
expect(method).toBe('POST');
|
||||
expect(options.headers).toEqual({ ...headers, 'expo-sandbox-worker-token': TOKEN });
|
||||
expect(options.headers).toEqual({ 'expo-sandbox-worker-token': TOKEN });
|
||||
expect(options.json).toEqual(json);
|
||||
}
|
||||
);
|
||||
|
||||
it('sends a new idempotency key for each artifact upload session', async () => {
|
||||
jest.mocked(turtleFetch).mockImplementation(async () =>
|
||||
jsonResponse({
|
||||
data: {
|
||||
artifact: { id: ARTIFACT_ID },
|
||||
uploadSession: { url: 'https://uploads.expo.test/a', headers: {} },
|
||||
},
|
||||
})
|
||||
);
|
||||
const api = new SandboxWorkerApi(BASE_URL, TOKEN);
|
||||
|
||||
await api.createArtifactUploadSessionAsync({ name: 'A', filename: 'a.log', size: 1 });
|
||||
await api.createArtifactUploadSessionAsync({ name: 'B', filename: 'b.log', size: 1 });
|
||||
|
||||
const [first, second] = jest
|
||||
.mocked(turtleFetch)
|
||||
.mock.calls.map(
|
||||
([, , options]) => (options.headers as Record<string, string>)['Idempotency-Key']
|
||||
);
|
||||
expect(first).toEqual(expect.any(String));
|
||||
expect(second).toEqual(expect.any(String));
|
||||
expect(second).not.toBe(first);
|
||||
});
|
||||
|
||||
it('escapes the artifact ID in the finalize route', async () => {
|
||||
jest
|
||||
.mocked(turtleFetch)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { ExpoError, SystemError, UserError } from '@expo/eas-build-job';
|
||||
import { once } from 'node:events';
|
||||
import {
|
||||
access,
|
||||
@@ -102,49 +101,6 @@ it.each([
|
||||
expect(attempts).toBe(1);
|
||||
});
|
||||
|
||||
// Shaped like `xcrun simctl install` output for an app whose minimum iOS version is above the Simulator runtime.
|
||||
const NEWER_IOS_REQUIRED_STDERR = [
|
||||
'An error was encountered processing the command (domain=IXUserPresentableErrorDomain):',
|
||||
'Requires a Newer Version of iOS',
|
||||
'“Example” requires a newer version of iOS.',
|
||||
].join('\n');
|
||||
|
||||
async function rejectActionAsync(action: string, stderr: string): Promise<ExpoError> {
|
||||
server.on('connection', socket => {
|
||||
socket.send(JSON.stringify({ ready: true }));
|
||||
socket.on('message', () => socket.send(JSON.stringify({ id: 1, exitCode: 1, stderr })));
|
||||
});
|
||||
const error = await runServeSimActionAsync({ ...request(), action }).catch(err => err);
|
||||
expect(error).toBeInstanceOf(ExpoError);
|
||||
return error;
|
||||
}
|
||||
|
||||
it('classifies an app install that requires a newer iOS version as a user error', async () => {
|
||||
const error = await rejectActionAsync('app.install', NEWER_IOS_REQUIRED_STDERR);
|
||||
expect(error).toBeInstanceOf(UserError);
|
||||
expect(error.toExternalExpoError()).toMatchObject({
|
||||
errorCode: 'EAS_INSTALL_APPLICATION_REQUIRES_NEWER_IOS',
|
||||
message: expect.stringContaining('Choose an iOS Simulator device whose iOS version meets'),
|
||||
});
|
||||
expect((error.cause as Error).message).toContain('Requires a Newer Version of iOS');
|
||||
});
|
||||
|
||||
it.each([
|
||||
[
|
||||
'app.install',
|
||||
'An error was encountered processing the command (domain=IXUserPresentableErrorDomain):\nThis app could not be installed at this time.',
|
||||
],
|
||||
['app.install', 'install refused'],
|
||||
['app.launch', NEWER_IOS_REQUIRED_STDERR],
|
||||
])('keeps other %s failures as server errors', async (action, stderr) => {
|
||||
const error = await rejectActionAsync(action, stderr);
|
||||
expect(error).toBeInstanceOf(SystemError);
|
||||
expect(error.toExternalExpoError()).toMatchObject({
|
||||
errorCode: 'SERVER_ERROR',
|
||||
message: `serve-sim ${action} failed: ${stderr}`,
|
||||
});
|
||||
});
|
||||
|
||||
it('rejects a connection that closes before its action finishes', async () => {
|
||||
server.on('connection', socket => socket.close());
|
||||
await expect(runServeSimActionAsync(request())).rejects.toThrow('closed before completion');
|
||||
|
||||
@@ -192,29 +192,6 @@ describe('worker API retries', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('sends the same idempotency key on every attempt', async () => {
|
||||
jest
|
||||
.mocked(turtleFetch)
|
||||
.mockRejectedValueOnce(new Error('socket hang up'))
|
||||
.mockResolvedValueOnce(new Response('unavailable', { status: 503 }))
|
||||
.mockResolvedValueOnce(jsonResponse({ data: { id: 'thing-id' } }));
|
||||
const assertion = expect(
|
||||
new WorkerApi(BASE_URL, AUTH).requestAsync('POST', 'things', ThingSchema, {
|
||||
json: {},
|
||||
idempotencyKey: 'idempotency-key',
|
||||
retries: 3,
|
||||
})
|
||||
).resolves.toEqual({ id: 'thing-id' });
|
||||
await jest.runAllTimersAsync();
|
||||
await assertion;
|
||||
expect(jest.mocked(turtleFetch).mock.calls.map(([, , options]) => options.headers)).toEqual(
|
||||
Array.from({ length: 3 }, () => ({
|
||||
'expo-test-worker-token': 'test-worker-token-value',
|
||||
'Idempotency-Key': 'idempotency-key',
|
||||
}))
|
||||
);
|
||||
});
|
||||
|
||||
it('recovers from a network failure', async () => {
|
||||
jest
|
||||
.mocked(turtleFetch)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { SystemError, formatBytes } from '@expo/eas-build-job';
|
||||
import { type bunyan } from '@expo/logger';
|
||||
import { randomUUID } from 'node:crypto';
|
||||
import { createReadStream, createWriteStream } from 'node:fs';
|
||||
import { mkdtemp, rm, stat } from 'node:fs/promises';
|
||||
import fetch from 'node-fetch';
|
||||
@@ -12,11 +11,7 @@ import { z } from 'zod';
|
||||
|
||||
import { CustomBuildContext } from '../../customBuildContext';
|
||||
import { Sentry } from '../../sentry';
|
||||
import {
|
||||
type ArtifactUploadRequest,
|
||||
DeviceRunSessionArtifactRejectedError,
|
||||
uploadDeviceRunSessionArtifactAsync,
|
||||
} from './deviceRunSessionArtifacts';
|
||||
import { uploadDeviceRunSessionArtifactAsync } from './deviceRunSessionArtifacts';
|
||||
import { createScreenshotMetadataAsync } from './deviceRunSessionScreenshotMetadata';
|
||||
|
||||
const AGENT_DEVICE_ARTIFACT_UPLOAD_POLL_INTERVAL_MS = 5_000;
|
||||
@@ -63,8 +58,7 @@ export async function pollAgentDeviceArtifactsForUploadAsync(
|
||||
}
|
||||
): Promise<void> {
|
||||
logger.info('Started polling agent-device daemon for artifacts.');
|
||||
const finishedArtifactIds = new Set<string>();
|
||||
const uploadRequests = new Map<string, ArtifactUploadRequest>();
|
||||
const uploadedArtifactIds = new Set<string>();
|
||||
let listArtifactsErrorCount = 0;
|
||||
|
||||
// Ending normal polling must not cancel a transfer that the session already produced.
|
||||
@@ -98,31 +92,23 @@ export async function pollAgentDeviceArtifactsForUploadAsync(
|
||||
});
|
||||
listArtifactsErrorCount = 0;
|
||||
for (const artifact of artifacts) {
|
||||
if (finishedArtifactIds.has(artifact.id)) {
|
||||
if (uploadedArtifactIds.has(artifact.id)) {
|
||||
continue;
|
||||
}
|
||||
const request = uploadRequests.get(artifact.id) ?? { idempotencyKey: randomUUID() };
|
||||
uploadRequests.set(artifact.id, request);
|
||||
try {
|
||||
await uploadAgentDeviceArtifactAsync(ctx, {
|
||||
deviceRunSessionId,
|
||||
daemonUrl,
|
||||
daemonToken,
|
||||
artifact,
|
||||
request,
|
||||
logger,
|
||||
signal: transferSignal,
|
||||
...(transferSignal ? { signal: transferSignal } : {}),
|
||||
});
|
||||
finishedArtifactIds.add(artifact.id);
|
||||
uploadRequests.delete(artifact.id);
|
||||
uploadedArtifactIds.add(artifact.id);
|
||||
} catch (err) {
|
||||
if (transferSignal?.aborted) {
|
||||
return;
|
||||
}
|
||||
if (err instanceof DeviceRunSessionArtifactRejectedError) {
|
||||
finishedArtifactIds.add(artifact.id);
|
||||
uploadRequests.delete(artifact.id);
|
||||
}
|
||||
const error = err instanceof Error ? err : new Error(String(err));
|
||||
Sentry.capture('Could not upload agent-device remote session artifact', error);
|
||||
logger.warn({ err: error }, 'Could not upload agent-device remote session artifact.');
|
||||
@@ -206,7 +192,6 @@ export async function uploadAgentDeviceArtifactAsync(
|
||||
daemonUrl,
|
||||
daemonToken,
|
||||
artifact,
|
||||
request,
|
||||
logger,
|
||||
signal,
|
||||
}: {
|
||||
@@ -214,7 +199,6 @@ export async function uploadAgentDeviceArtifactAsync(
|
||||
daemonUrl: string;
|
||||
daemonToken: string;
|
||||
artifact: AgentDeviceArtifact;
|
||||
request: ArtifactUploadRequest;
|
||||
logger: bunyan;
|
||||
signal?: AbortSignal;
|
||||
}
|
||||
@@ -235,7 +219,7 @@ export async function uploadAgentDeviceArtifactAsync(
|
||||
const display = artifact.displayRotation
|
||||
? { displayRotation: artifact.displayRotation }
|
||||
: undefined;
|
||||
request.metadata ??=
|
||||
const metadata =
|
||||
artifact.artifactType === 'screenshot'
|
||||
? await createScreenshotMetadataAsync(temporaryArtifactPath, {
|
||||
source: 'agent-device',
|
||||
@@ -250,10 +234,9 @@ export async function uploadAgentDeviceArtifactAsync(
|
||||
name: `${artifact.filename} (${artifact.id})`,
|
||||
filename: artifact.filename,
|
||||
kind: artifact.artifactType ?? undefined,
|
||||
...(request.metadata ? { metadata: request.metadata } : {}),
|
||||
...(metadata ? { metadata } : {}),
|
||||
size,
|
||||
openStream: () => createReadStream(temporaryArtifactPath),
|
||||
idempotencyKey: request.idempotencyKey,
|
||||
...(signal ? { signal } : {}),
|
||||
});
|
||||
} finally {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { SystemError } from '@expo/eas-build-job';
|
||||
import { randomUUID } from 'node:crypto';
|
||||
import type { Readable } from 'node:stream';
|
||||
|
||||
import { CustomBuildContext } from '../../customBuildContext';
|
||||
@@ -11,7 +10,6 @@ import {
|
||||
} from '../../storage/uploadWithSignedUrl';
|
||||
import { withDeviceRunSessionTimeoutAsync } from './deviceRunSessionTimeout';
|
||||
import { requireDeviceRunSessionWorkerApi } from './deviceRunSessionWorkerApi';
|
||||
import { WorkerApiError } from './workerApi';
|
||||
|
||||
export type ArtifactMetadata = {
|
||||
deviceRunSessionId: string;
|
||||
@@ -23,30 +21,18 @@ export type ArtifactMetadata = {
|
||||
size: number;
|
||||
};
|
||||
|
||||
export type ArtifactUploadRequest = {
|
||||
idempotencyKey: string;
|
||||
metadata?: Record<string, unknown>;
|
||||
};
|
||||
|
||||
export async function uploadDeviceRunSessionArtifactAsync(
|
||||
ctx: CustomBuildContext,
|
||||
options: ArtifactMetadata & {
|
||||
openStream: () => Readable;
|
||||
signal?: AbortSignal;
|
||||
attempts?: number;
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
): Promise<void> {
|
||||
const idempotencyKey = options.idempotencyKey ?? randomUUID();
|
||||
try {
|
||||
const uploadSession = await withDeviceRunSessionTimeoutAsync(
|
||||
{ name: 'Artifact upload session creation', timeoutMs: 15_000, signal: options.signal },
|
||||
async signal =>
|
||||
await createDeviceRunSessionArtifactUploadSessionAsync(
|
||||
ctx,
|
||||
{ ...options, idempotencyKey },
|
||||
signal
|
||||
)
|
||||
async signal => await createDeviceRunSessionArtifactUploadSessionAsync(ctx, options, signal)
|
||||
);
|
||||
options.signal?.throwIfAborted();
|
||||
await uploadWithSignedUrl(
|
||||
@@ -61,8 +47,6 @@ export async function uploadDeviceRunSessionArtifactAsync(
|
||||
}
|
||||
}
|
||||
|
||||
export class DeviceRunSessionArtifactRejectedError extends SystemError {}
|
||||
|
||||
class DeviceRunSessionArtifactUploadError extends SystemError {
|
||||
constructor(artifactId: string, reason: string) {
|
||||
super(`Failed to upload device run session artifact ${artifactId}: ${reason}.`);
|
||||
@@ -71,16 +55,7 @@ class DeviceRunSessionArtifactUploadError extends SystemError {
|
||||
|
||||
async function createDeviceRunSessionArtifactUploadSessionAsync(
|
||||
ctx: CustomBuildContext,
|
||||
{
|
||||
deviceRunSessionId,
|
||||
artifactId,
|
||||
name,
|
||||
filename,
|
||||
kind,
|
||||
metadata,
|
||||
size,
|
||||
idempotencyKey,
|
||||
}: ArtifactMetadata & { idempotencyKey: string },
|
||||
{ deviceRunSessionId, artifactId, name, filename, kind, metadata, size }: ArtifactMetadata,
|
||||
signal: AbortSignal
|
||||
): Promise<SignedUrl> {
|
||||
const workerApi = requireDeviceRunSessionWorkerApi(ctx);
|
||||
@@ -93,19 +68,17 @@ async function createDeviceRunSessionArtifactUploadSessionAsync(
|
||||
...(kind !== undefined ? { kind } : {}),
|
||||
...(metadata !== undefined ? { metadata } : {}),
|
||||
size,
|
||||
idempotencyKey,
|
||||
},
|
||||
{ signal }
|
||||
);
|
||||
} catch (err) {
|
||||
signal.throwIfAborted();
|
||||
const message = `Failed to create upload session for device run session artifact ${artifactId}: ${
|
||||
err instanceof Error ? err.message : String(err)
|
||||
}`;
|
||||
if (err instanceof WorkerApiError && !err.isTransient) {
|
||||
throw new DeviceRunSessionArtifactRejectedError(message, { cause: err });
|
||||
}
|
||||
throw new SystemError(message, { cause: err });
|
||||
throw new SystemError(
|
||||
`Failed to create upload session for device run session artifact ${artifactId}: ${
|
||||
err instanceof Error ? err.message : String(err)
|
||||
}`,
|
||||
{ cause: err }
|
||||
);
|
||||
}
|
||||
signal.throwIfAborted();
|
||||
return uploadSession;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { formatBytes } from '@expo/eas-build-job';
|
||||
import type { bunyan } from '@expo/logger';
|
||||
import { randomUUID } from 'node:crypto';
|
||||
import { type FSWatcher, createReadStream, watch } from 'node:fs';
|
||||
import { mkdtemp, readFile, readdir, rm, rmdir, stat } from 'node:fs/promises';
|
||||
import os from 'node:os';
|
||||
@@ -9,11 +8,7 @@ import { z } from 'zod';
|
||||
|
||||
import type { CustomBuildContext } from '../../customBuildContext';
|
||||
import { Sentry } from '../../sentry';
|
||||
import {
|
||||
type ArtifactUploadRequest,
|
||||
DeviceRunSessionArtifactRejectedError,
|
||||
uploadDeviceRunSessionArtifactAsync,
|
||||
} from './deviceRunSessionArtifacts';
|
||||
import { uploadDeviceRunSessionArtifactAsync } from './deviceRunSessionArtifacts';
|
||||
import { createScreenshotMetadataAsync } from './deviceRunSessionScreenshotMetadata';
|
||||
import {
|
||||
type ScreenshotSession,
|
||||
@@ -56,10 +51,7 @@ async function reportScreenshotFailureRecordAsync(file: string, logger: bunyan):
|
||||
await rm(file, { force: true });
|
||||
}
|
||||
|
||||
type FailedUploads = Map<
|
||||
string,
|
||||
{ attempts: number; lastError: Error; request: ArtifactUploadRequest }
|
||||
>;
|
||||
type FailedUploads = Map<string, { attempts: number; lastError: Error }>;
|
||||
|
||||
type ScreenshotEntry = { kind: 'failureRecord' } | { kind: 'screenshot'; timestamp: string };
|
||||
|
||||
@@ -82,7 +74,6 @@ async function uploadScreenshotAsync(
|
||||
session,
|
||||
signal,
|
||||
failedUploads,
|
||||
request,
|
||||
logger,
|
||||
}: {
|
||||
file: string;
|
||||
@@ -93,34 +84,31 @@ async function uploadScreenshotAsync(
|
||||
session: Promise<ScreenshotSession | null>;
|
||||
signal: AbortSignal;
|
||||
failedUploads: FailedUploads;
|
||||
request: ArtifactUploadRequest;
|
||||
logger: bunyan;
|
||||
}
|
||||
): Promise<void> {
|
||||
const artifactDetails = screenshotArtifactDetails(timestamp, await session);
|
||||
const startedAt = Date.now();
|
||||
request.metadata ??= {
|
||||
...artifactDetails.metadata,
|
||||
...(await createScreenshotMetadataAsync(file, { source: 'manual', logger })),
|
||||
};
|
||||
await uploadDeviceRunSessionArtifactAsync(ctx, {
|
||||
deviceRunSessionId,
|
||||
artifactId: name.slice(0, -4),
|
||||
name: artifactDetails.name,
|
||||
filename: artifactDetails.filename,
|
||||
metadata: request.metadata,
|
||||
metadata: {
|
||||
...artifactDetails.metadata,
|
||||
...(await createScreenshotMetadataAsync(file, { source: 'manual', logger })),
|
||||
},
|
||||
kind: 'screenshot',
|
||||
size,
|
||||
openStream: () => createReadStream(file),
|
||||
attempts: 3,
|
||||
signal,
|
||||
idempotencyKey: request.idempotencyKey,
|
||||
});
|
||||
await rm(file);
|
||||
const previousFailures = failedUploads.get(name)?.attempts ?? 0;
|
||||
failedUploads.delete(name);
|
||||
// An earlier failed attempt may have created the artifact row without uploading the file.
|
||||
// The retry reuses that row through the Idempotency-Key.
|
||||
// Each earlier failed attempt may have left an artifact row without a file on the server.
|
||||
// The API deletes such rows when the job run finishes (expo/universe#31539).
|
||||
const retryNote =
|
||||
previousFailures > 0
|
||||
? ` after ${previousFailures} failed attempt${previousFailures === 1 ? '' : 's'}`
|
||||
@@ -139,7 +127,6 @@ function recordUploadFailure(
|
||||
size,
|
||||
signal,
|
||||
failedUploads,
|
||||
request,
|
||||
logger,
|
||||
}: {
|
||||
file: string;
|
||||
@@ -147,7 +134,6 @@ function recordUploadFailure(
|
||||
size: number | undefined;
|
||||
signal: AbortSignal;
|
||||
failedUploads: FailedUploads;
|
||||
request: ArtifactUploadRequest;
|
||||
logger: bunyan;
|
||||
}
|
||||
): 'aborted' | 'recorded' {
|
||||
@@ -160,14 +146,7 @@ function recordUploadFailure(
|
||||
}
|
||||
const error = err instanceof Error ? err : new Error(String(err));
|
||||
const attempt = (failedUploads.get(name)?.attempts ?? 0) + 1;
|
||||
failedUploads.set(name, { attempts: attempt, lastError: error, request });
|
||||
if (error instanceof DeviceRunSessionArtifactRejectedError) {
|
||||
logger.warn(
|
||||
{ err: error, file, attempt, size },
|
||||
'EAS rejected the preview screenshot upload. Not retrying it.'
|
||||
);
|
||||
return 'recorded';
|
||||
}
|
||||
failedUploads.set(name, { attempts: attempt, lastError: error });
|
||||
// A sustained outage would otherwise warn for every waiting file on each 30 s scan.
|
||||
if (attempt <= 3 || attempt % 10 === 0) {
|
||||
logger.warn(
|
||||
@@ -223,11 +202,6 @@ export async function uploadDeviceRunSessionScreenshotsAsync(
|
||||
saveFailures++;
|
||||
continue;
|
||||
}
|
||||
const failure = failedUploads.get(entry.name);
|
||||
if (failure?.lastError instanceof DeviceRunSessionArtifactRejectedError) {
|
||||
continue;
|
||||
}
|
||||
const request = failure?.request ?? { idempotencyKey: randomUUID() };
|
||||
let size: number | undefined;
|
||||
try {
|
||||
size = (await stat(file)).size;
|
||||
@@ -240,7 +214,6 @@ export async function uploadDeviceRunSessionScreenshotsAsync(
|
||||
session,
|
||||
signal,
|
||||
failedUploads,
|
||||
request,
|
||||
logger,
|
||||
});
|
||||
uploadedCount++;
|
||||
@@ -254,7 +227,6 @@ export async function uploadDeviceRunSessionScreenshotsAsync(
|
||||
size,
|
||||
signal,
|
||||
failedUploads,
|
||||
request,
|
||||
logger,
|
||||
});
|
||||
if (outcome === 'aborted') {
|
||||
|
||||
@@ -61,12 +61,8 @@ export type CreateDeviceRunSessionArtifactUploadSessionInput = {
|
||||
kind?: string | null;
|
||||
size: number;
|
||||
metadata?: Record<string, unknown> | null;
|
||||
idempotencyKey: string;
|
||||
};
|
||||
|
||||
/** Why the worker stops a session; www stores it as the session's end reason. */
|
||||
export type DeviceRunSessionStopReason = 'idle_timeout' | 'max_duration';
|
||||
|
||||
/**
|
||||
* Client for the www routes under `/v2/device-run-session-worker/`. These routes act only on the
|
||||
* session that the token names.
|
||||
@@ -100,25 +96,19 @@ export class DeviceRunSessionWorkerApi {
|
||||
});
|
||||
}
|
||||
|
||||
public async stopAsync(
|
||||
{ reason }: { reason?: DeviceRunSessionStopReason } = {},
|
||||
options: WorkerApiRequestOptions = {}
|
||||
): Promise<DeviceRunSessionStatus> {
|
||||
return await this.client.requestAsync('POST', 'stop', DeviceRunSessionStatusSchema, {
|
||||
...options,
|
||||
...(reason ? { json: { reason } } : {}),
|
||||
});
|
||||
public async stopAsync(options: WorkerApiRequestOptions = {}): Promise<DeviceRunSessionStatus> {
|
||||
return await this.client.requestAsync('POST', 'stop', DeviceRunSessionStatusSchema, options);
|
||||
}
|
||||
|
||||
public async createArtifactUploadSessionAsync(
|
||||
{ idempotencyKey, ...input }: CreateDeviceRunSessionArtifactUploadSessionInput,
|
||||
input: CreateDeviceRunSessionArtifactUploadSessionInput,
|
||||
options: WorkerApiRequestOptions = {}
|
||||
): Promise<DeviceRunSessionUploadSession> {
|
||||
const { uploadSession } = await this.client.requestAsync(
|
||||
'POST',
|
||||
'artifact-upload-sessions',
|
||||
UploadSessionSchema,
|
||||
{ ...options, json: input, idempotencyKey }
|
||||
{ ...options, json: input }
|
||||
);
|
||||
return uploadSession;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import { BuildStepEnv } from '@expo/steps';
|
||||
import spawn, { SpawnResult } from '@expo/turtle-spawn';
|
||||
import path from 'path';
|
||||
|
||||
import { COMMON_FASTLANE_ENV, DEFAULT_FASTLANE_GYM_ENV } from '../../../common/fastlane';
|
||||
import { COMMON_FASTLANE_ENV } from '../../../common/fastlane';
|
||||
import { XcodeBuildLogger } from '../../../common/xcpretty';
|
||||
|
||||
export async function runFastlaneGym({
|
||||
@@ -25,7 +25,7 @@ export async function runFastlaneGym({
|
||||
await runFastlane(['gym'], {
|
||||
cwd: path.join(workingDir, 'ios'),
|
||||
logger,
|
||||
env: { ...DEFAULT_FASTLANE_GYM_ENV, ...env },
|
||||
env,
|
||||
extraEnv,
|
||||
});
|
||||
} finally {
|
||||
|
||||
@@ -29,7 +29,6 @@ import { createProcessOutput } from './processOutput';
|
||||
import { withDeviceRunSessionTimeoutAsync } from './deviceRunSessionTimeout';
|
||||
import {
|
||||
type DeviceRunSessionStatus,
|
||||
type DeviceRunSessionStopReason,
|
||||
requireDeviceRunSessionWorkerApi,
|
||||
} from './deviceRunSessionWorkerApi';
|
||||
import { WorkerApiError } from './workerApi';
|
||||
@@ -194,12 +193,7 @@ export async function waitForDeviceRunSessionStoppedAsync({
|
||||
`Device run session ${deviceRunSessionId} had no activity for ` +
|
||||
`${idleTimeout.maxIdleTimeMinutes} minute(s) (max idle time). Stopping the session.`
|
||||
);
|
||||
await ensureDeviceRunSessionStoppedSafelyAsync({
|
||||
ctx,
|
||||
deviceRunSessionId,
|
||||
logger,
|
||||
reason: 'idle_timeout',
|
||||
});
|
||||
await ensureDeviceRunSessionStoppedSafelyAsync({ ctx, deviceRunSessionId, logger });
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -218,7 +212,7 @@ export async function waitForDeviceRunSessionStoppedAsync({
|
||||
throw err;
|
||||
}
|
||||
if (signal.aborted) {
|
||||
break;
|
||||
return;
|
||||
}
|
||||
|
||||
const error = err instanceof Error ? err : new Error(String(err));
|
||||
@@ -233,15 +227,6 @@ export async function waitForDeviceRunSessionStoppedAsync({
|
||||
}
|
||||
await sleepUntilAbortedAsync(DEVICE_RUN_SESSION_STATUS_POLL_INTERVAL_MS, signal);
|
||||
}
|
||||
// Stop through the worker route so www records the reason; a canceled step is not a max-duration end.
|
||||
if (durationAbortController.signal.aborted && !cancelSignal?.aborted) {
|
||||
await ensureDeviceRunSessionStoppedSafelyAsync({
|
||||
ctx,
|
||||
deviceRunSessionId,
|
||||
logger,
|
||||
reason: 'max_duration',
|
||||
});
|
||||
}
|
||||
} finally {
|
||||
if (durationTimeout !== undefined) {
|
||||
clearTimeout(durationTimeout);
|
||||
@@ -269,23 +254,20 @@ async function ensureDeviceRunSessionStoppedSafelyAsync({
|
||||
ctx,
|
||||
deviceRunSessionId,
|
||||
logger,
|
||||
reason,
|
||||
}: {
|
||||
ctx: CustomBuildContext;
|
||||
deviceRunSessionId: string;
|
||||
logger: bunyan;
|
||||
reason: DeviceRunSessionStopReason;
|
||||
}): Promise<void> {
|
||||
try {
|
||||
await requireDeviceRunSessionWorkerApi(ctx).stopAsync(
|
||||
{ reason },
|
||||
{ timeoutMs: DEVICE_RUN_SESSION_WORKER_REQUEST_TIMEOUT_MS }
|
||||
);
|
||||
await requireDeviceRunSessionWorkerApi(ctx).stopAsync({
|
||||
timeoutMs: DEVICE_RUN_SESSION_WORKER_REQUEST_TIMEOUT_MS,
|
||||
});
|
||||
} catch (err) {
|
||||
const error = err instanceof Error ? err : new Error(String(err));
|
||||
Sentry.capture('Could not mark device run session as stopped', error, {
|
||||
Sentry.capture('Could not mark idle device run session as stopped', error, {
|
||||
level: 'warning',
|
||||
extras: { deviceRunSessionId, reason },
|
||||
extras: { deviceRunSessionId },
|
||||
});
|
||||
logger.warn(
|
||||
{ err: error },
|
||||
|
||||
@@ -15,15 +15,8 @@ import { type SandboxArtifactUploadSession, type SandboxWorkerApi } from './sand
|
||||
import { WorkerApiError } from './workerApi';
|
||||
|
||||
const WORKER_API_REQUEST_TIMEOUT_MS = 15_000;
|
||||
const UPLOAD_SESSION_RETRIES = 2;
|
||||
const UPLOAD_SESSION_ATTEMPT_TIMEOUT_MS = 8_000;
|
||||
const UPLOAD_SESSION_DEADLINE_MS = 25_000;
|
||||
const FINALIZE_RETRIES = 2;
|
||||
const REJECTED_UPLOAD_SESSION_ERROR_CODES = new Set([
|
||||
'VALIDATION_ERROR',
|
||||
'UNAUTHORIZED',
|
||||
'ARTIFACT_NAME_CONFLICT',
|
||||
]);
|
||||
const REJECTED_UPLOAD_SESSION_ERROR_CODES = new Set(['VALIDATION_ERROR', 'UNAUTHORIZED']);
|
||||
|
||||
type SandboxArtifactUploadOutcome =
|
||||
| { status: 'uploaded'; downloadUrl: string }
|
||||
@@ -131,7 +124,7 @@ export async function startSandboxArtifactUploadAsync({
|
||||
} = await createSandboxArtifactUploadSessionAsync(
|
||||
workerApi,
|
||||
{ name, filename: path.basename(filePath), size },
|
||||
{ signal, logger }
|
||||
signal
|
||||
);
|
||||
const completed = (async (): Promise<SandboxArtifactUploadOutcome> => {
|
||||
logger.info(`Uploading sandbox artifact "${name}" (${artifactId}, ${size} bytes).`);
|
||||
@@ -165,30 +158,15 @@ export async function startSandboxArtifactUploadAsync({
|
||||
async function createSandboxArtifactUploadSessionAsync(
|
||||
workerApi: SandboxWorkerApi,
|
||||
input: { name: string; filename: string; size: number },
|
||||
{ signal, logger }: { signal: AbortSignal; logger: bunyan }
|
||||
signal: AbortSignal
|
||||
): Promise<SandboxArtifactUploadSession> {
|
||||
const deadline = new AbortController();
|
||||
const deadlineTimer = setTimeout(
|
||||
() =>
|
||||
deadline.abort(
|
||||
new Error(
|
||||
`Could not create an upload session for sandbox artifact "${input.name}" within ${
|
||||
UPLOAD_SESSION_DEADLINE_MS / 1000
|
||||
} seconds.`
|
||||
)
|
||||
),
|
||||
UPLOAD_SESSION_DEADLINE_MS
|
||||
);
|
||||
try {
|
||||
return await workerApi.createArtifactUploadSessionAsync(input, {
|
||||
signal: AbortSignal.any([signal, deadline.signal]),
|
||||
timeoutMs: UPLOAD_SESSION_ATTEMPT_TIMEOUT_MS,
|
||||
retries: UPLOAD_SESSION_RETRIES,
|
||||
logger,
|
||||
signal,
|
||||
timeoutMs: WORKER_API_REQUEST_TIMEOUT_MS,
|
||||
});
|
||||
} catch (error) {
|
||||
signal.throwIfAborted();
|
||||
deadline.signal.throwIfAborted();
|
||||
if (
|
||||
error instanceof WorkerApiError &&
|
||||
error.code !== undefined &&
|
||||
@@ -199,8 +177,6 @@ async function createSandboxArtifactUploadSessionAsync(
|
||||
});
|
||||
}
|
||||
throw error;
|
||||
} finally {
|
||||
clearTimeout(deadlineTimer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { type Env, type EnvironmentSecret, type Job, SystemError } from '@expo/eas-build-job';
|
||||
import { randomUUID } from 'node:crypto';
|
||||
import { z } from 'zod';
|
||||
|
||||
import {
|
||||
@@ -66,7 +65,7 @@ export class SandboxWorkerApi {
|
||||
'POST',
|
||||
'artifact-upload-sessions',
|
||||
ArtifactUploadSessionSchema,
|
||||
{ ...options, json: input, idempotencyKey: randomUUID() }
|
||||
{ ...options, json: input }
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SystemError, UserError } from '@expo/eas-build-job';
|
||||
import { SystemError } from '@expo/eas-build-job';
|
||||
import { constants } from 'node:fs';
|
||||
import { cp, mkdir, mkdtemp, realpath, rm } from 'node:fs/promises';
|
||||
import os from 'node:os';
|
||||
@@ -104,11 +104,8 @@ export async function runServeSimActionWithResultAsync({
|
||||
finish(
|
||||
reply.exitCode === 0
|
||||
? undefined
|
||||
: createServeSimActionError(
|
||||
action,
|
||||
(typeof reply.error === 'string' && reply.error) ||
|
||||
(typeof reply.stderr === 'string' && reply.stderr) ||
|
||||
'invalid response'
|
||||
: new SystemError(
|
||||
`serve-sim ${action} failed: ${(typeof reply.error === 'string' && reply.error) || (typeof reply.stderr === 'string' && reply.stderr) || 'invalid response'}`
|
||||
),
|
||||
typeof reply.stdout === 'string' ? reply.stdout : ''
|
||||
);
|
||||
@@ -119,18 +116,3 @@ export async function runServeSimActionWithResultAsync({
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// simctl's IXUserPresentableErrorDomain message when the app's minimum iOS version is above the Simulator runtime.
|
||||
const NEWER_IOS_REQUIRED_MESSAGE = 'Requires a Newer Version of iOS';
|
||||
|
||||
function createServeSimActionError(action: string, detail: string): Error {
|
||||
const message = `serve-sim ${action} failed: ${detail}`;
|
||||
if (action === 'app.install' && detail.includes(NEWER_IOS_REQUIRED_MESSAGE)) {
|
||||
return new UserError(
|
||||
'EAS_INSTALL_APPLICATION_REQUIRES_NEWER_IOS',
|
||||
"This app requires a newer iOS version than the selected iOS Simulator runs. Choose an iOS Simulator device whose iOS version meets the app's minimum iOS version, or lower the app's iOS deployment target.",
|
||||
{ cause: new Error(message) }
|
||||
);
|
||||
}
|
||||
return new SystemError(message);
|
||||
}
|
||||
@@ -26,11 +26,6 @@ export type WorkerApiRequestOptions = {
|
||||
logger?: bunyan;
|
||||
};
|
||||
|
||||
type WorkerApiRequest = WorkerApiRequestOptions & {
|
||||
json?: Record<string, unknown>;
|
||||
idempotencyKey?: string;
|
||||
};
|
||||
|
||||
const ApiV2ErrorResponseSchema = z.object({
|
||||
errors: z.array(z.object({ code: z.string().optional(), message: z.string() })).min(1),
|
||||
});
|
||||
@@ -52,7 +47,7 @@ export class WorkerApiError extends Error {
|
||||
}
|
||||
|
||||
get isTransient(): boolean {
|
||||
return this.status === undefined || this.status === 429 || this.status >= 500;
|
||||
return this.status === undefined || this.status >= 500;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +66,7 @@ export class WorkerApi {
|
||||
method: 'GET' | 'POST',
|
||||
route: string,
|
||||
dataSchema: z.ZodType<T>,
|
||||
{ retries = 0, ...options }: WorkerApiRequest = {}
|
||||
{ retries = 0, ...options }: WorkerApiRequestOptions & { json?: Record<string, unknown> } = {}
|
||||
): Promise<T> {
|
||||
const url = new URL(route, this.baseUrl);
|
||||
const routeDescription = `${method} ${url.pathname}`;
|
||||
@@ -84,7 +79,10 @@ export class WorkerApi {
|
||||
}
|
||||
return await promiseRetryWithCondition(
|
||||
request,
|
||||
error => !options.signal?.aborted && error instanceof WorkerApiError && error.isTransient,
|
||||
error =>
|
||||
!options.signal?.aborted &&
|
||||
error instanceof WorkerApiError &&
|
||||
(error.status === undefined || error.status === 429 || error.status >= 500),
|
||||
{ retries, factor: 2, minTimeout: 1000 },
|
||||
({ attemptNumber, maxAttemptsCount }) =>
|
||||
options.logger?.warn(
|
||||
@@ -98,14 +96,18 @@ export class WorkerApi {
|
||||
url: string,
|
||||
routeDescription: string,
|
||||
dataSchema: z.ZodType<T>,
|
||||
{ signal, timeoutMs, logger, json, idempotencyKey }: Omit<WorkerApiRequest, 'retries'>
|
||||
{
|
||||
signal,
|
||||
timeoutMs,
|
||||
logger,
|
||||
json,
|
||||
}: Omit<WorkerApiRequestOptions, 'retries'> & {
|
||||
json?: Record<string, unknown>;
|
||||
}
|
||||
): Promise<T> {
|
||||
const responseResult = await asyncResult(
|
||||
turtleFetch(url, method, {
|
||||
headers: {
|
||||
[this.auth.authHeader]: this.auth.token,
|
||||
...(idempotencyKey ? { 'Idempotency-Key': idempotencyKey } : {}),
|
||||
},
|
||||
headers: { [this.auth.authHeader]: this.auth.token },
|
||||
...(json ? { json } : {}),
|
||||
...(signal ? { signal } : {}),
|
||||
...(timeoutMs !== undefined ? { timeout: timeoutMs } : {}),
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
# create-eas-build-function
|
||||
|
||||
## 27.11.0
|
||||
|
||||
No changes in this release.
|
||||
|
||||
## 27.10.0
|
||||
|
||||
No changes in this release.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "create-eas-build-function",
|
||||
"version": "27.11.0",
|
||||
"version": "27.10.0",
|
||||
"description": "Create functions for use in EAS Build custom builds.",
|
||||
"keywords": [
|
||||
"expo",
|
||||
@@ -35,7 +35,7 @@
|
||||
"clean": "rimraf ./build/ \"*.tsbuildinfo\""
|
||||
},
|
||||
"dependencies": {
|
||||
"@expo/steps": "27.11.0"
|
||||
"@expo/steps": "27.10.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@expo/package-manager": "1.9.10",
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
# @expo/downloader
|
||||
|
||||
## 27.11.0
|
||||
|
||||
No changes in this release.
|
||||
|
||||
## 27.10.0
|
||||
|
||||
No changes in this release.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@expo/downloader",
|
||||
"version": "27.11.0",
|
||||
"version": "27.10.0",
|
||||
"bugs": "https://github.com/expo/eas-cli/issues",
|
||||
"license": "BUSL-1.1",
|
||||
"author": "Expo <[email protected]>",
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
# eas-build-cache-provider
|
||||
|
||||
## 27.11.0
|
||||
|
||||
No changes in this release.
|
||||
|
||||
## 27.10.0
|
||||
|
||||
No changes in this release.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "eas-build-cache-provider",
|
||||
"version": "27.11.0",
|
||||
"version": "27.10.0",
|
||||
"description": "A build cache provider plugin for the Expo CLI",
|
||||
"homepage": "https://github.com/expo/eas-cli",
|
||||
"bugs": "https://github.com/expo/eas-cli/issues",
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
# @expo/eas-build-job
|
||||
|
||||
## 27.11.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- Accept `issue_comment` as a `github.event_name` value in the workflow interpolation context. ([#4906](https://github.com/expo/eas-cli/pull/4906) by [@sswrk](https://github.com/sswrk))
|
||||
- Support error occurrence events in Observe workflow context. ([#4860](https://github.com/expo/eas-cli/pull/4860) by [@AbbanMustafa](https://github.com/AbbanMustafa))
|
||||
|
||||
## 27.10.0
|
||||
|
||||
No changes in this release.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@expo/eas-build-job",
|
||||
"version": "27.11.0",
|
||||
"version": "27.10.0",
|
||||
"bugs": "https://github.com/expo/eas-cli/issues",
|
||||
"license": "MIT",
|
||||
"author": "Expo <[email protected]>",
|
||||
@@ -25,9 +25,9 @@
|
||||
"clean": "rimraf node_modules dist coverage \"*.tsbuildinfo\""
|
||||
},
|
||||
"dependencies": {
|
||||
"@expo/logger": "27.11.0",
|
||||
"@expo/logger": "27.10.0",
|
||||
"@expo/results": "1.0.0",
|
||||
"@expo/turtle-spawn": "27.11.0",
|
||||
"@expo/turtle-spawn": "27.10.0",
|
||||
"joi": "^17.13.9",
|
||||
"semver": "^7.6.2",
|
||||
"zod": "^4.6.7"
|
||||
|
||||
@@ -922,50 +922,6 @@ describe('GitHub context event payload passthrough', () => {
|
||||
|
||||
expect(parsed.github?.event).toMatchObject(context.github.event);
|
||||
});
|
||||
|
||||
it('accepts the issue_comment event with issue and comment fields', () => {
|
||||
const context = {
|
||||
after: {},
|
||||
needs: {},
|
||||
github: {
|
||||
event_name: 'issue_comment',
|
||||
sha: 'abc123',
|
||||
ref: 'refs/heads/main',
|
||||
ref_name: 'main',
|
||||
ref_type: 'branch',
|
||||
event: {
|
||||
action: 'created',
|
||||
issue: {
|
||||
number: 123,
|
||||
title: 'Issue title',
|
||||
},
|
||||
comment: {
|
||||
id: 456,
|
||||
body: 'Comment body',
|
||||
},
|
||||
},
|
||||
},
|
||||
workflow: {
|
||||
id: 'workflow-id',
|
||||
name: 'Workflow',
|
||||
filename: 'workflow.yml',
|
||||
url: 'https://expo.dev',
|
||||
},
|
||||
app: {
|
||||
id: 'app-id',
|
||||
slug: 'app-slug',
|
||||
},
|
||||
account: {
|
||||
id: 'account-id',
|
||||
name: 'account-name',
|
||||
},
|
||||
};
|
||||
|
||||
const parsed = StaticWorkflowInterpolationContextZ.parse(context);
|
||||
|
||||
expect(parsed.github?.event_name).toBe('issue_comment');
|
||||
expect(parsed.github?.event).toMatchObject(context.github.event);
|
||||
});
|
||||
});
|
||||
|
||||
describe('fetchEasCliVersionsAsync', () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ArchiveSourceType, BuildTrigger, StaticWorkflowInterpolationContextZ } from '../common';
|
||||
import { Generic } from '../generic';
|
||||
|
||||
function createContext(eventType: 'new_error' | 'error_occurrence' = 'new_error') {
|
||||
function createContext() {
|
||||
return {
|
||||
after: {},
|
||||
needs: {},
|
||||
@@ -16,7 +16,7 @@ function createContext(eventType: 'new_error' | 'error_occurrence' = 'new_error'
|
||||
observe: {
|
||||
event: {
|
||||
id: '123e4567-e89b-42d3-a456-426614174001',
|
||||
type: eventType,
|
||||
type: 'new_error' as const,
|
||||
occurredAt: '2026-10-29T12:00:00.000Z',
|
||||
appId: '123e4567-e89b-42d3-a456-426614174000',
|
||||
fingerprint: { value: 'error-fingerprint', version: 'v1' },
|
||||
@@ -31,36 +31,23 @@ function createContext(eventType: 'new_error' | 'error_occurrence' = 'new_error'
|
||||
}
|
||||
|
||||
describe('Observe workflow context', () => {
|
||||
it.each(['new_error', 'error_occurrence'] as const)(
|
||||
'preserves %s events when validating a generic job',
|
||||
eventType => {
|
||||
const context = createContext(eventType);
|
||||
const job = {
|
||||
projectArchive: { type: ArchiveSourceType.GIT, gitCommitHash: 'abc123', gitRef: null },
|
||||
steps: [{ run: 'echo "${{ observe.event.exception.message }}"', shell: 'sh' }],
|
||||
secrets: { robotAccessToken: 'token', environmentSecrets: [] },
|
||||
expoDevUrl: context.workflow.url,
|
||||
builderEnvironment: { image: 'ubuntu', env: {} },
|
||||
triggeredBy: BuildTrigger.GIT_BASED_INTEGRATION,
|
||||
appId: context.app.id,
|
||||
initiatingUserId: '123e4567-e89b-42d3-a456-426614174002',
|
||||
workflowInterpolationContext: context,
|
||||
};
|
||||
|
||||
const parsed = Generic.JobZ.parse(job);
|
||||
|
||||
expect(parsed.workflowInterpolationContext).toEqual(context);
|
||||
}
|
||||
);
|
||||
|
||||
it('rejects unknown Observe event types', () => {
|
||||
it('preserves the event when validating a generic job', () => {
|
||||
const context = createContext();
|
||||
expect(
|
||||
StaticWorkflowInterpolationContextZ.safeParse({
|
||||
...context,
|
||||
observe: { event: { ...context.observe.event, type: 'unknown' } },
|
||||
}).success
|
||||
).toBe(false);
|
||||
const job = {
|
||||
projectArchive: { type: ArchiveSourceType.GIT, gitCommitHash: 'abc123', gitRef: null },
|
||||
steps: [{ run: 'echo "${{ observe.event.exception.message }}"', shell: 'sh' }],
|
||||
secrets: { robotAccessToken: 'token', environmentSecrets: [] },
|
||||
expoDevUrl: context.workflow.url,
|
||||
builderEnvironment: { image: 'ubuntu', env: {} },
|
||||
triggeredBy: BuildTrigger.GIT_BASED_INTEGRATION,
|
||||
appId: context.app.id,
|
||||
initiatingUserId: '123e4567-e89b-42d3-a456-426614174002',
|
||||
workflowInterpolationContext: context,
|
||||
};
|
||||
|
||||
const parsed = Generic.JobZ.parse(job);
|
||||
|
||||
expect(parsed.workflowInterpolationContext).toEqual(context);
|
||||
});
|
||||
|
||||
it('accepts nullable event metadata and an omitted device OS', () => {
|
||||
|
||||
@@ -194,7 +194,7 @@ export const CacheSchema = Joi.object({
|
||||
|
||||
const GitHubContextZ = z.object({
|
||||
triggering_actor: z.string().optional(),
|
||||
event_name: z.enum(['push', 'pull_request', 'workflow_dispatch', 'schedule', 'issue_comment']),
|
||||
event_name: z.enum(['push', 'pull_request', 'workflow_dispatch', 'schedule']),
|
||||
sha: z.string(),
|
||||
ref: z.string(),
|
||||
ref_name: z.string(),
|
||||
@@ -347,7 +347,7 @@ const SentryContextZ = z.looseObject({
|
||||
const ObserveContextZ = z.looseObject({
|
||||
event: z.looseObject({
|
||||
id: z.uuid(),
|
||||
type: z.enum(['new_error', 'error_occurrence']),
|
||||
type: z.literal('new_error'),
|
||||
occurredAt: z.iso.datetime(),
|
||||
appId: z.uuid(),
|
||||
fingerprint: z.looseObject({
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
# eas-cli
|
||||
|
||||
## 27.11.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Detect Factory Droid, Grok Bot, Claude Cowork, and Muse in EAS CLI telemetry. ([#4912](https://github.com/expo/eas-cli/pull/4912) by [@davidmokos](https://github.com/davidmokos))
|
||||
- Mark the default device for each platform in `eas simulator:devices` and include `isDefault` in JSON output. ([#4895](https://github.com/expo/eas-cli/pull/4895) by [@gwdp](https://github.com/gwdp))
|
||||
|
||||
## 27.10.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
+176
-164
File diff suppressed because it is too large.
Load diff
Generated
+13
-1
@@ -48154,7 +48154,7 @@
|
||||
},
|
||||
{
|
||||
"name": "networkCapture",
|
||||
"description": "Record HTTP(S) traffic from apps on the device for the whole session. iOS only.\nHTTPS is decrypted, so recordings contain credentials and cookies in cleartext.\nIf omitted, no traffic is recorded.",
|
||||
"description": "Capture HTTP(S) traffic from apps on the device for live inspection. iOS only.\nHTTPS is decrypted, so captured traffic can contain credentials and cookies in cleartext.\nIf omitted, network capture is disabled.",
|
||||
"type": {
|
||||
"kind": "SCALAR",
|
||||
"name": "Boolean",
|
||||
@@ -48184,6 +48184,18 @@
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "networkCaptureRecording",
|
||||
"description": "Record network capture as a HAR artifact for access after the session. Requires networkCapture.\nIf omitted, HAR artifact recording is disabled.",
|
||||
"type": {
|
||||
"kind": "SCALAR",
|
||||
"name": "Boolean",
|
||||
"ofType": null
|
||||
},
|
||||
"defaultValue": null,
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "openUrl",
|
||||
"description": "Expo or development-client URL to open after launching the installed application. Requires\nbuildId, applicationArchiveUrl, or expoGo.",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "eas-cli",
|
||||
"version": "27.11.0",
|
||||
"version": "27.10.0",
|
||||
"description": "EAS command line tool",
|
||||
"keywords": [
|
||||
"cli",
|
||||
@@ -48,12 +48,12 @@
|
||||
"@expo/code-signing-certificates": "0.0.5",
|
||||
"@expo/config": "55.0.10",
|
||||
"@expo/config-plugins": "55.0.7",
|
||||
"@expo/eas-build-job": "27.11.0",
|
||||
"@expo/eas-json": "27.11.0",
|
||||
"@expo/eas-build-job": "27.10.0",
|
||||
"@expo/eas-json": "27.10.0",
|
||||
"@expo/env": "^1.0.0",
|
||||
"@expo/experimentation": "0.0.5",
|
||||
"@expo/json-file": "8.3.3",
|
||||
"@expo/logger": "27.11.0",
|
||||
"@expo/logger": "27.10.0",
|
||||
"@expo/multipart-body-parser": "2.0.0",
|
||||
"@expo/osascript": "2.1.4",
|
||||
"@expo/package-manager": "1.9.10",
|
||||
@@ -65,7 +65,7 @@
|
||||
"@expo/results": "1.0.0",
|
||||
"@expo/rudder-sdk-node": "1.1.1",
|
||||
"@expo/spawn-async": "1.7.2",
|
||||
"@expo/steps": "27.11.0",
|
||||
"@expo/steps": "27.10.0",
|
||||
"@expo/timeago.js": "1.0.0",
|
||||
"@oclif/core": "^4.8.3",
|
||||
"@oclif/plugin-autocomplete": "^3.2.40",
|
||||
@@ -73,7 +73,7 @@
|
||||
"@sentry/node": "7.77.0",
|
||||
"@urql/core": "4.0.11",
|
||||
"@urql/exchange-retry": "1.2.0",
|
||||
"agent-cli-detector": "0.1.8",
|
||||
"agent-cli-detector": "0.1.7",
|
||||
"ajv": "8.20.0",
|
||||
"ajv-formats": "2.1.1",
|
||||
"better-opn": "3.0.2",
|
||||
@@ -227,12 +227,6 @@
|
||||
"project": {
|
||||
"description": "manage project"
|
||||
},
|
||||
"project:icon": {
|
||||
"description": "manage the project icon displayed on the EAS dashboard"
|
||||
},
|
||||
"project:name": {
|
||||
"description": "manage the project display name shown on the EAS dashboard"
|
||||
},
|
||||
"release": {
|
||||
"description": "manage update releases"
|
||||
},
|
||||
|
||||
@@ -190,7 +190,7 @@ describe(WorkflowLogView, () => {
|
||||
},
|
||||
},
|
||||
platform: AppPlatform.Android,
|
||||
logFileUrls: ['https://example.com/log1'],
|
||||
logFiles: ['https://example.com/log1'],
|
||||
});
|
||||
let promptCalls = 0;
|
||||
let stepPrompt: any;
|
||||
|
||||
@@ -72,7 +72,7 @@ function createMockBuildFragment({
|
||||
updatedAt: new Date().toISOString(),
|
||||
platform: AppPlatform.Android,
|
||||
id: buildId ?? uuid(),
|
||||
logFileUrls: [],
|
||||
logFiles: [],
|
||||
priority: BuildPriority.Normal,
|
||||
app: {
|
||||
__typename: 'App',
|
||||
|
||||
@@ -70,7 +70,7 @@ function createMockBuildFragment({
|
||||
return {
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
logFileUrls: [],
|
||||
logFiles: [],
|
||||
platform: AppPlatform.Android,
|
||||
id: buildId ?? uuid(),
|
||||
priority: BuildPriority.Normal,
|
||||
|
||||
@@ -26,7 +26,7 @@ function createBuildFragment(overrides: Partial<BuildFragment> = {}): BuildFragm
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
platform: AppPlatform.Android,
|
||||
logFileUrls: [],
|
||||
logFiles: [],
|
||||
priority: BuildPriority.Normal,
|
||||
app: {
|
||||
__typename: 'App',
|
||||
@@ -98,7 +98,7 @@ describe(logSourceForBuild, () => {
|
||||
} as any);
|
||||
|
||||
const source = logSourceForBuild(
|
||||
createBuildFragment({ logFileUrls: ['https://logs.test/first', 'https://logs.test/second'] })
|
||||
createBuildFragment({ logFiles: ['https://logs.test/first', 'https://logs.test/second'] })
|
||||
);
|
||||
|
||||
await expect(source.fetchRawLogLinesAsync()).resolves.toEqual([
|
||||
@@ -113,7 +113,7 @@ describe(logSourceForBuild, () => {
|
||||
|
||||
it('returns null when the build has no log file', async () => {
|
||||
await expect(
|
||||
logSourceForBuild(createBuildFragment({ logFileUrls: [] })).fetchRawLogLinesAsync()
|
||||
logSourceForBuild(createBuildFragment({ logFiles: [] })).fetchRawLogLinesAsync()
|
||||
).resolves.toBeNull();
|
||||
expect(fetch).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
@@ -47,7 +47,7 @@ function createBuildFragment(status: BuildStatus): BuildFragment {
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
platform: AppPlatform.Android,
|
||||
logFileUrls: [],
|
||||
logFiles: [],
|
||||
priority: BuildPriority.Normal,
|
||||
app: {
|
||||
__typename: 'App',
|
||||
|
||||
@@ -2,6 +2,7 @@ import { ArchiveSource, ArchiveSourceType, BuildJob, Metadata, Platform, formatB
|
||||
import { CredentialsSource } from '@expo/eas-json';
|
||||
import assert from 'assert';
|
||||
import chalk from 'chalk';
|
||||
import cliProgress from 'cli-progress';
|
||||
import fs from 'fs-extra';
|
||||
import { GraphQLError } from 'graphql/error';
|
||||
import nullthrows from 'nullthrows';
|
||||
@@ -60,6 +61,7 @@ import {
|
||||
BuildFragment,
|
||||
BuildMetadataInput,
|
||||
BuildParamsInput,
|
||||
BuildPriority,
|
||||
BuildStatus,
|
||||
FingerprintSourceInput,
|
||||
UploadSessionType,
|
||||
@@ -649,6 +651,12 @@ type BuildLogsProgressOptions = {
|
||||
installRender: (render: () => void) => void;
|
||||
};
|
||||
|
||||
let queueProgressBarStarted = false;
|
||||
const queueProgressBar = new cliProgress.SingleBar(
|
||||
{ format: '|{bar}| {estimatedWaitTime}' },
|
||||
cliProgress.Presets.rect
|
||||
);
|
||||
|
||||
let statusNewSetAt: number | null = null;
|
||||
const NEW_STATUS_GRACE_PERIOD_MS = 15_000;
|
||||
|
||||
@@ -669,6 +677,18 @@ async function handleSingleBuildProgressAsync(
|
||||
return { refetch: true };
|
||||
}
|
||||
|
||||
if (queueProgressBarStarted && build?.status && build.status !== BuildStatus.InQueue) {
|
||||
if (build.status === BuildStatus.InProgress) {
|
||||
queueProgressBar.update(queueProgressBar.getTotal(), {
|
||||
estimatedWaitTime: '',
|
||||
});
|
||||
}
|
||||
queueProgressBar.stop();
|
||||
Log.newLine();
|
||||
queueProgressBarStarted = false;
|
||||
spinner.start('Build is about to start');
|
||||
}
|
||||
|
||||
switch (build.status) {
|
||||
case BuildStatus.Finished:
|
||||
spinner.succeed('Build finished');
|
||||
@@ -688,9 +708,40 @@ async function handleSingleBuildProgressAsync(
|
||||
}
|
||||
break;
|
||||
}
|
||||
case BuildStatus.InQueue:
|
||||
case BuildStatus.InQueue: {
|
||||
updateSpinnerText(spinner, { text: 'Build queued...' });
|
||||
const progressBarPayload =
|
||||
typeof build.estimatedWaitTimeLeftSeconds === 'number'
|
||||
? { estimatedWaitTime: formatEstimatedWaitTime(build.estimatedWaitTimeLeftSeconds) }
|
||||
: { estimatedWaitTime: '' };
|
||||
|
||||
if (
|
||||
!queueProgressBarStarted &&
|
||||
typeof build.initialQueuePosition === 'number' &&
|
||||
typeof build.queuePosition === 'number' &&
|
||||
typeof build.estimatedWaitTimeLeftSeconds === 'number'
|
||||
) {
|
||||
spinner.stopAndPersist();
|
||||
if (build.priority !== BuildPriority.High) {
|
||||
Log.newLine();
|
||||
Log.log('Start builds sooner in the priority queue.');
|
||||
Log.log(`Sign up for a paid plan at ${link(getAccountBillingUrl(accountName))}`);
|
||||
}
|
||||
|
||||
Log.newLine();
|
||||
Log.log(`Waiting in ${priorityToQueueDisplayName[build.priority]}`);
|
||||
queueProgressBar.start(
|
||||
build.initialQueuePosition + 1,
|
||||
build.initialQueuePosition - build.queuePosition + 1,
|
||||
progressBarPayload
|
||||
);
|
||||
queueProgressBarStarted = true;
|
||||
}
|
||||
if (typeof build.queuePosition === 'number') {
|
||||
queueProgressBar.update(build.queuePosition, progressBarPayload);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case BuildStatus.PendingCancel:
|
||||
case BuildStatus.Canceled:
|
||||
spinner.fail('Build canceled');
|
||||
@@ -720,6 +771,12 @@ async function handleSingleBuildProgressAsync(
|
||||
return { refetch: true };
|
||||
}
|
||||
|
||||
const priorityToQueueDisplayName: Record<BuildPriority, string> = {
|
||||
[BuildPriority.Normal]: 'Free tier queue',
|
||||
[BuildPriority.NormalPlus]: 'Free tier queue',
|
||||
[BuildPriority.High]: 'priority queue',
|
||||
};
|
||||
|
||||
const statusToDisplayName: Record<BuildStatus, string> = {
|
||||
[BuildStatus.New]: 'waiting to enter the queue',
|
||||
[BuildStatus.InQueue]: 'in queue',
|
||||
@@ -823,9 +880,26 @@ function formatPendingBuildsText(
|
||||
showConcurrencyWarning && build?.status === BuildStatus.New
|
||||
? ' (concurrency limit reached)'
|
||||
: '';
|
||||
let extraInfo = '';
|
||||
if (
|
||||
build?.status === BuildStatus.InQueue &&
|
||||
typeof build.initialQueuePosition === 'number' &&
|
||||
typeof build.queuePosition === 'number'
|
||||
) {
|
||||
const percent = Math.floor(
|
||||
((build.initialQueuePosition - build.queuePosition + 1) /
|
||||
(build.initialQueuePosition + 1)) *
|
||||
100
|
||||
);
|
||||
const estimatedWaitTime =
|
||||
typeof build.estimatedWaitTimeLeftSeconds === 'number'
|
||||
? ` - ${formatEstimatedWaitTime(build.estimatedWaitTimeLeftSeconds)}`
|
||||
: '';
|
||||
extraInfo = ` - queue progress: ${chalk.bold(`${percent}%`)}${estimatedWaitTime}`;
|
||||
}
|
||||
return `${appPlatformEmojis[platform]} ${
|
||||
appPlatformDisplayNames[platform]
|
||||
} build - status: ${chalk.bold(status)}${concurrencyWarning}`;
|
||||
} build - status: ${chalk.bold(status)}${concurrencyWarning}${extraInfo}`;
|
||||
}),
|
||||
].join('\n ');
|
||||
}
|
||||
@@ -834,6 +908,15 @@ function isBuildFragment(maybeBuild: MaybeBuildFragment): maybeBuild is BuildFra
|
||||
return maybeBuild !== null;
|
||||
}
|
||||
|
||||
function formatEstimatedWaitTime(estimatedWaitTimeLeftSeconds: number): string {
|
||||
if (estimatedWaitTimeLeftSeconds < 5 * 60) {
|
||||
return 'starting soon...';
|
||||
} else {
|
||||
const n = Math.floor(estimatedWaitTimeLeftSeconds / (10 * 60)) + 1;
|
||||
return `starting in about ${n}0 minutes...`;
|
||||
}
|
||||
}
|
||||
|
||||
async function computeAndMaybeUploadRuntimeAndFingerprintMetadataAsync<T extends Platform>(
|
||||
ctx: BuildContext<T>
|
||||
): Promise<{
|
||||
|
||||
@@ -15,7 +15,7 @@ const SINGLE_BUILD_MAX_LOG_LINES = 5;
|
||||
const MULTIPLE_BUILDS_MAX_LOG_LINES = 3;
|
||||
|
||||
async function fetchAndParseLogsForBuildAsync(build: BuildFragment): Promise<RawLogLine[] | null> {
|
||||
const logFileUrl = build.logFileUrls[0];
|
||||
const logFileUrl = build.logFiles[0];
|
||||
if (!logFileUrl) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ export async function fetchRawLogsForJobAsync(
|
||||
const buildFragment = await BuildQuery.byIdAsync(state.graphqlClient, buildId, {
|
||||
useCache: false,
|
||||
});
|
||||
const firstLogFileUrl = buildFragment.logFileUrls?.[0];
|
||||
const firstLogFileUrl = buildFragment.logFiles?.[0];
|
||||
if (!firstLogFileUrl) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
import { getMockOclifConfig } from '../../../__tests__/commands/utils';
|
||||
import { ExpoGraphqlClient } from '../../../commandUtils/context/contextUtils/createGraphqlClient';
|
||||
import { AppQuery } from '../../../graphql/queries/AppQuery';
|
||||
import Log from '../../../log';
|
||||
import ProjectInfo from '../info';
|
||||
|
||||
jest.mock('../../../graphql/queries/AppQuery');
|
||||
jest.mock('../../../log');
|
||||
|
||||
const projectId = 'test-project-id';
|
||||
|
||||
async function runAndGetOutputAsync(): Promise<string> {
|
||||
const command = new ProjectInfo([], getMockOclifConfig());
|
||||
// @ts-expect-error getContextAsync is protected
|
||||
jest.spyOn(command, 'getContextAsync').mockResolvedValue({
|
||||
projectId,
|
||||
loggedIn: { graphqlClient: {} as ExpoGraphqlClient },
|
||||
});
|
||||
await command.runAsync();
|
||||
return jest.mocked(Log.log).mock.calls.flat().join('\n');
|
||||
}
|
||||
|
||||
describe(ProjectInfo, () => {
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
jest.mocked(AppQuery.byIdAsync).mockResolvedValue({
|
||||
id: projectId,
|
||||
name: 'My App',
|
||||
fullName: '@jester/my-app',
|
||||
slug: 'my-app',
|
||||
} as any);
|
||||
});
|
||||
|
||||
it('prints the display name, slug and icon URL', async () => {
|
||||
jest
|
||||
.mocked(AppQuery.byIdProfileImageUrlAsync)
|
||||
.mockResolvedValue('https://example.com/icon.png');
|
||||
|
||||
const output = await runAndGetOutputAsync();
|
||||
|
||||
expect(output).toMatch(/fullName.* @jester\/my-app/);
|
||||
expect(output).toMatch(/name.* My App/);
|
||||
expect(output).toMatch(/slug.* my-app/);
|
||||
expect(output).toMatch(/icon.* https:\/\/example\.com\/icon\.png/);
|
||||
expect(output).toMatch(/ID.* test-project-id/);
|
||||
});
|
||||
|
||||
it('prints "not set" when the project has no icon', async () => {
|
||||
jest.mocked(AppQuery.byIdProfileImageUrlAsync).mockResolvedValue(null);
|
||||
|
||||
expect(await runAndGetOutputAsync()).toMatch(/icon.* not set/);
|
||||
});
|
||||
});
|
||||
@@ -96,8 +96,9 @@ function makeSubmission(overrides: Partial<ProjectStatusSubmission> = {}): Proje
|
||||
createdAt: '2026-07-02T12:00:00.000Z',
|
||||
completedAt: '2026-07-02T12:05:00.000Z',
|
||||
initiatingActor: { id: 'actor-1', displayName: 'jester' },
|
||||
submittedBuild: { id: 'build-1', appIdentifier: 'com.example.app' },
|
||||
submittedBuild: { id: 'build-1' },
|
||||
androidConfig: {
|
||||
applicationIdentifier: 'com.example.app',
|
||||
track: 'production',
|
||||
releaseStatus: null,
|
||||
rollout: 50,
|
||||
|
||||
@@ -4,7 +4,6 @@ import { vol } from 'memfs';
|
||||
import { ExpoGraphqlClient } from '../../../../commandUtils/context/contextUtils/createGraphqlClient';
|
||||
import { AppUploadSessionType } from '../../../../graphql/generated';
|
||||
import { AppQuery } from '../../../../graphql/queries/AppQuery';
|
||||
import { getPrivateExpoConfigAsync } from '../../../../project/expoConfig';
|
||||
import { uploadAppScopedFileAtPathToGCSAsync } from '../../../../uploads';
|
||||
import { sleepAsync } from '../../../../utils/promise';
|
||||
import ProjectIconSet from '../set';
|
||||
@@ -12,7 +11,6 @@ import ProjectIconSet from '../set';
|
||||
jest.mock('fs');
|
||||
jest.mock('../../../../graphql/queries/AppQuery');
|
||||
jest.mock('../../../../log');
|
||||
jest.mock('../../../../project/expoConfig');
|
||||
jest.mock('../../../../ora', () => ({
|
||||
ora: jest.fn(() => {
|
||||
const spinner = {
|
||||
@@ -76,7 +74,6 @@ describe(ProjectIconSet, () => {
|
||||
// @ts-expect-error getContextAsync is protected
|
||||
jest.spyOn(command, 'getContextAsync').mockResolvedValue({
|
||||
projectId,
|
||||
projectDir: '/app',
|
||||
loggedIn: { graphqlClient },
|
||||
});
|
||||
return command;
|
||||
@@ -112,51 +109,12 @@ describe(ProjectIconSet, () => {
|
||||
expect(mockUploadAsync).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('uploads the icon from the app config when no path is given', async () => {
|
||||
vol.fromJSON({ '/app/assets/icon.png': 'fake-png-bytes' });
|
||||
jest.mocked(getPrivateExpoConfigAsync).mockResolvedValue({
|
||||
name: 'test',
|
||||
slug: 'test-project',
|
||||
icon: './assets/icon.png',
|
||||
} as any);
|
||||
mockByIdProfileImageUrlAsync
|
||||
.mockResolvedValueOnce('https://example.com/old.png')
|
||||
.mockResolvedValueOnce('https://example.com/new.png');
|
||||
|
||||
await createCommand([]).runAsync();
|
||||
|
||||
expect(mockUploadAsync).toHaveBeenCalledWith(graphqlClient, {
|
||||
type: AppUploadSessionType.ProfileImageUpload,
|
||||
appId: projectId,
|
||||
path: '/app/assets/icon.png',
|
||||
});
|
||||
});
|
||||
|
||||
it('throws when no path is given and the app config has no icon', async () => {
|
||||
jest
|
||||
.mocked(getPrivateExpoConfigAsync)
|
||||
.mockResolvedValue({ name: 'test', slug: 'test-project' } as any);
|
||||
|
||||
await expect(createCommand([]).runAsync()).rejects.toThrow(
|
||||
'No local icon found in the app config'
|
||||
);
|
||||
expect(mockUploadAsync).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('throws when the file does not exist', async () => {
|
||||
const command = createCommand(['/app/missing.png']);
|
||||
await expect(command.runAsync()).rejects.toThrow('No file found at /app/missing.png');
|
||||
expect(mockUploadAsync).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('throws for a directory', async () => {
|
||||
vol.fromJSON({ '/app/assets/icon.png': 'fake-png-bytes' });
|
||||
const command = createCommand(['/app/assets']);
|
||||
|
||||
await expect(command.runAsync()).rejects.toThrow('/app/assets is not a file.');
|
||||
expect(mockUploadAsync).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('throws for an unsupported image format', async () => {
|
||||
vol.fromJSON({ '/app/icon.gif': 'fake-gif-bytes' });
|
||||
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
import { getMockOclifConfig } from '../../../../__tests__/commands/utils';
|
||||
import { ExpoGraphqlClient } from '../../../../commandUtils/context/contextUtils/createGraphqlClient';
|
||||
import { AppMutation } from '../../../../graphql/mutations/AppMutation';
|
||||
import Log from '../../../../log';
|
||||
import ProjectIconUnset from '../unset';
|
||||
|
||||
jest.mock('../../../../graphql/mutations/AppMutation');
|
||||
jest.mock('../../../../log');
|
||||
|
||||
describe(ProjectIconUnset, () => {
|
||||
it('removes the icon of the current project', async () => {
|
||||
const graphqlClient = {} as ExpoGraphqlClient;
|
||||
jest
|
||||
.mocked(AppMutation.removeProfileImageAsync)
|
||||
.mockResolvedValue({ id: 'project-123', fullName: '@test-account/test-project' });
|
||||
|
||||
const command = new ProjectIconUnset([], getMockOclifConfig());
|
||||
// @ts-expect-error getContextAsync is protected
|
||||
jest.spyOn(command, 'getContextAsync').mockResolvedValue({
|
||||
projectId: 'project-123',
|
||||
loggedIn: { graphqlClient },
|
||||
});
|
||||
await command.runAsync();
|
||||
|
||||
expect(AppMutation.removeProfileImageAsync).toHaveBeenCalledWith(graphqlClient, 'project-123');
|
||||
expect(jest.mocked(Log.withTick).mock.calls.flat().join()).toContain(
|
||||
'@test-account/test-project'
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -9,20 +9,18 @@ import Log, { link } from '../../../log';
|
||||
import { ora } from '../../../ora';
|
||||
import {
|
||||
pollForProfileImageChangeAsync,
|
||||
resolveAppConfigIconAsync,
|
||||
uploadProjectIconAsync,
|
||||
validateIconAsync,
|
||||
} from '../../../project/projectIcon';
|
||||
|
||||
export default class ProjectIconSet extends EasCommand {
|
||||
static override description =
|
||||
'set the project icon displayed on the EAS dashboard (requires the Admin role)';
|
||||
static override description = 'set the project icon displayed on the EAS dashboard';
|
||||
|
||||
static override args = {
|
||||
path: Args.string({
|
||||
required: true,
|
||||
description:
|
||||
'Path to the icon image (PNG or JPEG, at most 10 MB). The image is resized to a 1024x1024 PNG, and a non-square image is center-cropped. Defaults to the icon in the app config.',
|
||||
ignoreStdin: true,
|
||||
'Path to the icon image (PNG or JPEG, at most 10 MB). Non-square images are center-cropped to a square.',
|
||||
}),
|
||||
};
|
||||
|
||||
@@ -32,24 +30,21 @@ export default class ProjectIconSet extends EasCommand {
|
||||
|
||||
static override contextDefinition = {
|
||||
...this.ContextOptions.ProjectId,
|
||||
...this.ContextOptions.ProjectDir,
|
||||
...this.ContextOptions.LoggedIn,
|
||||
};
|
||||
|
||||
async runAsync(): Promise<void> {
|
||||
const {
|
||||
args: { path: pathArgument },
|
||||
args: { path: imagePath },
|
||||
flags,
|
||||
} = await this.parse(ProjectIconSet);
|
||||
const {
|
||||
projectId,
|
||||
projectDir,
|
||||
loggedIn: { graphqlClient },
|
||||
} = await this.getContextAsync(ProjectIconSet, {
|
||||
nonInteractive: flags['non-interactive'],
|
||||
});
|
||||
|
||||
const imagePath = pathArgument ?? (await getAppConfigIconPathAsync(projectDir));
|
||||
await validateIconAsync(imagePath);
|
||||
|
||||
const app = await AppQuery.byIdAsync(graphqlClient, projectId);
|
||||
@@ -79,14 +74,3 @@ export default class ProjectIconSet extends EasCommand {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function getAppConfigIconPathAsync(projectDir: string): Promise<string> {
|
||||
const icon = await resolveAppConfigIconAsync(projectDir);
|
||||
if (!icon) {
|
||||
throw new Error(
|
||||
'No local icon found in the app config (icon, ios.icon, android.adaptiveIcon.foregroundImage or android.icon). Pass the path to an image instead.'
|
||||
);
|
||||
}
|
||||
Log.log(`Using "${icon.field}" from your app config: ${icon.path}`);
|
||||
return icon.path;
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
import chalk from 'chalk';
|
||||
|
||||
import EasCommand from '../../../commandUtils/EasCommand';
|
||||
import { EASNonInteractiveFlag } from '../../../commandUtils/flags';
|
||||
import { AppMutation } from '../../../graphql/mutations/AppMutation';
|
||||
import Log from '../../../log';
|
||||
|
||||
export default class ProjectIconUnset extends EasCommand {
|
||||
static override description =
|
||||
'remove the project icon displayed on the EAS dashboard (requires the Admin role)';
|
||||
|
||||
static override flags = {
|
||||
...EASNonInteractiveFlag,
|
||||
};
|
||||
|
||||
static override contextDefinition = {
|
||||
...this.ContextOptions.ProjectId,
|
||||
...this.ContextOptions.LoggedIn,
|
||||
};
|
||||
|
||||
async runAsync(): Promise<void> {
|
||||
const { flags } = await this.parse(ProjectIconUnset);
|
||||
const {
|
||||
projectId,
|
||||
loggedIn: { graphqlClient },
|
||||
} = await this.getContextAsync(ProjectIconUnset, {
|
||||
nonInteractive: flags['non-interactive'],
|
||||
});
|
||||
|
||||
const { fullName } = await AppMutation.removeProfileImageAsync(graphqlClient, projectId);
|
||||
Log.withTick(`${chalk.bold(fullName)} now has no icon`);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,38 @@
|
||||
import gql from 'graphql-tag';
|
||||
|
||||
import EasCommand from '../../commandUtils/EasCommand';
|
||||
import { AppQuery } from '../../graphql/queries/AppQuery';
|
||||
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
||||
import { withErrorHandlingAsync } from '../../graphql/client';
|
||||
import { AppInfoQuery, AppInfoQueryVariables } from '../../graphql/generated';
|
||||
import Log from '../../log';
|
||||
import formatFields from '../../utils/formatFields';
|
||||
|
||||
async function projectInfoByIdAsync(
|
||||
graphqlClient: ExpoGraphqlClient,
|
||||
appId: string
|
||||
): Promise<AppInfoQuery> {
|
||||
const data = await withErrorHandlingAsync(
|
||||
graphqlClient
|
||||
.query<AppInfoQuery, AppInfoQueryVariables>(
|
||||
gql`
|
||||
query AppInfo($appId: String!) {
|
||||
app {
|
||||
byId(appId: $appId) {
|
||||
id
|
||||
fullName
|
||||
}
|
||||
}
|
||||
}
|
||||
`,
|
||||
{ appId },
|
||||
{ additionalTypenames: ['App'] }
|
||||
)
|
||||
.toPromise()
|
||||
);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
export default class ProjectInfo extends EasCommand {
|
||||
static override description = 'information about the current project';
|
||||
|
||||
@@ -19,18 +49,15 @@ export default class ProjectInfo extends EasCommand {
|
||||
nonInteractive: true,
|
||||
});
|
||||
|
||||
const [app, iconUrl] = await Promise.all([
|
||||
AppQuery.byIdAsync(graphqlClient, projectId),
|
||||
AppQuery.byIdProfileImageUrlAsync(graphqlClient, projectId),
|
||||
]);
|
||||
const { app } = await projectInfoByIdAsync(graphqlClient, projectId);
|
||||
if (!app) {
|
||||
throw new Error(`Could not find project with id: ${projectId}`);
|
||||
}
|
||||
|
||||
Log.addNewLineIfNone();
|
||||
Log.log(
|
||||
formatFields([
|
||||
{ label: 'fullName', value: app.fullName },
|
||||
{ label: 'name', value: app.name },
|
||||
{ label: 'slug', value: app.slug },
|
||||
{ label: 'icon', value: iconUrl ?? 'not set' },
|
||||
{ label: 'fullName', value: app.byId.fullName },
|
||||
{ label: 'ID', value: projectId },
|
||||
])
|
||||
);
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
import { getMockOclifConfig } from '../../../../__tests__/commands/utils';
|
||||
import { ExpoGraphqlClient } from '../../../../commandUtils/context/contextUtils/createGraphqlClient';
|
||||
import { AppMutation } from '../../../../graphql/mutations/AppMutation';
|
||||
import { getPrivateExpoConfigAsync } from '../../../../project/expoConfig';
|
||||
import ProjectNameSet from '../set';
|
||||
|
||||
jest.mock('../../../../graphql/mutations/AppMutation');
|
||||
jest.mock('../../../../log');
|
||||
jest.mock('../../../../project/expoConfig');
|
||||
|
||||
const graphqlClient = {} as ExpoGraphqlClient;
|
||||
const mockSetDisplayNameAsync = jest.mocked(AppMutation.setDisplayNameAsync);
|
||||
|
||||
async function runAsync(argv: string[]): Promise<void> {
|
||||
const command = new ProjectNameSet(argv, getMockOclifConfig());
|
||||
// @ts-expect-error getContextAsync is protected
|
||||
jest.spyOn(command, 'getContextAsync').mockResolvedValue({
|
||||
projectId: 'project-123',
|
||||
projectDir: '/app',
|
||||
loggedIn: { graphqlClient },
|
||||
});
|
||||
await command.runAsync();
|
||||
}
|
||||
|
||||
describe(ProjectNameSet, () => {
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
mockSetDisplayNameAsync.mockResolvedValue({
|
||||
id: 'project-123',
|
||||
name: 'My App',
|
||||
fullName: '@test-account/my-app',
|
||||
});
|
||||
jest
|
||||
.mocked(getPrivateExpoConfigAsync)
|
||||
.mockResolvedValue({ name: 'Config Name', slug: 'my-app' } as any);
|
||||
});
|
||||
|
||||
it('sets the given display name, trimmed', async () => {
|
||||
await runAsync([' My App ']);
|
||||
|
||||
expect(mockSetDisplayNameAsync).toHaveBeenCalledWith(graphqlClient, {
|
||||
appId: 'project-123',
|
||||
displayName: 'My App',
|
||||
});
|
||||
});
|
||||
|
||||
it('uses the name from the app config when no name is given', async () => {
|
||||
await runAsync([]);
|
||||
|
||||
expect(mockSetDisplayNameAsync).toHaveBeenCalledWith(graphqlClient, {
|
||||
appId: 'project-123',
|
||||
displayName: 'Config Name',
|
||||
});
|
||||
});
|
||||
|
||||
it('rejects a blank name', async () => {
|
||||
await expect(runAsync([' '])).rejects.toThrow('The display name cannot be blank.');
|
||||
expect(mockSetDisplayNameAsync).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
@@ -1,55 +0,0 @@
|
||||
import { Args } from '@oclif/core';
|
||||
import chalk from 'chalk';
|
||||
|
||||
import EasCommand from '../../../commandUtils/EasCommand';
|
||||
import { EASNonInteractiveFlag } from '../../../commandUtils/flags';
|
||||
import { AppMutation } from '../../../graphql/mutations/AppMutation';
|
||||
import Log from '../../../log';
|
||||
import { getPrivateExpoConfigAsync } from '../../../project/expoConfig';
|
||||
|
||||
export default class ProjectNameSet extends EasCommand {
|
||||
static override description =
|
||||
'set the project display name shown on the EAS dashboard (does not change the slug)';
|
||||
|
||||
static override args = {
|
||||
name: Args.string({
|
||||
description: 'Display name, at most 255 characters. Defaults to the name in the app config.',
|
||||
ignoreStdin: true,
|
||||
}),
|
||||
};
|
||||
|
||||
static override flags = {
|
||||
...EASNonInteractiveFlag,
|
||||
};
|
||||
|
||||
static override contextDefinition = {
|
||||
...this.ContextOptions.ProjectId,
|
||||
...this.ContextOptions.ProjectDir,
|
||||
...this.ContextOptions.LoggedIn,
|
||||
};
|
||||
|
||||
async runAsync(): Promise<void> {
|
||||
const {
|
||||
args: { name: nameArgument },
|
||||
flags,
|
||||
} = await this.parse(ProjectNameSet);
|
||||
const {
|
||||
projectId,
|
||||
projectDir,
|
||||
loggedIn: { graphqlClient },
|
||||
} = await this.getContextAsync(ProjectNameSet, {
|
||||
nonInteractive: flags['non-interactive'],
|
||||
});
|
||||
|
||||
const displayName = (nameArgument ?? (await getPrivateExpoConfigAsync(projectDir)).name).trim();
|
||||
if (!displayName) {
|
||||
throw new Error('The display name cannot be blank.');
|
||||
}
|
||||
|
||||
const app = await AppMutation.setDisplayNameAsync(graphqlClient, {
|
||||
appId: projectId,
|
||||
displayName,
|
||||
});
|
||||
Log.withTick(`Set the display name of ${chalk.bold(app.fullName)} to ${chalk.bold(app.name)}`);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,411 @@
|
||||
import { Config } from '@oclif/core';
|
||||
import chalk from 'chalk';
|
||||
|
||||
import { ExpoGraphqlClient } from '../../../commandUtils/context/contextUtils/createGraphqlClient';
|
||||
import { DeviceRunSessionStatus } from '../../../graphql/generated';
|
||||
import { DeviceRunSessionQuery } from '../../../graphql/queries/DeviceRunSessionQuery';
|
||||
import { downloadSimulatorArtifactAsync } from '../../../simulator/artifacts';
|
||||
import Log from '../../../log';
|
||||
import { loadSimulatorEnvAsync } from '../../../simulator/env';
|
||||
import {
|
||||
fetchSimulatorPreviewJsonAsync,
|
||||
resolveSimulatorPreviewAsync,
|
||||
} from '../../../simulator/preview';
|
||||
import { enableJsonOutput, printJsonOnlyOutput } from '../../../utils/json';
|
||||
import SimulatorCrashes from '../crashes';
|
||||
|
||||
jest.mock('../../../log');
|
||||
jest.mock('../../../graphql/queries/DeviceRunSessionQuery');
|
||||
jest.mock('../../../simulator/artifacts', () => ({
|
||||
...jest.requireActual('../../../simulator/artifacts'),
|
||||
downloadSimulatorArtifactAsync: jest.fn(),
|
||||
}));
|
||||
jest.mock('../../../simulator/env', () => ({
|
||||
...jest.requireActual('../../../simulator/env'),
|
||||
loadSimulatorEnvAsync: jest.fn(),
|
||||
}));
|
||||
jest.mock('../../../simulator/preview', () => ({
|
||||
...jest.requireActual('../../../simulator/preview'),
|
||||
resolveSimulatorPreviewAsync: jest.fn(),
|
||||
fetchSimulatorPreviewJsonAsync: jest.fn(),
|
||||
}));
|
||||
jest.mock('../../../utils/json');
|
||||
|
||||
const mockLoadSimulatorEnvAsync = jest.mocked(loadSimulatorEnvAsync);
|
||||
const mockResolvePreviewAsync = jest.mocked(resolveSimulatorPreviewAsync);
|
||||
const mockFetchJsonAsync = jest.mocked(fetchSimulatorPreviewJsonAsync);
|
||||
const mockEnableJsonOutput = jest.mocked(enableJsonOutput);
|
||||
const mockPrintJsonOnlyOutput = jest.mocked(printJsonOnlyOutput);
|
||||
const mockLog = jest.mocked(Log.log);
|
||||
const mockWarn = jest.mocked(Log.warn);
|
||||
const originalColorLevel = chalk.level;
|
||||
const preview = {
|
||||
deviceRunSessionId: 'session-id',
|
||||
baseUrl: new URL('https://preview.test'),
|
||||
token: 'preview-token',
|
||||
};
|
||||
const graphqlClient = {} as ExpoGraphqlClient;
|
||||
const projectDir = '/test/project';
|
||||
const crash = {
|
||||
id: 'crash-id',
|
||||
appName: 'CoinFlip',
|
||||
procName: 'CoinFlip',
|
||||
capturedAt: '2026-10-05T12:00:00.000Z',
|
||||
exceptionType: 'EXC_CRASH',
|
||||
signal: 'SIGABRT',
|
||||
count: 2,
|
||||
};
|
||||
|
||||
const crashLog = JSON.stringify({
|
||||
timestamp: '2026-10-05T11:59:59.000Z',
|
||||
processImagePath: '/Applications/CoinFlip.app/CoinFlip',
|
||||
processID: 42,
|
||||
eventMessage: '\u001b[31mlast app log\u001b[0m\u0007',
|
||||
messageType: 'Error',
|
||||
});
|
||||
|
||||
function getMockOclifConfig(): Config {
|
||||
const config = new Config({ root: __dirname });
|
||||
config.runHook = async () => ({ failures: [], successes: [] });
|
||||
return config;
|
||||
}
|
||||
|
||||
describe(SimulatorCrashes, () => {
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
process.env.EAS_SIMULATOR_SESSION_ID = 'session-id';
|
||||
chalk.level = 0;
|
||||
mockLoadSimulatorEnvAsync.mockResolvedValue();
|
||||
jest
|
||||
.mocked(DeviceRunSessionQuery.byIdAsync)
|
||||
.mockResolvedValue({ id: 'session-id', status: DeviceRunSessionStatus.InProgress } as Awaited<
|
||||
ReturnType<typeof DeviceRunSessionQuery.byIdAsync>
|
||||
>);
|
||||
mockResolvePreviewAsync.mockResolvedValue(preview);
|
||||
mockFetchJsonAsync.mockResolvedValue(createSnapshot());
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
delete process.env.EAS_SIMULATOR_SESSION_ID;
|
||||
chalk.level = originalColorLevel;
|
||||
});
|
||||
|
||||
it.each([DeviceRunSessionStatus.Stopped, DeviceRunSessionStatus.Errored])(
|
||||
'downloads crash artifacts for a %s session without preview',
|
||||
async status => {
|
||||
const session = { id: 'session-id', status } as Awaited<
|
||||
ReturnType<typeof DeviceRunSessionQuery.byIdAsync>
|
||||
>;
|
||||
jest.mocked(DeviceRunSessionQuery.byIdAsync).mockResolvedValue(session);
|
||||
await createCommand(['--artifact', '2', '-o', 'crash.ips', '--json']).runAsync();
|
||||
expect(downloadSimulatorArtifactAsync).toHaveBeenCalledWith(session, 'simulator-crash', {
|
||||
artifact: 2,
|
||||
output: 'crash.ips',
|
||||
nonInteractive: true,
|
||||
json: true,
|
||||
});
|
||||
expect(mockResolvePreviewAsync).not.toHaveBeenCalled();
|
||||
expect(DeviceRunSessionQuery.byIdAsync).toHaveBeenCalledTimes(1);
|
||||
}
|
||||
);
|
||||
|
||||
it('rejects a report ID after the session stops with a download action', async () => {
|
||||
jest
|
||||
.mocked(DeviceRunSessionQuery.byIdAsync)
|
||||
.mockResolvedValue({ id: 'session-id', status: DeviceRunSessionStatus.Stopped } as Awaited<
|
||||
ReturnType<typeof DeviceRunSessionQuery.byIdAsync>
|
||||
>);
|
||||
await expect(createCommand(['--report-id', 'report-id']).runAsync()).rejects.toThrow(
|
||||
'Use --output <path>'
|
||||
);
|
||||
expect(mockResolvePreviewAsync).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it.each([
|
||||
['--artifact', '1'],
|
||||
['--output', 'crash.ips'],
|
||||
])('rejects artifact flags on a running session %s', async (...args) => {
|
||||
await expect(createCommand(args).runAsync()).rejects.toThrow(
|
||||
'only available for stopped sessions'
|
||||
);
|
||||
expect(mockFetchJsonAsync).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('styles the crash summary while removing remote terminal controls', async () => {
|
||||
chalk.level = 1;
|
||||
mockFetchJsonAsync.mockResolvedValue(
|
||||
createSnapshot([
|
||||
{
|
||||
...crash,
|
||||
appName: '\u001b[35mCoinFlip\u001b[0m',
|
||||
exceptionType: '\u001b[35mEXC_CRASH\u001b[0m\u0007',
|
||||
},
|
||||
])
|
||||
);
|
||||
|
||||
await createCommand(['--timestamp']).runAsync();
|
||||
|
||||
const output = mockLog.mock.calls[0][0];
|
||||
expect(output).toContain('\u001b[1mCoinFlip\u001b[22m');
|
||||
expect(output).toContain('\u001b[31m');
|
||||
expect(output).not.toContain('\u001b[35m');
|
||||
expect(output).not.toContain('\u0007');
|
||||
expect(output).toContain('EXC_CRASH');
|
||||
});
|
||||
|
||||
it('prints the full crash list and source metadata as JSON', async () => {
|
||||
const snapshot = createSnapshot([crash]);
|
||||
mockFetchJsonAsync.mockResolvedValue(snapshot);
|
||||
|
||||
await createCommand(['--id', 'session-id', '--json']).runAsync();
|
||||
|
||||
expect(mockEnableJsonOutput).toHaveBeenCalled();
|
||||
expect(DeviceRunSessionQuery.byIdAsync).toHaveBeenCalledWith(graphqlClient, 'session-id');
|
||||
expect(mockResolvePreviewAsync).toHaveBeenCalledWith(
|
||||
expect.objectContaining({ id: 'session-id' })
|
||||
);
|
||||
expect(mockFetchJsonAsync).toHaveBeenCalledWith(preview, '/crashes');
|
||||
expect(mockPrintJsonOnlyOutput).toHaveBeenCalledWith({
|
||||
deviceRunSessionId: 'session-id',
|
||||
...snapshot,
|
||||
});
|
||||
expect(mockLog).not.toHaveBeenCalled();
|
||||
expect(mockWarn).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('uses the dotenv session ID and prints crash IDs for retrieving reports', async () => {
|
||||
mockFetchJsonAsync.mockResolvedValue(createSnapshot([crash]));
|
||||
mockLoadSimulatorEnvAsync.mockImplementation(async () => {
|
||||
process.env.EAS_SIMULATOR_SESSION_ID = 'dotenv-id';
|
||||
});
|
||||
|
||||
await createCommand([]).runAsync();
|
||||
|
||||
expect(mockLoadSimulatorEnvAsync).toHaveBeenCalledWith(projectDir);
|
||||
expect(DeviceRunSessionQuery.byIdAsync).toHaveBeenCalledWith(graphqlClient, 'dotenv-id');
|
||||
expect(mockLog).toHaveBeenCalledWith('CoinFlip EXC_CRASH (2 occurrences) crash-id');
|
||||
});
|
||||
|
||||
it.each([crash.capturedAt, null])(
|
||||
'shows requested crash timestamps, including %s',
|
||||
async capturedAt => {
|
||||
mockFetchJsonAsync.mockResolvedValue({
|
||||
...createSnapshot(),
|
||||
crashes: [{ ...crash, capturedAt }],
|
||||
});
|
||||
|
||||
await createCommand(['--timestamp']).runAsync();
|
||||
|
||||
expect(mockLog).toHaveBeenCalledWith(
|
||||
`${capturedAt ?? 'Unknown time'} CoinFlip EXC_CRASH (2 occurrences) crash-id`
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
it('prints source failures instead of silently treating them as no crashes', async () => {
|
||||
mockFetchJsonAsync.mockResolvedValue({
|
||||
...createSnapshot(),
|
||||
meta: { status: 'unavailable', statusError: '\u001b[31mwatcher unavailable\u001b[0m\u0007' },
|
||||
});
|
||||
|
||||
await createCommand([]).runAsync();
|
||||
|
||||
expect(mockWarn).toHaveBeenCalledWith('watcher unavailable');
|
||||
expect(mockLog).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('explains an empty crash list when the watcher is healthy', async () => {
|
||||
await createCommand([]).runAsync();
|
||||
|
||||
expect(mockWarn).not.toHaveBeenCalled();
|
||||
expect(mockLog).toHaveBeenCalledWith(
|
||||
'No crash reports have been recorded. Reports can take a few seconds to appear.'
|
||||
);
|
||||
});
|
||||
|
||||
it('arms the watcher before reading the report and encodes its ID as a path segment', async () => {
|
||||
const detail = {
|
||||
record: crash,
|
||||
occurrence: { index: 1, total: 2, logTail: [crashLog] },
|
||||
report: 'raw crash report',
|
||||
reportError: null,
|
||||
};
|
||||
mockFetchJsonAsync.mockResolvedValueOnce(createSnapshot([crash])).mockResolvedValueOnce(detail);
|
||||
|
||||
await createCommand(['--report-id', 'crash/with?#id', '--json']).runAsync();
|
||||
|
||||
expect(mockFetchJsonAsync).toHaveBeenNthCalledWith(1, preview, '/crashes');
|
||||
expect(mockFetchJsonAsync).toHaveBeenNthCalledWith(
|
||||
2,
|
||||
preview,
|
||||
'/crashes/crash%2Fwith%3F%23id',
|
||||
{
|
||||
notFoundMessage:
|
||||
'The crash report was not found. The ID does not match a report in this session. Run `eas simulator:crashes` to see current report IDs.',
|
||||
}
|
||||
);
|
||||
expect(mockPrintJsonOnlyOutput).toHaveBeenCalledWith({
|
||||
deviceRunSessionId: 'session-id',
|
||||
...detail,
|
||||
});
|
||||
expect(mockLog).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('prints the crash report while removing terminal escape sequences', async () => {
|
||||
mockFetchJsonAsync.mockResolvedValueOnce(createSnapshot([crash])).mockResolvedValueOnce({
|
||||
record: crash,
|
||||
occurrence: { logTail: [] },
|
||||
report: 'header\n\u001b[31mreport body\u001b[0m\u0007',
|
||||
reportError: null,
|
||||
});
|
||||
|
||||
await createCommand(['--report-id', 'crash-id']).runAsync();
|
||||
|
||||
expect(mockLog).toHaveBeenLastCalledWith('header\nreport body');
|
||||
expect(mockWarn).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it.each([false, true])('formats captured app logs with timestamp=%s', async timestamp => {
|
||||
mockFetchJsonAsync.mockResolvedValueOnce(createSnapshot([crash])).mockResolvedValueOnce({
|
||||
record: crash,
|
||||
occurrence: { logTail: [crashLog] },
|
||||
report: 'raw crash report',
|
||||
reportError: null,
|
||||
});
|
||||
|
||||
await createCommand([
|
||||
'--report-id',
|
||||
'crash-id',
|
||||
...(timestamp ? ['--timestamp'] : []),
|
||||
]).runAsync();
|
||||
|
||||
expect(mockLog.mock.calls.map(([line]) => line)).toEqual([
|
||||
`${timestamp ? `${crash.capturedAt} ` : ''}CoinFlip EXC_CRASH (2 occurrences) crash-id`,
|
||||
'raw crash report',
|
||||
`${timestamp ? '2026-10-05T11:59:59.000Z ' : ''}[CoinFlip:42] last app log`,
|
||||
]);
|
||||
expect(mockWarn).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('does not invent timestamps for retained logs without a valid original timestamp', async () => {
|
||||
mockFetchJsonAsync.mockResolvedValueOnce(createSnapshot([crash])).mockResolvedValueOnce({
|
||||
record: crash,
|
||||
occurrence: {
|
||||
logTail: [
|
||||
'plain log',
|
||||
JSON.stringify({ eventMessage: 'untimed app log' }),
|
||||
JSON.stringify({ timestamp: 'not a date', eventMessage: 'invalid time' }),
|
||||
],
|
||||
},
|
||||
report: 'raw crash report',
|
||||
reportError: null,
|
||||
});
|
||||
|
||||
await createCommand(['--report-id', 'crash-id', '--timestamp']).runAsync();
|
||||
|
||||
expect(mockLog.mock.calls.map(([line]) => line)).toEqual([
|
||||
`${crash.capturedAt} CoinFlip EXC_CRASH (2 occurrences) crash-id`,
|
||||
'raw crash report',
|
||||
'plain log',
|
||||
'[unknown] untimed app log',
|
||||
'[unknown] invalid time',
|
||||
]);
|
||||
});
|
||||
|
||||
it('shows why a raw report disappeared and prints the retained app log tail', async () => {
|
||||
mockFetchJsonAsync.mockResolvedValueOnce(createSnapshot([crash])).mockResolvedValueOnce({
|
||||
record: crash,
|
||||
occurrence: { logTail: ['\u001b[31mlast app log\u001b[0m'] },
|
||||
report: null,
|
||||
reportError: 'macOS deleted this report.',
|
||||
});
|
||||
|
||||
await createCommand(['--report-id', 'crash-id']).runAsync();
|
||||
|
||||
expect(mockWarn).toHaveBeenCalledWith('macOS deleted this report.');
|
||||
expect(mockLog).toHaveBeenLastCalledWith('last app log');
|
||||
});
|
||||
|
||||
it('explains a missing report when the session gives no reason', async () => {
|
||||
mockFetchJsonAsync.mockResolvedValueOnce(createSnapshot([crash])).mockResolvedValueOnce({
|
||||
record: crash,
|
||||
occurrence: { logTail: ['last app log'] },
|
||||
report: null,
|
||||
reportError: null,
|
||||
});
|
||||
|
||||
await createCommand(['--report-id', 'crash-id']).runAsync();
|
||||
|
||||
expect(mockWarn).toHaveBeenCalledWith(
|
||||
'The crash report is unavailable. The session recorded the crash but did not return its report. The log lines recorded with the crash follow.'
|
||||
);
|
||||
expect(mockLog).toHaveBeenLastCalledWith('last app log');
|
||||
});
|
||||
|
||||
it('suggests following logs when a missing report has no recorded log lines', async () => {
|
||||
mockFetchJsonAsync.mockResolvedValueOnce(createSnapshot([crash])).mockResolvedValueOnce({
|
||||
record: crash,
|
||||
occurrence: { logTail: [] },
|
||||
report: null,
|
||||
reportError: null,
|
||||
});
|
||||
|
||||
await createCommand(['--report-id', 'crash-id']).runAsync();
|
||||
|
||||
expect(mockWarn).toHaveBeenCalledWith(
|
||||
'The crash report is unavailable. The session recorded the crash but did not return its report. To collect logs, run `eas simulator:logs --follow --scope all` while you reproduce the crash.'
|
||||
);
|
||||
expect(mockLog).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('enables JSON output before rejecting invalid flags', async () => {
|
||||
await expect(createCommand(['--json', '--unknown']).runAsync()).rejects.toThrow();
|
||||
|
||||
expect(mockEnableJsonOutput).toHaveBeenCalled();
|
||||
expect(mockResolvePreviewAsync).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('stops before contacting the preview when there is no session', async () => {
|
||||
delete process.env.EAS_SIMULATOR_SESSION_ID;
|
||||
|
||||
await expect(createCommand([]).runAsync()).rejects.toThrow('No simulator session ID provided.');
|
||||
|
||||
expect(mockResolvePreviewAsync).not.toHaveBeenCalled();
|
||||
expect(mockFetchJsonAsync).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('propagates a missing report error without printing a successful result', async () => {
|
||||
mockFetchJsonAsync
|
||||
.mockResolvedValueOnce(createSnapshot([crash]))
|
||||
.mockRejectedValueOnce(new Error('The requested report was not found.'));
|
||||
|
||||
await expect(createCommand(['--report-id', 'stale-id']).runAsync()).rejects.toThrow(
|
||||
'The requested report was not found.'
|
||||
);
|
||||
|
||||
expect(mockLog).not.toHaveBeenCalled();
|
||||
expect(mockPrintJsonOnlyOutput).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
function createCommand(args: string[]): SimulatorCrashes {
|
||||
const command = new SimulatorCrashes(args, getMockOclifConfig());
|
||||
// @ts-expect-error getContextAsync is protected
|
||||
jest.spyOn(command, 'getContextAsync').mockResolvedValue({
|
||||
loggedIn: { graphqlClient },
|
||||
projectDir,
|
||||
});
|
||||
return command;
|
||||
}
|
||||
|
||||
function createSnapshot(crashes: (typeof crash)[] = []): object {
|
||||
return {
|
||||
meta: {
|
||||
status: 'watching',
|
||||
statusError: null,
|
||||
schemaVersion: 1,
|
||||
reportDelaySeconds: 5,
|
||||
},
|
||||
crashes,
|
||||
};
|
||||
}
|
||||
@@ -1761,6 +1761,48 @@ describe(Simulator, () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('passes --network-capture-recording when requested', async () => {
|
||||
const { command } = createCommand([
|
||||
'--platform',
|
||||
'ios',
|
||||
'--non-interactive',
|
||||
'--network-capture',
|
||||
'--network-capture-recording',
|
||||
]);
|
||||
await command.runAsync();
|
||||
|
||||
expect(mockCreateDeviceRunSessionAsync).toHaveBeenCalledWith(
|
||||
graphqlClient,
|
||||
expect.objectContaining({ networkCapture: true, networkCaptureRecording: true })
|
||||
);
|
||||
});
|
||||
|
||||
it.each([false, true])('omits recording without the flag (capture: %s)', async capture => {
|
||||
const { command } = createCommand([
|
||||
'--platform',
|
||||
'ios',
|
||||
'--non-interactive',
|
||||
...(capture ? ['--network-capture'] : []),
|
||||
]);
|
||||
await command.runAsync();
|
||||
|
||||
expect(mockCreateDeviceRunSessionAsync.mock.calls[0][1]).not.toHaveProperty(
|
||||
'networkCaptureRecording'
|
||||
);
|
||||
});
|
||||
|
||||
it('rejects --network-capture-recording without --network-capture', async () => {
|
||||
const { command } = createCommand([
|
||||
'--platform',
|
||||
'ios',
|
||||
'--non-interactive',
|
||||
'--network-capture-recording',
|
||||
]);
|
||||
|
||||
await expect(command.runAsync()).rejects.toThrow(/network-capture/);
|
||||
expect(mockCreateDeviceRunSessionAsync).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('passes the requested capture fields, splitting a comma-separated value', async () => {
|
||||
const { command } = createCommand([
|
||||
'--platform',
|
||||
|
||||
@@ -0,0 +1,492 @@
|
||||
import { Config } from '@oclif/core';
|
||||
import chalk from 'chalk';
|
||||
import { stripVTControlCharacters } from 'node:util';
|
||||
|
||||
import { ExpoGraphqlClient } from '../../../commandUtils/context/contextUtils/createGraphqlClient';
|
||||
import { DeviceRunSessionStatus } from '../../../graphql/generated';
|
||||
import { DeviceRunSessionQuery } from '../../../graphql/queries/DeviceRunSessionQuery';
|
||||
import { downloadSimulatorArtifactAsync } from '../../../simulator/artifacts';
|
||||
import Log from '../../../log';
|
||||
import { ora } from '../../../ora';
|
||||
import { loadSimulatorEnvAsync } from '../../../simulator/env';
|
||||
import {
|
||||
downloadNetworkCaptureAsync,
|
||||
readNetworkRequestsAsync,
|
||||
streamNetworkRequestsAsync,
|
||||
} from '../../../simulator/networkRequests';
|
||||
import { resolveSimulatorPreviewAsync } from '../../../simulator/preview';
|
||||
import { enableJsonOutput, printJsonOnlyOutput } from '../../../utils/json';
|
||||
import SimulatorNetworkRequests from '../network-requests';
|
||||
|
||||
jest.mock('../../../log');
|
||||
jest.mock('../../../graphql/queries/DeviceRunSessionQuery');
|
||||
jest.mock('../../../simulator/artifacts', () => ({
|
||||
...jest.requireActual('../../../simulator/artifacts'),
|
||||
downloadSimulatorArtifactAsync: jest.fn(),
|
||||
}));
|
||||
jest.mock('../../../ora', () => ({
|
||||
ora: jest.fn(() => {
|
||||
const spinner = {
|
||||
fail: jest.fn(),
|
||||
start: jest.fn(),
|
||||
succeed: jest.fn(),
|
||||
};
|
||||
spinner.start.mockReturnValue(spinner);
|
||||
return spinner;
|
||||
}),
|
||||
}));
|
||||
jest.mock('../../../simulator/env', () => ({
|
||||
...jest.requireActual('../../../simulator/env'),
|
||||
loadSimulatorEnvAsync: jest.fn(),
|
||||
}));
|
||||
jest.mock('../../../simulator/networkRequests');
|
||||
jest.mock('../../../simulator/preview', () => ({
|
||||
...jest.requireActual('../../../simulator/preview'),
|
||||
resolveSimulatorPreviewAsync: jest.fn(),
|
||||
}));
|
||||
jest.mock('../../../utils/json');
|
||||
|
||||
const mockLoadSimulatorEnvAsync = jest.mocked(loadSimulatorEnvAsync);
|
||||
const mockOra = jest.mocked(ora);
|
||||
const mockResolvePreviewAsync = jest.mocked(resolveSimulatorPreviewAsync);
|
||||
const mockReadRequestsAsync = jest.mocked(readNetworkRequestsAsync);
|
||||
const mockDownloadCaptureAsync = jest.mocked(downloadNetworkCaptureAsync);
|
||||
const mockStreamRequestsAsync = jest.mocked(streamNetworkRequestsAsync);
|
||||
const mockEnableJsonOutput = jest.mocked(enableJsonOutput);
|
||||
const mockPrintJsonOnlyOutput = jest.mocked(printJsonOnlyOutput);
|
||||
const mockLog = jest.mocked(Log.log);
|
||||
const originalColorLevel = chalk.level;
|
||||
const graphqlClient = {} as ExpoGraphqlClient;
|
||||
const projectDir = '/test/project';
|
||||
const preview = {
|
||||
deviceRunSessionId: 'session-id',
|
||||
baseUrl: new URL('https://preview.test'),
|
||||
token: 'preview-token',
|
||||
};
|
||||
const requestSummary = {
|
||||
id: 'request-id',
|
||||
startedAt: Date.parse('2026-10-05T12:00:00.000Z'),
|
||||
startedDateTime: '2026-10-05T12:00:00.000Z',
|
||||
method: 'POST',
|
||||
url: 'https://example.test/posts',
|
||||
status: 201,
|
||||
duration: 50,
|
||||
requestSize: 100,
|
||||
responseSize: 200,
|
||||
};
|
||||
const request = {
|
||||
_captureId: 'request-id',
|
||||
startedDateTime: '2026-10-05T12:00:00.000Z',
|
||||
time: 50,
|
||||
request: {
|
||||
method: 'POST',
|
||||
url: 'https://example.test/posts',
|
||||
bodySize: 100,
|
||||
headers: [{ name: 'Content-Type', value: 'application/json' }],
|
||||
postData: { mimeType: 'application/json', text: '{"title":"Coin Flip"}' },
|
||||
},
|
||||
response: {
|
||||
status: 201,
|
||||
bodySize: 200,
|
||||
content: { mimeType: 'application/json', text: '{"id":101}' },
|
||||
},
|
||||
};
|
||||
|
||||
function getMockOclifConfig(): Config {
|
||||
const config = new Config({ root: __dirname });
|
||||
config.runHook = async () => ({ failures: [], successes: [] });
|
||||
return config;
|
||||
}
|
||||
|
||||
describe(SimulatorNetworkRequests, () => {
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
process.env.EAS_SIMULATOR_SESSION_ID = 'session-id';
|
||||
chalk.level = 0;
|
||||
mockLoadSimulatorEnvAsync.mockResolvedValue();
|
||||
jest
|
||||
.mocked(DeviceRunSessionQuery.byIdAsync)
|
||||
.mockResolvedValue({ id: 'session-id', status: DeviceRunSessionStatus.InProgress } as Awaited<
|
||||
ReturnType<typeof DeviceRunSessionQuery.byIdAsync>
|
||||
>);
|
||||
mockResolvePreviewAsync.mockResolvedValue(preview);
|
||||
mockReadRequestsAsync.mockResolvedValue([]);
|
||||
mockDownloadCaptureAsync.mockResolvedValue('/test/capture.har');
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
delete process.env.EAS_SIMULATOR_SESSION_ID;
|
||||
chalk.level = originalColorLevel;
|
||||
});
|
||||
|
||||
it.each([DeviceRunSessionStatus.Stopped, DeviceRunSessionStatus.Errored])(
|
||||
'downloads the capture for a %s session without preview',
|
||||
async status => {
|
||||
const session = { id: 'session-id', status } as Awaited<
|
||||
ReturnType<typeof DeviceRunSessionQuery.byIdAsync>
|
||||
>;
|
||||
jest.mocked(DeviceRunSessionQuery.byIdAsync).mockResolvedValue(session);
|
||||
await createCommand(['--artifact', '2', '--output', 'capture.har', '--json']).runAsync();
|
||||
expect(downloadSimulatorArtifactAsync).toHaveBeenCalledWith(session, 'network-capture', {
|
||||
artifact: 2,
|
||||
output: 'capture.har',
|
||||
nonInteractive: true,
|
||||
json: true,
|
||||
});
|
||||
expect(mockResolvePreviewAsync).not.toHaveBeenCalled();
|
||||
expect(DeviceRunSessionQuery.byIdAsync).toHaveBeenCalledTimes(1);
|
||||
}
|
||||
);
|
||||
|
||||
it.each([['--follow'], ['--request-id', 'r1']])(
|
||||
'rejects live inspection of a stopped session %s',
|
||||
async (...args) => {
|
||||
jest
|
||||
.mocked(DeviceRunSessionQuery.byIdAsync)
|
||||
.mockResolvedValue({ id: 'session-id', status: DeviceRunSessionStatus.Stopped } as Awaited<
|
||||
ReturnType<typeof DeviceRunSessionQuery.byIdAsync>
|
||||
>);
|
||||
await expect(createCommand(args).runAsync()).rejects.toThrow('Use --output <path>');
|
||||
expect(mockResolvePreviewAsync).not.toHaveBeenCalled();
|
||||
}
|
||||
);
|
||||
|
||||
it('rejects artifact selection on a running session', async () => {
|
||||
await expect(createCommand(['--artifact', '1']).runAsync()).rejects.toThrow(
|
||||
'only available for stopped sessions'
|
||||
);
|
||||
expect(mockReadRequestsAsync).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('prints a JSON list for an explicit session with the default limit', async () => {
|
||||
mockReadRequestsAsync.mockResolvedValue([requestSummary]);
|
||||
|
||||
await createCommand(['--id', 'session-id', '--json']).runAsync();
|
||||
|
||||
expect(mockEnableJsonOutput).toHaveBeenCalled();
|
||||
expect(DeviceRunSessionQuery.byIdAsync).toHaveBeenCalledWith(graphqlClient, 'session-id');
|
||||
expect(mockResolvePreviewAsync).toHaveBeenCalledWith(
|
||||
expect.objectContaining({ id: 'session-id' })
|
||||
);
|
||||
expect(mockReadRequestsAsync).toHaveBeenCalledWith(preview, {
|
||||
limit: 100,
|
||||
requestId: undefined,
|
||||
});
|
||||
expect(mockPrintJsonOnlyOutput).toHaveBeenCalledWith({
|
||||
deviceRunSessionId: 'session-id',
|
||||
requests: [requestSummary],
|
||||
});
|
||||
expect(mockLog).not.toHaveBeenCalled();
|
||||
expect(mockDownloadCaptureAsync).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('prints a full request detail including captured headers and bodies as JSON', async () => {
|
||||
mockReadRequestsAsync.mockResolvedValue(request);
|
||||
|
||||
await createCommand(['--request-id', 'request-id', '--json']).runAsync();
|
||||
|
||||
expect(mockReadRequestsAsync).toHaveBeenCalledWith(preview, {
|
||||
limit: 100,
|
||||
requestId: 'request-id',
|
||||
});
|
||||
expect(mockPrintJsonOnlyOutput).toHaveBeenCalledWith({
|
||||
deviceRunSessionId: 'session-id',
|
||||
request,
|
||||
});
|
||||
expect(mockLog).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('downloads a HAR and prints only the resulting file metadata as JSON', async () => {
|
||||
await createCommand(['--output', './capture.har', '--json']).runAsync();
|
||||
|
||||
expect(mockDownloadCaptureAsync).toHaveBeenCalledWith(preview, './capture.har');
|
||||
expect(mockPrintJsonOnlyOutput).toHaveBeenCalledWith({
|
||||
deviceRunSessionId: 'session-id',
|
||||
filePath: '/test/capture.har',
|
||||
});
|
||||
expect(mockReadRequestsAsync).not.toHaveBeenCalled();
|
||||
expect(mockLog).not.toHaveBeenCalled();
|
||||
expect(mockOra).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('shows a spinner with the saved path for human output', async () => {
|
||||
await createCommand(['-o', './capture.har']).runAsync();
|
||||
|
||||
const spinner = mockOra.mock.results[0].value;
|
||||
expect(mockOra).toHaveBeenCalledWith('Saving network capture');
|
||||
expect(spinner.succeed).toHaveBeenCalledWith('Saved network capture to /test/capture.har');
|
||||
expect(mockPrintJsonOnlyOutput).not.toHaveBeenCalled();
|
||||
expect(mockReadRequestsAsync).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('forwards an explicit limit and uses the dotenv session ID', async () => {
|
||||
mockReadRequestsAsync.mockResolvedValue([requestSummary]);
|
||||
mockLoadSimulatorEnvAsync.mockImplementation(async () => {
|
||||
process.env.EAS_SIMULATOR_SESSION_ID = 'dotenv-id';
|
||||
});
|
||||
|
||||
await createCommand(['--limit', '3']).runAsync();
|
||||
|
||||
expect(mockLoadSimulatorEnvAsync).toHaveBeenCalledWith(projectDir);
|
||||
expect(DeviceRunSessionQuery.byIdAsync).toHaveBeenCalledWith(graphqlClient, 'dotenv-id');
|
||||
expect(mockReadRequestsAsync).toHaveBeenCalledWith(preview, { limit: 3, requestId: undefined });
|
||||
expect(mockLog).toHaveBeenCalledWith(
|
||||
'request-id POST https://example.test/posts 201 50ms'
|
||||
);
|
||||
});
|
||||
|
||||
it('sanitizes terminal controls in human request summaries', async () => {
|
||||
mockReadRequestsAsync.mockResolvedValue([
|
||||
{ ...requestSummary, url: '\u001b[31mhttps://example.test/posts\u001b[0m\u0007' },
|
||||
]);
|
||||
|
||||
await createCommand([]).runAsync();
|
||||
|
||||
expect(mockLog).toHaveBeenCalledWith(
|
||||
'request-id POST https://example.test/posts 201 50ms'
|
||||
);
|
||||
});
|
||||
|
||||
it('rounds floating-point HAR timing noise only in human summaries', async () => {
|
||||
const summary = { ...requestSummary, duration: 2.8999999999999995 };
|
||||
mockReadRequestsAsync.mockResolvedValue([summary]);
|
||||
|
||||
await createCommand([]).runAsync();
|
||||
|
||||
expect(mockLog).toHaveBeenCalledWith(
|
||||
'request-id POST https://example.test/posts 201 2.9ms'
|
||||
);
|
||||
|
||||
await createCommand(['--json']).runAsync();
|
||||
|
||||
expect(mockPrintJsonOnlyOutput).toHaveBeenCalledWith({
|
||||
deviceRunSessionId: 'session-id',
|
||||
requests: [summary],
|
||||
});
|
||||
});
|
||||
|
||||
it('adds intentional colors after sanitizing remote text and preserves full URLs', async () => {
|
||||
chalk.level = 1;
|
||||
const url = `https://example.test/${'long-path/'.repeat(30)}`;
|
||||
mockReadRequestsAsync.mockResolvedValue([
|
||||
{
|
||||
...requestSummary,
|
||||
id: '\u001b[35mr1\u001b[0m\u0007',
|
||||
startedDateTime: '\u001b[35m2026-10-05T12:00:00.000Z\u001b[0m\u0007',
|
||||
method: '\u001b[35mGET\u001b[0m\u0007',
|
||||
url: `\u001b[35m${url}\u001b[0m\u0007`,
|
||||
},
|
||||
]);
|
||||
|
||||
await createCommand(['--timestamp']).runAsync();
|
||||
|
||||
const output = mockLog.mock.calls[0][0] as string;
|
||||
expect(output).toBe(
|
||||
[
|
||||
chalk.dim('2026-10-05T12:00:00.000Z'),
|
||||
chalk.dim('r1 '),
|
||||
chalk.bold.cyan('GET '),
|
||||
url,
|
||||
chalk.green('201'),
|
||||
chalk.dim('50ms'),
|
||||
].join(' ')
|
||||
);
|
||||
expect(output).toContain('\u001b[1m\u001b[36mGET ');
|
||||
expect(output).not.toContain('\u001b[35m');
|
||||
expect(output).not.toContain('\u0007');
|
||||
expect(stripVTControlCharacters(output)).toBe(
|
||||
`2026-10-05T12:00:00.000Z r1 GET ${url} 201 50ms`
|
||||
);
|
||||
});
|
||||
|
||||
it.each([
|
||||
[200, '\u001b[32m'],
|
||||
[299, '\u001b[32m'],
|
||||
[301, '\u001b[36m'],
|
||||
[399, '\u001b[36m'],
|
||||
[404, '\u001b[33m'],
|
||||
[499, '\u001b[33m'],
|
||||
[500, '\u001b[31m'],
|
||||
[599, '\u001b[31m'],
|
||||
[0, '\u001b[31m'],
|
||||
])('colors numeric status %i by response class', async (status, color) => {
|
||||
chalk.level = 1;
|
||||
mockReadRequestsAsync.mockResolvedValue([{ ...requestSummary, status }]);
|
||||
|
||||
await createCommand([]).runAsync();
|
||||
|
||||
expect(mockLog.mock.calls[0][0]).toContain(`${color}${status}\u001b[39m`);
|
||||
});
|
||||
|
||||
it('leaves JSON data untouched when terminal color is enabled', async () => {
|
||||
chalk.level = 1;
|
||||
mockReadRequestsAsync.mockResolvedValue([requestSummary]);
|
||||
|
||||
await createCommand(['--json']).runAsync();
|
||||
|
||||
expect(mockPrintJsonOnlyOutput).toHaveBeenCalledWith({
|
||||
deviceRunSessionId: 'session-id',
|
||||
requests: [requestSummary],
|
||||
});
|
||||
expect(JSON.stringify(mockPrintJsonOnlyOutput.mock.calls[0][0])).not.toContain('\\u001b');
|
||||
expect(mockLog).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('shows request start timestamps only when requested in human output', async () => {
|
||||
mockReadRequestsAsync.mockResolvedValue([requestSummary]);
|
||||
|
||||
await createCommand(['--timestamp']).runAsync();
|
||||
|
||||
expect(mockLog).toHaveBeenCalledWith(
|
||||
'2026-10-05T12:00:00.000Z request-id POST https://example.test/posts 201 50ms'
|
||||
);
|
||||
});
|
||||
|
||||
it.each(['--follow', '-f'])(
|
||||
'streams human summaries with %s without fetching a finite list',
|
||||
async follow => {
|
||||
mockStreamRequestsAsync.mockImplementation(async (_preview, onRequest) => {
|
||||
onRequest(requestSummary);
|
||||
});
|
||||
|
||||
await createCommand([follow, '--timestamp']).runAsync();
|
||||
|
||||
expect(mockStreamRequestsAsync).toHaveBeenCalledWith(
|
||||
preview,
|
||||
expect.any(Function),
|
||||
expect.any(AbortSignal)
|
||||
);
|
||||
expect(mockLog).toHaveBeenCalledWith(
|
||||
'2026-10-05T12:00:00.000Z request-id POST https://example.test/posts 201 50ms'
|
||||
);
|
||||
expect(mockReadRequestsAsync).not.toHaveBeenCalled();
|
||||
expect(mockDownloadCaptureAsync).not.toHaveBeenCalled();
|
||||
expect(mockPrintJsonOnlyOutput).not.toHaveBeenCalled();
|
||||
}
|
||||
);
|
||||
|
||||
it('stops following on Ctrl+C and removes its interrupt handler', async () => {
|
||||
const listeners = process.listeners('SIGINT');
|
||||
let signal: AbortSignal | undefined;
|
||||
mockStreamRequestsAsync.mockImplementation(async (_preview, _onRequest, followSignal) => {
|
||||
signal = followSignal;
|
||||
process.emit('SIGINT');
|
||||
});
|
||||
|
||||
await createCommand(['--follow']).runAsync();
|
||||
|
||||
expect(signal?.aborted).toBe(true);
|
||||
expect(process.listeners('SIGINT')).toEqual(listeners);
|
||||
});
|
||||
|
||||
it.each([
|
||||
{ options: ['--json'] },
|
||||
{ options: ['--limit', '1'] },
|
||||
{ options: ['--request-id', 'r1'] },
|
||||
{ options: ['--output', 'capture.har'] },
|
||||
])('rejects incompatible follow options $options before session access', async ({ options }) => {
|
||||
await expect(createCommand(['--follow', ...options]).runAsync()).rejects.toThrow();
|
||||
|
||||
expect(mockResolvePreviewAsync).not.toHaveBeenCalled();
|
||||
expect(mockStreamRequestsAsync).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('enables JSON output before rejecting JSON follow output', async () => {
|
||||
await expect(createCommand(['--json', '--follow']).runAsync()).rejects.toThrow(
|
||||
'Use either --json or --follow, not both.'
|
||||
);
|
||||
|
||||
expect(mockEnableJsonOutput).toHaveBeenCalled();
|
||||
expect(mockLoadSimulatorEnvAsync).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('prints a full request detail for human output', async () => {
|
||||
mockReadRequestsAsync.mockResolvedValue(request);
|
||||
|
||||
await createCommand(['--request-id', 'request-id']).runAsync();
|
||||
|
||||
expect(mockLog).toHaveBeenCalledWith(JSON.stringify(request, null, 2));
|
||||
expect(mockPrintJsonOnlyOutput).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('explains the initial-launch limitation when the capture is empty', async () => {
|
||||
await createCommand([]).runAsync();
|
||||
|
||||
expect(mockLog).toHaveBeenCalledWith(
|
||||
'No completed network requests were captured. Initial-launch requests may have been missed.'
|
||||
);
|
||||
});
|
||||
|
||||
it('rejects combining a request detail and HAR output before resolving a session', async () => {
|
||||
await expect(
|
||||
createCommand(['--request-id', 'request-id', '--output', './capture.har']).runAsync()
|
||||
).rejects.toThrow();
|
||||
|
||||
expect(mockResolvePreviewAsync).not.toHaveBeenCalled();
|
||||
expect(mockReadRequestsAsync).not.toHaveBeenCalled();
|
||||
expect(mockDownloadCaptureAsync).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('rejects a nonpositive request limit', async () => {
|
||||
await expect(createCommand(['--limit', '0']).runAsync()).rejects.toThrow();
|
||||
|
||||
expect(mockResolvePreviewAsync).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('propagates a missing capture error without printing an empty list', async () => {
|
||||
mockReadRequestsAsync.mockRejectedValue(
|
||||
new Error('No network capture was found. Start the session with --network-capture.')
|
||||
);
|
||||
|
||||
await expect(createCommand([]).runAsync()).rejects.toThrow(
|
||||
'Start the session with --network-capture.'
|
||||
);
|
||||
|
||||
expect(mockLog).not.toHaveBeenCalled();
|
||||
expect(mockPrintJsonOnlyOutput).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('propagates HAR download failures without claiming a file was saved', async () => {
|
||||
mockDownloadCaptureAsync.mockRejectedValue(new Error('The output file already exists.'));
|
||||
|
||||
await expect(createCommand(['--output', './capture.har', '--json']).runAsync()).rejects.toThrow(
|
||||
'The output file already exists.'
|
||||
);
|
||||
|
||||
expect(mockPrintJsonOnlyOutput).not.toHaveBeenCalled();
|
||||
expect(mockLog).not.toHaveBeenCalled();
|
||||
expect(mockReadRequestsAsync).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('fails the spinner when the HAR download fails', async () => {
|
||||
mockDownloadCaptureAsync.mockRejectedValue(new Error('The output file already exists.'));
|
||||
|
||||
await expect(createCommand(['--output', './capture.har']).runAsync()).rejects.toThrow(
|
||||
'The output file already exists.'
|
||||
);
|
||||
|
||||
const spinner = mockOra.mock.results[0].value;
|
||||
expect(spinner.fail).toHaveBeenCalledWith('Failed to save network capture');
|
||||
expect(spinner.succeed).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('stops before reading traffic when there is no simulator session', async () => {
|
||||
delete process.env.EAS_SIMULATOR_SESSION_ID;
|
||||
|
||||
await expect(createCommand([]).runAsync()).rejects.toThrow('No simulator session ID provided.');
|
||||
|
||||
expect(mockResolvePreviewAsync).not.toHaveBeenCalled();
|
||||
expect(mockReadRequestsAsync).not.toHaveBeenCalled();
|
||||
expect(mockDownloadCaptureAsync).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
function createCommand(args: string[]): SimulatorNetworkRequests {
|
||||
const command = new SimulatorNetworkRequests(args, getMockOclifConfig());
|
||||
// @ts-expect-error getContextAsync is protected
|
||||
jest.spyOn(command, 'getContextAsync').mockResolvedValue({
|
||||
loggedIn: { graphqlClient },
|
||||
projectDir,
|
||||
});
|
||||
return command;
|
||||
}
|
||||
@@ -0,0 +1,200 @@
|
||||
import { Flags } from '@oclif/core';
|
||||
import chalk from 'chalk';
|
||||
|
||||
import EasCommand from '../../commandUtils/EasCommand';
|
||||
import {
|
||||
EasNonInteractiveAndJsonFlags,
|
||||
resolveNonInteractiveAndJsonFlags,
|
||||
} from '../../commandUtils/flags';
|
||||
import { DeviceRunSessionQuery } from '../../graphql/queries/DeviceRunSessionQuery';
|
||||
import Log from '../../log';
|
||||
import { downloadSimulatorArtifactAsync, hasSimulatorArtifacts } from '../../simulator/artifacts';
|
||||
import {
|
||||
getSimulatorCommandAliases,
|
||||
getSimulatorCommandHiddenAliases,
|
||||
} from '../../simulator/commandAliases';
|
||||
import {
|
||||
EAS_SIMULATOR_SESSION_ID,
|
||||
SIMULATOR_DOTENV_FILE_NAME,
|
||||
loadSimulatorEnvAsync,
|
||||
} from '../../simulator/env';
|
||||
import {
|
||||
fetchSimulatorPreviewJsonAsync,
|
||||
resolveSimulatorPreviewAsync,
|
||||
} from '../../simulator/preview';
|
||||
import { formatLogLine, stripTerminalControlCharacters } from '../../simulator/utils';
|
||||
import { enableJsonOutput, printJsonOnlyOutput } from '../../utils/json';
|
||||
|
||||
interface SimulatorCrashSummary {
|
||||
id: string;
|
||||
appName: string | null;
|
||||
procName: string | null;
|
||||
capturedAt: string | null;
|
||||
exceptionType: string | null;
|
||||
signal: string | null;
|
||||
count: number;
|
||||
}
|
||||
|
||||
interface SimulatorCrashesSnapshot {
|
||||
meta: { status: string; statusError: string | null };
|
||||
crashes: SimulatorCrashSummary[];
|
||||
}
|
||||
|
||||
interface SimulatorCrashDetail {
|
||||
record: SimulatorCrashSummary;
|
||||
occurrence: { logTail: string[] };
|
||||
report: string | null;
|
||||
reportError: string | null;
|
||||
}
|
||||
|
||||
export default class SimulatorCrashes extends EasCommand {
|
||||
static override aliases = getSimulatorCommandAliases('crashes');
|
||||
static override hiddenAliases = getSimulatorCommandHiddenAliases('crashes');
|
||||
static override description =
|
||||
'[EXPERIMENTAL] show crash reports from a remote iOS simulator session\n\n' +
|
||||
'For logs during a crash reproduction, run `eas simulator:logs --follow --scope all` first.';
|
||||
|
||||
static override examples = [
|
||||
'<%= config.bin %> simulator:crashes --json',
|
||||
'<%= config.bin %> simulator:crashes --id <session-id> --artifact 1 --output crash.ips',
|
||||
'<%= config.bin %> simulator:crashes --report-id <report-id>',
|
||||
];
|
||||
|
||||
static override flags = {
|
||||
id: Flags.string({
|
||||
description: `Simulator session ID. Defaults to ${SIMULATOR_DOTENV_FILE_NAME}.`,
|
||||
}),
|
||||
artifact: Flags.integer({
|
||||
min: 1,
|
||||
description: 'Artifact index to download from a stopped session (1-based).',
|
||||
}),
|
||||
output: Flags.string({
|
||||
char: 'o',
|
||||
description: 'Save one stopped session IPS crash report to this path.',
|
||||
}),
|
||||
'report-id': Flags.string({
|
||||
description: 'Show the newest occurrence of a crash. Use an ID from the crash list.',
|
||||
}),
|
||||
timestamp: Flags.boolean({
|
||||
description: 'Show timestamps in live human-readable crash summaries.',
|
||||
}),
|
||||
...EasNonInteractiveAndJsonFlags,
|
||||
};
|
||||
|
||||
static override contextDefinition = {
|
||||
...this.ContextOptions.LoggedIn,
|
||||
...this.ContextOptions.ProjectDir,
|
||||
};
|
||||
|
||||
async runAsync(): Promise<void> {
|
||||
// Before parsing, so only the JSON result reaches stdout.
|
||||
if (this.argv.includes('--json')) {
|
||||
enableJsonOutput();
|
||||
}
|
||||
const { flags } = await this.parse(SimulatorCrashes);
|
||||
const { json: jsonFlag, nonInteractive } = resolveNonInteractiveAndJsonFlags(flags);
|
||||
|
||||
const {
|
||||
projectDir,
|
||||
loggedIn: { graphqlClient },
|
||||
} = await this.getContextAsync(SimulatorCrashes, { nonInteractive });
|
||||
await loadSimulatorEnvAsync(projectDir);
|
||||
const deviceRunSessionId = flags.id ?? process.env[EAS_SIMULATOR_SESSION_ID];
|
||||
if (!deviceRunSessionId) {
|
||||
throw new Error(
|
||||
`No simulator session ID provided. Pass --id, or run \`eas simulator:start\` first to write ${SIMULATOR_DOTENV_FILE_NAME}.`
|
||||
);
|
||||
}
|
||||
const session = await DeviceRunSessionQuery.byIdAsync(graphqlClient, deviceRunSessionId);
|
||||
if (hasSimulatorArtifacts(session)) {
|
||||
if (flags['report-id']) {
|
||||
throw new Error(
|
||||
'The session has stopped. --report-id is only available while it runs. Use --output <path> to download its crash artifact.'
|
||||
);
|
||||
}
|
||||
await downloadSimulatorArtifactAsync(session, 'simulator-crash', {
|
||||
artifact: flags.artifact,
|
||||
output: flags.output,
|
||||
nonInteractive,
|
||||
json: jsonFlag,
|
||||
});
|
||||
return;
|
||||
}
|
||||
const preview = await resolveSimulatorPreviewAsync(session);
|
||||
if (flags.artifact !== undefined || flags.output !== undefined) {
|
||||
throw new Error(
|
||||
'--artifact and --output are only available for stopped sessions. Use --report-id to inspect a live crash report.'
|
||||
);
|
||||
}
|
||||
// Read the list even with --report-id, because only the list route starts the crash watcher.
|
||||
const snapshot = await fetchSimulatorPreviewJsonAsync<SimulatorCrashesSnapshot>(
|
||||
preview,
|
||||
'/crashes'
|
||||
);
|
||||
if (!jsonFlag && snapshot.meta.statusError) {
|
||||
Log.warn(stripTerminalControlCharacters(snapshot.meta.statusError));
|
||||
}
|
||||
|
||||
if (flags['report-id']) {
|
||||
const detail = await fetchSimulatorPreviewJsonAsync<SimulatorCrashDetail>(
|
||||
preview,
|
||||
`/crashes/${encodeURIComponent(flags['report-id'])}`,
|
||||
{
|
||||
notFoundMessage:
|
||||
'The crash report was not found. The ID does not match a report in this session. Run `eas simulator:crashes` to see current report IDs.',
|
||||
}
|
||||
);
|
||||
if (jsonFlag) {
|
||||
printJsonOnlyOutput({ deviceRunSessionId: preview.deviceRunSessionId, ...detail });
|
||||
return;
|
||||
}
|
||||
Log.log(formatCrashSummary(detail.record, flags.timestamp));
|
||||
const { logTail } = detail.occurrence;
|
||||
if (detail.report !== null) {
|
||||
Log.log(stripTerminalControlCharacters(detail.report, { keepNewlinesAndTabs: true }));
|
||||
} else {
|
||||
Log.warn(
|
||||
detail.reportError
|
||||
? stripTerminalControlCharacters(detail.reportError)
|
||||
: 'The crash report is unavailable. The session recorded the crash but did not return its report. ' +
|
||||
(logTail.length > 0
|
||||
? 'The log lines recorded with the crash follow.'
|
||||
: 'To collect logs, run `eas simulator:logs --follow --scope all` while you reproduce the crash.')
|
||||
);
|
||||
}
|
||||
for (const line of logTail) {
|
||||
Log.log(formatLogLine(line, flags.timestamp, { fallbackTimestamp: false }));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (jsonFlag) {
|
||||
printJsonOnlyOutput({ deviceRunSessionId: preview.deviceRunSessionId, ...snapshot });
|
||||
return;
|
||||
}
|
||||
if (snapshot.crashes.length === 0) {
|
||||
// The warning above already explains why the list can be empty.
|
||||
if (!snapshot.meta.statusError) {
|
||||
Log.log('No crash reports have been recorded. Reports can take a few seconds to appear.');
|
||||
}
|
||||
return;
|
||||
}
|
||||
for (const crash of snapshot.crashes) {
|
||||
Log.log(formatCrashSummary(crash, flags.timestamp));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function formatCrashSummary(crash: SimulatorCrashSummary, timestamp = false): string {
|
||||
const prefix = timestamp
|
||||
? `${chalk.dim(stripTerminalControlCharacters(crash.capturedAt ?? 'Unknown time'))} `
|
||||
: '';
|
||||
const appName = chalk.bold(
|
||||
stripTerminalControlCharacters(crash.appName ?? crash.procName ?? 'Unknown app')
|
||||
);
|
||||
const exception = chalk.red.bold(
|
||||
stripTerminalControlCharacters(crash.exceptionType ?? crash.signal ?? 'Unknown exception')
|
||||
);
|
||||
const count = chalk.dim(`(${crash.count} occurrence${crash.count === 1 ? '' : 's'})`);
|
||||
return `${prefix}${appName} ${exception} ${count} ${chalk.dim(stripTerminalControlCharacters(crash.id))}`;
|
||||
}
|
||||
@@ -198,7 +198,11 @@ With local egress, actions wait for the connection and require interactive mode.
|
||||
'network-capture': Flags.boolean({
|
||||
allowNo: true,
|
||||
description:
|
||||
'Record HTTP(S) traffic from apps on the device (iOS only). HTTPS is decrypted, so recordings contain credentials in cleartext and certificate-pinned apps fail to connect.',
|
||||
'Capture HTTP(S) traffic from apps on the device for live inspection (iOS only). HTTPS is decrypted, so captured traffic can contain credentials in cleartext and certificate-pinned apps fail to connect.',
|
||||
}),
|
||||
'network-capture-recording': Flags.boolean({
|
||||
description: 'Save network capture as HAR artifacts for access after the session ends.',
|
||||
dependsOn: ['network-capture'],
|
||||
}),
|
||||
'network-capture-field': Flags.string({
|
||||
description:
|
||||
@@ -459,6 +463,7 @@ With local egress, actions wait for the connection and require interactive mode.
|
||||
publicPreview: flags['public-link'] ?? false,
|
||||
packageVersion: flags['package-version'],
|
||||
networkCapture: flags['network-capture'],
|
||||
...(flags['network-capture-recording'] ? { networkCaptureRecording: true } : {}),
|
||||
...(networkCaptureFields.length ? { networkCaptureFields } : {}),
|
||||
...platformInput,
|
||||
...(buildId ? { buildId } : {}),
|
||||
@@ -509,7 +514,7 @@ With local egress, actions wait for the connection and require interactive mode.
|
||||
);
|
||||
if (flags['network-capture']) {
|
||||
Log.warn(
|
||||
'Network capture was requested. HTTPS is decrypted, so recordings contain credentials in cleartext. Relaunch an installed app to record its traffic.'
|
||||
'Network capture was requested. HTTPS is decrypted, so captured traffic can contain credentials in cleartext. Relaunch an installed app to capture its traffic.'
|
||||
);
|
||||
}
|
||||
} catch (err) {
|
||||
|
||||
@@ -193,7 +193,7 @@ export default class SimulatorLogs extends EasCommand {
|
||||
return;
|
||||
}
|
||||
for (const line of snapshot.lines) {
|
||||
Log.log(formatLogLine(line.raw, flags.timestamp, line.at));
|
||||
Log.log(formatLogLine(line.raw, flags.timestamp, { at: line.at }));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -204,7 +204,7 @@ function formatLogEnvelope(data: string): string {
|
||||
line = JSON.parse(data);
|
||||
} catch {}
|
||||
return typeof line?.raw === 'string' && isValidLogTime(line.at)
|
||||
? formatLogLine(line.raw, true, line.at)
|
||||
? formatLogLine(line.raw, true, { at: line.at })
|
||||
: formatLogLine(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,216 @@
|
||||
import { Flags } from '@oclif/core';
|
||||
import chalk from 'chalk';
|
||||
|
||||
import EasCommand from '../../commandUtils/EasCommand';
|
||||
import {
|
||||
EasNonInteractiveAndJsonFlags,
|
||||
resolveNonInteractiveAndJsonFlags,
|
||||
} from '../../commandUtils/flags';
|
||||
import { DeviceRunSessionQuery } from '../../graphql/queries/DeviceRunSessionQuery';
|
||||
import Log from '../../log';
|
||||
import { downloadSimulatorArtifactAsync, hasSimulatorArtifacts } from '../../simulator/artifacts';
|
||||
import {
|
||||
getSimulatorCommandAliases,
|
||||
getSimulatorCommandHiddenAliases,
|
||||
} from '../../simulator/commandAliases';
|
||||
import { ora } from '../../ora';
|
||||
import {
|
||||
EAS_SIMULATOR_SESSION_ID,
|
||||
SIMULATOR_DOTENV_FILE_NAME,
|
||||
loadSimulatorEnvAsync,
|
||||
} from '../../simulator/env';
|
||||
import {
|
||||
type NetworkRequestSummary,
|
||||
downloadNetworkCaptureAsync,
|
||||
readNetworkRequestsAsync,
|
||||
streamNetworkRequestsAsync,
|
||||
} from '../../simulator/networkRequests';
|
||||
import { resolveSimulatorPreviewAsync } from '../../simulator/preview';
|
||||
import { stripTerminalControlCharacters } from '../../simulator/utils';
|
||||
import { enableJsonOutput, printJsonOnlyOutput } from '../../utils/json';
|
||||
|
||||
export default class SimulatorNetworkRequests extends EasCommand {
|
||||
static override aliases = getSimulatorCommandAliases('network-requests');
|
||||
static override hiddenAliases = getSimulatorCommandHiddenAliases('network-requests');
|
||||
static override description =
|
||||
'[EXPERIMENTAL] inspect completed network requests from a capture-enabled simulator session';
|
||||
|
||||
static override examples = [
|
||||
'<%= config.bin %> simulator:network-requests --json',
|
||||
'<%= config.bin %> simulator:network-requests --follow --timestamp',
|
||||
'<%= config.bin %> simulator:network-requests --request-id r1 --json',
|
||||
'<%= config.bin %> simulator:network-requests --output capture.har',
|
||||
];
|
||||
|
||||
static override flags = {
|
||||
id: Flags.string({
|
||||
description: `Simulator session ID. Defaults to ${SIMULATOR_DOTENV_FILE_NAME}.`,
|
||||
}),
|
||||
artifact: Flags.integer({
|
||||
min: 1,
|
||||
description: 'Artifact index to download from a stopped session (1-based).',
|
||||
}),
|
||||
'request-id': Flags.string({
|
||||
description:
|
||||
'Show a captured request, including the headers and bodies selected for capture.',
|
||||
exclusive: ['output'],
|
||||
}),
|
||||
output: Flags.string({
|
||||
char: 'o',
|
||||
description: 'Save the live HAR or a stopped session capture artifact to this path.',
|
||||
exclusive: ['request-id'],
|
||||
}),
|
||||
follow: Flags.boolean({
|
||||
char: 'f',
|
||||
description: 'Stream completed requests, including those retained by the current capture.',
|
||||
exclusive: ['request-id', 'output', 'limit'],
|
||||
}),
|
||||
limit: Flags.integer({
|
||||
description: 'Maximum number of recent live requests to list without --follow.',
|
||||
default: 100,
|
||||
min: 1,
|
||||
}),
|
||||
timestamp: Flags.boolean({
|
||||
description: 'Show request start timestamps in live human-readable lists.',
|
||||
}),
|
||||
...EasNonInteractiveAndJsonFlags,
|
||||
};
|
||||
|
||||
static override contextDefinition = {
|
||||
...this.ContextOptions.LoggedIn,
|
||||
...this.ContextOptions.ProjectDir,
|
||||
};
|
||||
|
||||
async runAsync(): Promise<void> {
|
||||
// Before parsing, so only the JSON result reaches stdout.
|
||||
if (this.argv.includes('--json')) {
|
||||
enableJsonOutput();
|
||||
}
|
||||
const { flags } = await this.parse(SimulatorNetworkRequests);
|
||||
const { json: jsonFlag, nonInteractive } = resolveNonInteractiveAndJsonFlags(flags);
|
||||
if (jsonFlag && flags.follow) {
|
||||
throw new Error('Use either --json or --follow, not both.');
|
||||
}
|
||||
|
||||
const {
|
||||
projectDir,
|
||||
loggedIn: { graphqlClient },
|
||||
} = await this.getContextAsync(SimulatorNetworkRequests, { nonInteractive });
|
||||
await loadSimulatorEnvAsync(projectDir);
|
||||
const deviceRunSessionId = flags.id ?? process.env[EAS_SIMULATOR_SESSION_ID];
|
||||
if (!deviceRunSessionId) {
|
||||
throw new Error(
|
||||
`No simulator session ID provided. Pass --id, or run \`eas simulator:start\` first to write ${SIMULATOR_DOTENV_FILE_NAME}.`
|
||||
);
|
||||
}
|
||||
const session = await DeviceRunSessionQuery.byIdAsync(graphqlClient, deviceRunSessionId);
|
||||
if (hasSimulatorArtifacts(session)) {
|
||||
if (flags.follow || flags['request-id']) {
|
||||
throw new Error(
|
||||
'The session has stopped. --follow and --request-id are only available while it runs. Use --output <path> to download its capture artifact.'
|
||||
);
|
||||
}
|
||||
await downloadSimulatorArtifactAsync(session, 'network-capture', {
|
||||
artifact: flags.artifact,
|
||||
output: flags.output,
|
||||
nonInteractive,
|
||||
json: jsonFlag,
|
||||
});
|
||||
return;
|
||||
}
|
||||
const preview = await resolveSimulatorPreviewAsync(session);
|
||||
if (flags.artifact !== undefined) {
|
||||
throw new Error(
|
||||
'--artifact is only available for stopped sessions. Use --output <path> to save the live HAR.'
|
||||
);
|
||||
}
|
||||
|
||||
if (flags.follow) {
|
||||
const abortController = new AbortController();
|
||||
const interruptHandler = (): void => {
|
||||
if (abortController.signal.aborted) {
|
||||
process.exit(130);
|
||||
}
|
||||
abortController.abort();
|
||||
};
|
||||
process.on('SIGINT', interruptHandler);
|
||||
try {
|
||||
await streamNetworkRequestsAsync(
|
||||
preview,
|
||||
request => {
|
||||
Log.log(formatRequestSummary(request, flags.timestamp));
|
||||
},
|
||||
abortController.signal
|
||||
);
|
||||
} finally {
|
||||
process.removeListener('SIGINT', interruptHandler);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (flags.output) {
|
||||
const downloadSpinner = jsonFlag ? null : ora('Saving network capture').start();
|
||||
let filePath: string;
|
||||
try {
|
||||
filePath = await downloadNetworkCaptureAsync(preview, flags.output);
|
||||
downloadSpinner?.succeed(`Saved network capture to ${filePath}`);
|
||||
} catch (err) {
|
||||
downloadSpinner?.fail('Failed to save network capture');
|
||||
throw err;
|
||||
}
|
||||
if (jsonFlag) {
|
||||
printJsonOnlyOutput({ deviceRunSessionId: preview.deviceRunSessionId, filePath });
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
const result = await readNetworkRequestsAsync(preview, {
|
||||
limit: flags.limit,
|
||||
requestId: flags['request-id'],
|
||||
});
|
||||
if (jsonFlag) {
|
||||
printJsonOnlyOutput({
|
||||
deviceRunSessionId: preview.deviceRunSessionId,
|
||||
...(Array.isArray(result) ? { requests: result } : { request: result }),
|
||||
});
|
||||
} else if (!Array.isArray(result)) {
|
||||
Log.log(
|
||||
stripTerminalControlCharacters(JSON.stringify(result, null, 2), {
|
||||
keepNewlinesAndTabs: true,
|
||||
})
|
||||
);
|
||||
} else if (result.length === 0) {
|
||||
Log.log(
|
||||
'No completed network requests were captured. Initial-launch requests may have been missed.'
|
||||
);
|
||||
} else {
|
||||
for (const request of result) {
|
||||
Log.log(formatRequestSummary(request, flags.timestamp));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function formatRequestSummary(request: NetworkRequestSummary, timestamp = false): string {
|
||||
let status = String(request.status);
|
||||
if (request.status === 0 || request.status >= 500) {
|
||||
status = chalk.red(status);
|
||||
} else if (request.status >= 400) {
|
||||
status = chalk.yellow(status);
|
||||
} else if (request.status >= 300) {
|
||||
status = chalk.cyan(status);
|
||||
} else if (request.status >= 200) {
|
||||
status = chalk.green(status);
|
||||
}
|
||||
const fields = [
|
||||
chalk.dim(stripTerminalControlCharacters(request.id ?? '-').padEnd(5)),
|
||||
chalk.bold.cyan(stripTerminalControlCharacters(request.method).padEnd(6)),
|
||||
stripTerminalControlCharacters(request.url),
|
||||
status,
|
||||
chalk.dim(`${Math.round(request.duration * 10) / 10}ms`),
|
||||
];
|
||||
if (timestamp) {
|
||||
fields.unshift(chalk.dim(stripTerminalControlCharacters(request.startedDateTime)));
|
||||
}
|
||||
return fields.join(' ');
|
||||
}
|
||||
@@ -133,7 +133,7 @@ export default class WorkflowView extends EasCommand {
|
||||
|
||||
result.logURL = getWorkflowRunUrl(
|
||||
result.workflow.app.ownerAccount.name,
|
||||
result.workflow.app.slug,
|
||||
result.workflow.app.name,
|
||||
result.id
|
||||
);
|
||||
|
||||
|
||||
+34
-37
@@ -6805,9 +6805,9 @@ export type CreateDeviceRunSessionInput = {
|
||||
*/
|
||||
name?: InputMaybe<Scalars['String']['input']>;
|
||||
/**
|
||||
* Record HTTP(S) traffic from apps on the device for the whole session. iOS only.
|
||||
* HTTPS is decrypted, so recordings contain credentials and cookies in cleartext.
|
||||
* If omitted, no traffic is recorded.
|
||||
* Capture HTTP(S) traffic from apps on the device for live inspection. iOS only.
|
||||
* HTTPS is decrypted, so captured traffic can contain credentials and cookies in cleartext.
|
||||
* If omitted, network capture is disabled.
|
||||
*/
|
||||
networkCapture?: InputMaybe<Scalars['Boolean']['input']>;
|
||||
/**
|
||||
@@ -6816,6 +6816,11 @@ export type CreateDeviceRunSessionInput = {
|
||||
* it is asked for. Requires networkCapture.
|
||||
*/
|
||||
networkCaptureFields?: InputMaybe<Array<Scalars['String']['input']>>;
|
||||
/**
|
||||
* Record network capture as a HAR artifact for access after the session. Requires networkCapture.
|
||||
* If omitted, HAR artifact recording is disabled.
|
||||
*/
|
||||
networkCaptureRecording?: InputMaybe<Scalars['Boolean']['input']>;
|
||||
/**
|
||||
* Expo or development-client URL to open after launching the installed application. Requires
|
||||
* buildId, applicationArchiveUrl, or expoGo.
|
||||
@@ -14976,6 +14981,13 @@ export type ResumeUpdateChannelMutationVariables = Exact<{
|
||||
|
||||
export type ResumeUpdateChannelMutation = { __typename?: 'RootMutation', updateChannel: { __typename?: 'UpdateChannelMutation', resumeUpdateChannel: { __typename?: 'UpdateChannel', id: string, name: string, branchMapping: string, isProtected: boolean } } };
|
||||
|
||||
export type AppInfoQueryVariables = Exact<{
|
||||
appId: Scalars['String']['input'];
|
||||
}>;
|
||||
|
||||
|
||||
export type AppInfoQuery = { __typename?: 'RootQuery', app: { __typename?: 'AppQuery', byId: { __typename?: 'App', id: string, fullName: string } } };
|
||||
|
||||
export type CreateAndroidAppBuildCredentialsMutationVariables = Exact<{
|
||||
androidAppBuildCredentialsInput: AndroidAppBuildCredentialsInput;
|
||||
androidAppCredentialsId: Scalars['ID']['input'];
|
||||
@@ -15517,21 +15529,6 @@ export type ScheduleAppDeletionMutationVariables = Exact<{
|
||||
|
||||
export type ScheduleAppDeletionMutation = { __typename?: 'RootMutation', app?: { __typename?: 'AppMutation', scheduleAppDeletion: { __typename?: 'BackgroundJobReceipt', id: string, state: BackgroundJobState, tries: number, willRetry: boolean, resultId?: string | null, resultType: BackgroundJobResultType, resultData?: any | null, errorCode?: string | null, errorMessage?: string | null, createdAt: any, updatedAt: any } } | null };
|
||||
|
||||
export type RemoveProfileImageMutationVariables = Exact<{
|
||||
appId: Scalars['ID']['input'];
|
||||
}>;
|
||||
|
||||
|
||||
export type RemoveProfileImageMutation = { __typename?: 'RootMutation', app?: { __typename?: 'AppMutation', removeProfileImage: { __typename?: 'App', id: string, fullName: string } } | null };
|
||||
|
||||
export type SetAppDisplayNameMutationVariables = Exact<{
|
||||
appId: Scalars['ID']['input'];
|
||||
appInfo: AppInfoInput;
|
||||
}>;
|
||||
|
||||
|
||||
export type SetAppDisplayNameMutation = { __typename?: 'RootMutation', app?: { __typename?: 'AppMutation', setAppInfo: { __typename?: 'App', id: string, name: string, fullName: string } } | null };
|
||||
|
||||
export type CreateAppVersionMutationVariables = Exact<{
|
||||
appVersionInput: AppVersionInput;
|
||||
}>;
|
||||
@@ -15561,7 +15558,7 @@ export type CreateAndroidBuildMutationVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type CreateAndroidBuildMutation = { __typename?: 'RootMutation', build: { __typename?: 'BuildMutation', createAndroidBuild: { __typename?: 'CreateBuildResult', build: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFileUrls: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
export type CreateAndroidBuildMutation = { __typename?: 'RootMutation', build: { __typename?: 'BuildMutation', createAndroidBuild: { __typename?: 'CreateBuildResult', build: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFiles: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
| { __typename: 'PartnerActor', id: string, displayName: string }
|
||||
| { __typename: 'Robot', id: string, displayName: string }
|
||||
| { __typename: 'SSOUser', id: string, displayName: string }
|
||||
@@ -15576,7 +15573,7 @@ export type CreateIosBuildMutationVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type CreateIosBuildMutation = { __typename?: 'RootMutation', build: { __typename?: 'BuildMutation', createIosBuild: { __typename?: 'CreateBuildResult', build: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFileUrls: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
export type CreateIosBuildMutation = { __typename?: 'RootMutation', build: { __typename?: 'BuildMutation', createIosBuild: { __typename?: 'CreateBuildResult', build: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFiles: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
| { __typename: 'PartnerActor', id: string, displayName: string }
|
||||
| { __typename: 'Robot', id: string, displayName: string }
|
||||
| { __typename: 'SSOUser', id: string, displayName: string }
|
||||
@@ -15589,7 +15586,7 @@ export type UpdateBuildMetadataMutationVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type UpdateBuildMetadataMutation = { __typename?: 'RootMutation', build: { __typename?: 'BuildMutation', updateBuildMetadata: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFileUrls: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
export type UpdateBuildMetadataMutation = { __typename?: 'RootMutation', build: { __typename?: 'BuildMutation', updateBuildMetadata: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFiles: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
| { __typename: 'PartnerActor', id: string, displayName: string }
|
||||
| { __typename: 'Robot', id: string, displayName: string }
|
||||
| { __typename: 'SSOUser', id: string, displayName: string }
|
||||
@@ -15602,7 +15599,7 @@ export type RetryIosBuildMutationVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type RetryIosBuildMutation = { __typename?: 'RootMutation', build: { __typename?: 'BuildMutation', retryIosBuild: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFileUrls: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
export type RetryIosBuildMutation = { __typename?: 'RootMutation', build: { __typename?: 'BuildMutation', retryIosBuild: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFiles: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
| { __typename: 'PartnerActor', id: string, displayName: string }
|
||||
| { __typename: 'Robot', id: string, displayName: string }
|
||||
| { __typename: 'SSOUser', id: string, displayName: string }
|
||||
@@ -15763,7 +15760,7 @@ export type CreateLocalBuildMutationVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type CreateLocalBuildMutation = { __typename?: 'RootMutation', build: { __typename?: 'BuildMutation', createLocalBuild: { __typename?: 'CreateBuildResult', build: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFileUrls: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
export type CreateLocalBuildMutation = { __typename?: 'RootMutation', build: { __typename?: 'BuildMutation', createLocalBuild: { __typename?: 'CreateBuildResult', build: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFiles: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
| { __typename: 'PartnerActor', id: string, displayName: string }
|
||||
| { __typename: 'Robot', id: string, displayName: string }
|
||||
| { __typename: 'SSOUser', id: string, displayName: string }
|
||||
@@ -16292,7 +16289,7 @@ export type BuildsByIdQueryVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type BuildsByIdQuery = { __typename?: 'RootQuery', builds: { __typename?: 'BuildQuery', byId: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFileUrls: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
export type BuildsByIdQuery = { __typename?: 'RootQuery', builds: { __typename?: 'BuildQuery', byId: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFiles: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
| { __typename: 'PartnerActor', id: string, displayName: string }
|
||||
| { __typename: 'Robot', id: string, displayName: string }
|
||||
| { __typename: 'SSOUser', id: string, displayName: string }
|
||||
@@ -16304,7 +16301,7 @@ export type BuildsWithSubmissionsByIdQueryVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type BuildsWithSubmissionsByIdQuery = { __typename?: 'RootQuery', builds: { __typename?: 'BuildQuery', byId: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFileUrls: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, submissions: Array<{ __typename?: 'Submission', id: string, status: SubmissionStatus, platform: AppPlatform, logFiles: Array<string>, app: { __typename?: 'App', id: string, name: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string } }, androidConfig?: { __typename?: 'AndroidSubmissionConfig', track: string, releaseStatus?: SubmissionAndroidReleaseStatus | null, rollout?: number | null } | null, iosConfig?: { __typename?: 'IosSubmissionConfig', ascAppIdentifier: string, appleIdUsername?: string | null } | null, error?: { __typename?: 'SubmissionError', errorCode?: string | null, message?: string | null } | null }>, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
export type BuildsWithSubmissionsByIdQuery = { __typename?: 'RootQuery', builds: { __typename?: 'BuildQuery', byId: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFiles: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, submissions: Array<{ __typename?: 'Submission', id: string, status: SubmissionStatus, platform: AppPlatform, logFiles: Array<string>, app: { __typename?: 'App', id: string, name: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string } }, androidConfig?: { __typename?: 'AndroidSubmissionConfig', track: string, releaseStatus?: SubmissionAndroidReleaseStatus | null, rollout?: number | null } | null, iosConfig?: { __typename?: 'IosSubmissionConfig', ascAppIdentifier: string, appleIdUsername?: string | null } | null, error?: { __typename?: 'SubmissionError', errorCode?: string | null, message?: string | null } | null }>, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
| { __typename: 'PartnerActor', id: string, displayName: string }
|
||||
| { __typename: 'Robot', id: string, displayName: string }
|
||||
| { __typename: 'SSOUser', id: string, displayName: string }
|
||||
@@ -16316,7 +16313,7 @@ export type BuildsWithFingerprintByIdQueryVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type BuildsWithFingerprintByIdQuery = { __typename?: 'RootQuery', builds: { __typename?: 'BuildQuery', byId: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFileUrls: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string, debugInfoUrl?: string | null, builds: { __typename?: 'AppBuildsConnection', edges: Array<{ __typename?: 'AppBuildEdge', node: { __typename?: 'Build', platform: AppPlatform, id: string } }> }, updates: { __typename?: 'AppUpdatesConnection', edges: Array<{ __typename?: 'AppUpdateEdge', node: { __typename?: 'Update', id: string, platform: string } }> } } | null, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, initiatingActor?:
|
||||
export type BuildsWithFingerprintByIdQuery = { __typename?: 'RootQuery', builds: { __typename?: 'BuildQuery', byId: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFiles: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string, debugInfoUrl?: string | null, builds: { __typename?: 'AppBuildsConnection', edges: Array<{ __typename?: 'AppBuildEdge', node: { __typename?: 'Build', platform: AppPlatform, id: string } }> }, updates: { __typename?: 'AppUpdatesConnection', edges: Array<{ __typename?: 'AppUpdateEdge', node: { __typename?: 'Update', id: string, platform: string } }> } } | null, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, initiatingActor?:
|
||||
| { __typename: 'PartnerActor', id: string, displayName: string }
|
||||
| { __typename: 'Robot', id: string, displayName: string }
|
||||
| { __typename: 'SSOUser', id: string, displayName: string }
|
||||
@@ -16331,7 +16328,7 @@ export type ViewBuildsOnAppQueryVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type ViewBuildsOnAppQuery = { __typename?: 'RootQuery', app: { __typename?: 'AppQuery', byId: { __typename?: 'App', id: string, builds: Array<{ __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFileUrls: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
export type ViewBuildsOnAppQuery = { __typename?: 'RootQuery', app: { __typename?: 'AppQuery', byId: { __typename?: 'App', id: string, builds: Array<{ __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFiles: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
| { __typename: 'PartnerActor', id: string, displayName: string }
|
||||
| { __typename: 'Robot', id: string, displayName: string }
|
||||
| { __typename: 'SSOUser', id: string, displayName: string }
|
||||
@@ -16744,7 +16741,7 @@ export type SubmissionByIdWithSubmittedBuildQueryVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type SubmissionByIdWithSubmittedBuildQuery = { __typename?: 'RootQuery', submissions: { __typename?: 'SubmissionQuery', byId: { __typename?: 'Submission', id: string, createdAt: any, completedAt?: any | null, canRetry: boolean, maxRetryTimeMinutes: number, status: SubmissionStatus, platform: AppPlatform, logFiles: Array<string>, submittedBuild?: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFileUrls: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
export type SubmissionByIdWithSubmittedBuildQuery = { __typename?: 'RootQuery', submissions: { __typename?: 'SubmissionQuery', byId: { __typename?: 'Submission', id: string, createdAt: any, completedAt?: any | null, canRetry: boolean, maxRetryTimeMinutes: number, status: SubmissionStatus, platform: AppPlatform, logFiles: Array<string>, submittedBuild?: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFiles: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
| { __typename: 'PartnerActor', id: string, displayName: string }
|
||||
| { __typename: 'Robot', id: string, displayName: string }
|
||||
| { __typename: 'SSOUser', id: string, displayName: string }
|
||||
@@ -16760,7 +16757,7 @@ export type GetAllSubmissionsForAppQueryVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type GetAllSubmissionsForAppQuery = { __typename?: 'RootQuery', app: { __typename?: 'AppQuery', byId: { __typename?: 'App', id: string, submissions: Array<{ __typename?: 'Submission', id: string, createdAt: any, completedAt?: any | null, canRetry: boolean, maxRetryTimeMinutes: number, status: SubmissionStatus, platform: AppPlatform, logFiles: Array<string>, submittedBuild?: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFileUrls: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
export type GetAllSubmissionsForAppQuery = { __typename?: 'RootQuery', app: { __typename?: 'AppQuery', byId: { __typename?: 'App', id: string, submissions: Array<{ __typename?: 'Submission', id: string, createdAt: any, completedAt?: any | null, canRetry: boolean, maxRetryTimeMinutes: number, status: SubmissionStatus, platform: AppPlatform, logFiles: Array<string>, submittedBuild?: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFiles: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
| { __typename: 'PartnerActor', id: string, displayName: string }
|
||||
| { __typename: 'Robot', id: string, displayName: string }
|
||||
| { __typename: 'SSOUser', id: string, displayName: string }
|
||||
@@ -16779,7 +16776,7 @@ export type GetProjectStatusSubmissionsQuery = { __typename?: 'RootQuery', app:
|
||||
| { __typename?: 'Robot', id: string, displayName: string }
|
||||
| { __typename?: 'SSOUser', id: string, displayName: string }
|
||||
| { __typename?: 'User', id: string, displayName: string }
|
||||
| null, submittedBuild?: { __typename?: 'Build', id: string, appIdentifier?: string | null } | null, androidConfig?: { __typename?: 'AndroidSubmissionConfig', track: string, releaseStatus?: SubmissionAndroidReleaseStatus | null, rollout?: number | null } | null, iosConfig?: { __typename?: 'IosSubmissionConfig', ascAppIdentifier: string } | null, error?: { __typename?: 'SubmissionError', errorCode?: string | null, message?: string | null } | null }> } } };
|
||||
| null, submittedBuild?: { __typename?: 'Build', id: string } | null, androidConfig?: { __typename?: 'AndroidSubmissionConfig', applicationIdentifier?: string | null, track: string, releaseStatus?: SubmissionAndroidReleaseStatus | null, rollout?: number | null } | null, iosConfig?: { __typename?: 'IosSubmissionConfig', ascAppIdentifier: string } | null, error?: { __typename?: 'SubmissionError', errorCode?: string | null, message?: string | null } | null }> } } };
|
||||
|
||||
export type SupabaseConnectionByAccountIdQueryVariables = Exact<{
|
||||
accountId: Scalars['String']['input'];
|
||||
@@ -16989,7 +16986,7 @@ export type WorkflowJobByIdQueryVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type WorkflowJobByIdQuery = { __typename?: 'RootQuery', workflowJobs: { __typename?: 'WorkflowJobQuery', byId: { __typename?: 'WorkflowJob', id: string, key: string, name: string, status: WorkflowJobStatus, type: WorkflowJobType, outputs: any, createdAt: any, updatedAt: any, workflowRun: { __typename?: 'WorkflowRun', id: string }, turtleJobRun?: { __typename?: 'JobRun', id: string, logFileUrls: Array<string>, artifacts: Array<{ __typename?: 'WorkflowArtifact', id: string, name: string, contentType?: string | null, fileSizeBytes?: number | null, filename: string, downloadUrl?: string | null }>, errors: Array<{ __typename?: 'JobRunError', errorCode: string, message: string }> } | null, turtleBuild?: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFileUrls: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
export type WorkflowJobByIdQuery = { __typename?: 'RootQuery', workflowJobs: { __typename?: 'WorkflowJobQuery', byId: { __typename?: 'WorkflowJob', id: string, key: string, name: string, status: WorkflowJobStatus, type: WorkflowJobType, outputs: any, createdAt: any, updatedAt: any, workflowRun: { __typename?: 'WorkflowRun', id: string }, turtleJobRun?: { __typename?: 'JobRun', id: string, logFileUrls: Array<string>, artifacts: Array<{ __typename?: 'WorkflowArtifact', id: string, name: string, contentType?: string | null, fileSizeBytes?: number | null, filename: string, downloadUrl?: string | null }>, errors: Array<{ __typename?: 'JobRunError', errorCode: string, message: string }> } | null, turtleBuild?: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFiles: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
| { __typename: 'PartnerActor', id: string, displayName: string }
|
||||
| { __typename: 'Robot', id: string, displayName: string }
|
||||
| { __typename: 'SSOUser', id: string, displayName: string }
|
||||
@@ -17041,7 +17038,7 @@ export type WorkflowRunByIdWithJobsQueryVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type WorkflowRunByIdWithJobsQuery = { __typename?: 'RootQuery', workflowRuns: { __typename?: 'WorkflowRunQuery', byId: { __typename?: 'WorkflowRun', id: string, status: WorkflowRunStatus, gitCommitMessage?: string | null, gitCommitHash?: string | null, requestedGitRef?: string | null, triggeringLabelName?: string | null, triggerEventType: WorkflowRunTriggerEventType, triggeringSchedule?: string | null, createdAt: any, updatedAt: any, finalizedAt?: any | null, blockingWorkflowRun?: { __typename?: 'WorkflowRun', id: string, name: string, status: WorkflowRunStatus } | null, workflow: { __typename?: 'Workflow', id: string, name?: string | null, fileName: string, app: { __typename?: 'App', id: string, name: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string } } }, jobs: Array<{ __typename?: 'WorkflowJob', id: string, key: string, name: string, status: WorkflowJobStatus, type: WorkflowJobType, outputs: any, createdAt: any, updatedAt: any, workflowRun: { __typename?: 'WorkflowRun', id: string }, turtleJobRun?: { __typename?: 'JobRun', id: string, logFileUrls: Array<string>, artifacts: Array<{ __typename?: 'WorkflowArtifact', id: string, name: string, contentType?: string | null, fileSizeBytes?: number | null, filename: string, downloadUrl?: string | null }>, errors: Array<{ __typename?: 'JobRunError', errorCode: string, message: string }> } | null, turtleBuild?: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFileUrls: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
export type WorkflowRunByIdWithJobsQuery = { __typename?: 'RootQuery', workflowRuns: { __typename?: 'WorkflowRunQuery', byId: { __typename?: 'WorkflowRun', id: string, status: WorkflowRunStatus, gitCommitMessage?: string | null, gitCommitHash?: string | null, requestedGitRef?: string | null, triggeringLabelName?: string | null, triggerEventType: WorkflowRunTriggerEventType, triggeringSchedule?: string | null, createdAt: any, updatedAt: any, finalizedAt?: any | null, blockingWorkflowRun?: { __typename?: 'WorkflowRun', id: string, name: string, status: WorkflowRunStatus } | null, workflow: { __typename?: 'Workflow', id: string, name?: string | null, fileName: string, app: { __typename?: 'App', id: string, name: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string } } }, jobs: Array<{ __typename?: 'WorkflowJob', id: string, key: string, name: string, status: WorkflowJobStatus, type: WorkflowJobType, outputs: any, createdAt: any, updatedAt: any, workflowRun: { __typename?: 'WorkflowRun', id: string }, turtleJobRun?: { __typename?: 'JobRun', id: string, logFileUrls: Array<string>, artifacts: Array<{ __typename?: 'WorkflowArtifact', id: string, name: string, contentType?: string | null, fileSizeBytes?: number | null, filename: string, downloadUrl?: string | null }>, errors: Array<{ __typename?: 'JobRunError', errorCode: string, message: string }> } | null, turtleBuild?: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFiles: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
| { __typename: 'PartnerActor', id: string, displayName: string }
|
||||
| { __typename: 'Robot', id: string, displayName: string }
|
||||
| { __typename: 'SSOUser', id: string, displayName: string }
|
||||
@@ -17147,21 +17144,21 @@ export type AuditLogFragment = { __typename?: 'AuditLog', id: string, createdAt:
|
||||
|
||||
export type BackgroundJobReceiptDataFragment = { __typename?: 'BackgroundJobReceipt', id: string, state: BackgroundJobState, tries: number, willRetry: boolean, resultId?: string | null, resultType: BackgroundJobResultType, resultData?: any | null, errorCode?: string | null, errorMessage?: string | null, createdAt: any, updatedAt: any };
|
||||
|
||||
export type BuildFragment = { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFileUrls: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
export type BuildFragment = { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFiles: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
| { __typename: 'PartnerActor', id: string, displayName: string }
|
||||
| { __typename: 'Robot', id: string, displayName: string }
|
||||
| { __typename: 'SSOUser', id: string, displayName: string }
|
||||
| { __typename: 'User', id: string, displayName: string }
|
||||
| null, app: { __typename: 'App', id: string, name: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string } }, updateChannel?: { __typename?: 'UpdateChannel', id: string, name: string } | null, runtime?: { __typename?: 'Runtime', id: string, version: string } | null, metrics?: { __typename?: 'BuildMetrics', buildWaitTime?: number | null, buildQueueTime?: number | null, buildDuration?: number | null } | null };
|
||||
|
||||
export type BuildWithSubmissionsFragment = { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFileUrls: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, submissions: Array<{ __typename?: 'Submission', id: string, status: SubmissionStatus, platform: AppPlatform, logFiles: Array<string>, app: { __typename?: 'App', id: string, name: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string } }, androidConfig?: { __typename?: 'AndroidSubmissionConfig', track: string, releaseStatus?: SubmissionAndroidReleaseStatus | null, rollout?: number | null } | null, iosConfig?: { __typename?: 'IosSubmissionConfig', ascAppIdentifier: string, appleIdUsername?: string | null } | null, error?: { __typename?: 'SubmissionError', errorCode?: string | null, message?: string | null } | null }>, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
export type BuildWithSubmissionsFragment = { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFiles: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, submissions: Array<{ __typename?: 'Submission', id: string, status: SubmissionStatus, platform: AppPlatform, logFiles: Array<string>, app: { __typename?: 'App', id: string, name: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string } }, androidConfig?: { __typename?: 'AndroidSubmissionConfig', track: string, releaseStatus?: SubmissionAndroidReleaseStatus | null, rollout?: number | null } | null, iosConfig?: { __typename?: 'IosSubmissionConfig', ascAppIdentifier: string, appleIdUsername?: string | null } | null, error?: { __typename?: 'SubmissionError', errorCode?: string | null, message?: string | null } | null }>, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
| { __typename: 'PartnerActor', id: string, displayName: string }
|
||||
| { __typename: 'Robot', id: string, displayName: string }
|
||||
| { __typename: 'SSOUser', id: string, displayName: string }
|
||||
| { __typename: 'User', id: string, displayName: string }
|
||||
| null, app: { __typename: 'App', id: string, name: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string } }, updateChannel?: { __typename?: 'UpdateChannel', id: string, name: string } | null, runtime?: { __typename?: 'Runtime', id: string, version: string } | null, metrics?: { __typename?: 'BuildMetrics', buildWaitTime?: number | null, buildQueueTime?: number | null, buildDuration?: number | null } | null };
|
||||
|
||||
export type BuildWithFingerprintFragment = { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFileUrls: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string, debugInfoUrl?: string | null, builds: { __typename?: 'AppBuildsConnection', edges: Array<{ __typename?: 'AppBuildEdge', node: { __typename?: 'Build', platform: AppPlatform, id: string } }> }, updates: { __typename?: 'AppUpdatesConnection', edges: Array<{ __typename?: 'AppUpdateEdge', node: { __typename?: 'Update', id: string, platform: string } }> } } | null, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, initiatingActor?:
|
||||
export type BuildWithFingerprintFragment = { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFiles: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string, debugInfoUrl?: string | null, builds: { __typename?: 'AppBuildsConnection', edges: Array<{ __typename?: 'AppBuildEdge', node: { __typename?: 'Build', platform: AppPlatform, id: string } }> }, updates: { __typename?: 'AppUpdatesConnection', edges: Array<{ __typename?: 'AppUpdateEdge', node: { __typename?: 'Update', id: string, platform: string } }> } } | null, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, initiatingActor?:
|
||||
| { __typename: 'PartnerActor', id: string, displayName: string }
|
||||
| { __typename: 'Robot', id: string, displayName: string }
|
||||
| { __typename: 'SSOUser', id: string, displayName: string }
|
||||
@@ -17206,7 +17203,7 @@ export type StatuspageServiceFragment = { __typename?: 'StatuspageService', id:
|
||||
|
||||
export type SubmissionFragment = { __typename?: 'Submission', id: string, status: SubmissionStatus, platform: AppPlatform, logFiles: Array<string>, app: { __typename?: 'App', id: string, name: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string } }, androidConfig?: { __typename?: 'AndroidSubmissionConfig', track: string, releaseStatus?: SubmissionAndroidReleaseStatus | null, rollout?: number | null } | null, iosConfig?: { __typename?: 'IosSubmissionConfig', ascAppIdentifier: string, appleIdUsername?: string | null } | null, error?: { __typename?: 'SubmissionError', errorCode?: string | null, message?: string | null } | null };
|
||||
|
||||
export type SubmissionWithSubmittedBuildFragment = { __typename?: 'Submission', id: string, createdAt: any, completedAt?: any | null, canRetry: boolean, maxRetryTimeMinutes: number, status: SubmissionStatus, platform: AppPlatform, logFiles: Array<string>, submittedBuild?: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFileUrls: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
export type SubmissionWithSubmittedBuildFragment = { __typename?: 'Submission', id: string, createdAt: any, completedAt?: any | null, canRetry: boolean, maxRetryTimeMinutes: number, status: SubmissionStatus, platform: AppPlatform, logFiles: Array<string>, submittedBuild?: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFiles: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
| { __typename: 'PartnerActor', id: string, displayName: string }
|
||||
| { __typename: 'Robot', id: string, displayName: string }
|
||||
| { __typename: 'SSOUser', id: string, displayName: string }
|
||||
@@ -17248,7 +17245,7 @@ export type WebhookFragment = { __typename?: 'Webhook', id: string, event: Webho
|
||||
|
||||
export type WorkflowFragment = { __typename?: 'Workflow', id: string, name?: string | null, fileName: string, createdAt: any, updatedAt: any, revisionsPaginated: { __typename?: 'WorkflowRevisionsConnection', edges: Array<{ __typename?: 'WorkflowRevisionEdge', node: { __typename?: 'WorkflowRevision', id: string, blobSha: string, commitSha?: string | null, createdAt: any, yamlConfig: string } }> } };
|
||||
|
||||
export type WorkflowJobFragment = { __typename?: 'WorkflowJob', id: string, key: string, name: string, status: WorkflowJobStatus, type: WorkflowJobType, outputs: any, createdAt: any, updatedAt: any, workflowRun: { __typename?: 'WorkflowRun', id: string }, turtleJobRun?: { __typename?: 'JobRun', id: string, logFileUrls: Array<string>, artifacts: Array<{ __typename?: 'WorkflowArtifact', id: string, name: string, contentType?: string | null, fileSizeBytes?: number | null, filename: string, downloadUrl?: string | null }>, errors: Array<{ __typename?: 'JobRunError', errorCode: string, message: string }> } | null, turtleBuild?: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFileUrls: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
export type WorkflowJobFragment = { __typename?: 'WorkflowJob', id: string, key: string, name: string, status: WorkflowJobStatus, type: WorkflowJobType, outputs: any, createdAt: any, updatedAt: any, workflowRun: { __typename?: 'WorkflowRun', id: string }, turtleJobRun?: { __typename?: 'JobRun', id: string, logFileUrls: Array<string>, artifacts: Array<{ __typename?: 'WorkflowArtifact', id: string, name: string, contentType?: string | null, fileSizeBytes?: number | null, filename: string, downloadUrl?: string | null }>, errors: Array<{ __typename?: 'JobRunError', errorCode: string, message: string }> } | null, turtleBuild?: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, logFiles: Array<string>, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, appIdentifier?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, expirationDate?: any | null, isForIosSimulator: boolean, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null, buildArtifactsUrl?: string | null } | null, fingerprint?: { __typename?: 'Fingerprint', id: string, hash: string } | null, initiatingActor?:
|
||||
| { __typename: 'PartnerActor', id: string, displayName: string }
|
||||
| { __typename: 'Robot', id: string, displayName: string }
|
||||
| { __typename: 'SSOUser', id: string, displayName: string }
|
||||
|
||||
Loaded 100 of 132 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user