Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/remove-asc-upload-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@expo/build-tools': major
---

Remove `wait_for_processing` from `eas/upload_to_asc`; use a separate `eas/wait_for_asc_build_processing` step to wait for App Store Connect processing.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async function waitAsync(diagnostics: Record<string, string> = {}): Promise<void
.executeAsync();
}

async function uploadAsync(waitForProcessing?: boolean): Promise<void> {
async function uploadAsync(): Promise<void> {
await fs.outputFile('/project/app.ipa', 'ipa');
jest.mocked(readIpaInfoAsync).mockResolvedValue({
bundleIdentifier: 'com.test.ipa',
Expand All @@ -51,7 +51,6 @@ async function uploadAsync(waitForProcessing?: boolean): Promise<void> {
apple_app_identifier: 'app',
bundle_version: '1',
bundle_short_version: '1.0',
...(waitForProcessing === undefined ? {} : { wait_for_processing: waitForProcessing }),
},
});
await step.executeAsync();
Expand Down Expand Up @@ -208,32 +207,16 @@ it('reports missing privacy purpose strings when Apple does not name a key', asy
});
});

it.each([undefined, false, true])(
'keeps upload wait_for_processing=%s compatible',
async waitForProcessing => {
if (waitForProcessing) {
mockProcessing('PROCESSING');
mockProcessing('FAILED', [{ code: '90725', description: 'SDK is too old' }]);
}
if (waitForProcessing) {
await expect(uploadAsync(waitForProcessing)).rejects.toMatchObject({
errorCode: 'EAS_UPLOAD_TO_ASC_SDK_VERSION_ISSUE',
});
} else {
await expect(uploadAsync(waitForProcessing)).resolves.toBeUndefined();
}
}
);

it.each(['upload', 'wait'])(
'preserves the successful timeout return for the %s step',
async step => {
mockProcessing('PROCESSING');
const start = Date.now();
jest.spyOn(Date, 'now').mockReturnValue(start);
jest.mocked(setTimeout).mockImplementationOnce(async () => {
jest.spyOn(Date, 'now').mockReturnValue(start + 30 * 60 * 1000);
});
await expect(step === 'upload' ? uploadAsync(true) : waitAsync()).resolves.toBeUndefined();
}
);
it('finishes the upload without waiting for processing', async () => {
await expect(uploadAsync()).resolves.toBeUndefined();
});

it('preserves the successful timeout return for the wait step', async () => {
mockProcessing('PROCESSING');
const start = Date.now();
jest.spyOn(Date, 'now').mockReturnValue(start);
jest.mocked(setTimeout).mockImplementationOnce(async () => {
jest.spyOn(Date, 'now').mockReturnValue(start + 30 * 60 * 1000);
});
await expect(waitAsync()).resolves.toBeUndefined();
});
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export async function updateTestFlightMetadataAsync({
if (upload.attributes?.state?.state !== 'COMPLETE' || !buildId) {
throw new UserError(
'EAS_TESTFLIGHT_BUILD_NOT_READY',
'The uploaded build is not ready for TestFlight metadata. Run eas/wait_for_asc_build_processing first, or use eas/upload_to_asc with wait_for_processing: true.'
'The uploaded build is not ready for TestFlight metadata. Run eas/wait_for_asc_build_processing first.'
);
}
logger.info(`Updating TestFlight metadata for Apple build ${buildId}...`);
Expand Down
23 changes: 0 additions & 23 deletions packages/build-tools/src/steps/functions/uploadToAsc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { z } from 'zod';
import { AscApiClient, AscApiClientPostApi } from '../utils/ios/AscApiClient';
import { AscApiUtils } from '../utils/ios/AscApiUtils';
import { readIpaInfoAsync } from './readIpaInfo';
import { waitForAscBuildProcessingAsync } from './waitForAscBuildProcessing';

export function createUploadToAscBuildFunction(): BuildFunction {
return new BuildFunction({
Expand Down Expand Up @@ -49,12 +48,6 @@ export function createUploadToAscBuildFunction(): BuildFunction {
required: true,
allowedValueTypeName: BuildStepInputValueTypeName.STRING,
}),
BuildStepInput.createProvider({
id: 'wait_for_processing',
required: false,
defaultValue: false,
allowedValueTypeName: BuildStepInputValueTypeName.BOOLEAN,
}),
],
outputProviders: [
BuildStepOutput.createProvider({
Expand All @@ -72,7 +65,6 @@ export function createUploadToAscBuildFunction(): BuildFunction {
const appleAppIdentifier = z.string().parse(inputs.apple_app_identifier.value);
const bundleVersion = z.string().parse(inputs.bundle_version.value);
const bundleShortVersion = z.string().parse(inputs.bundle_short_version.value);
const waitForProcessing = Boolean(inputs.wait_for_processing.value);

const ipaPath = path.resolve(stepsCtx.workingDirectory, ipaPathInput);
if (!(await fs.pathExists(ipaPath))) {
Expand Down Expand Up @@ -202,21 +194,6 @@ export function createUploadToAscBuildFunction(): BuildFunction {
}

stepsCtx.logger.info(`See your build in App Store Connect: ${buildUploadUrl}`);

if (!waitForProcessing) {
stepsCtx.logger.info('Skipping waiting for processing.');
return;
}

await waitForAscBuildProcessingAsync({
client,
buildUploadId,
logger: stepsCtx.logger,
ipaBundleIdentifier: ipaInfoResult.ok ? ipaInfoResult.value.bundleIdentifier : undefined,
appleAppIdentifier: undefined,
ascAppBundleIdentifier,
bundleShortVersion,
});
},
});
}
Expand Down
Loading
Loading