Skip to content

Commit

Permalink
[ENG-11090][eas-cli] prompt users if they want to continue if provisi…
Browse files Browse the repository at this point in the history
…oning the devices fails (#2181)

* [eas-cli] prompt users if they want to continue if provisioning the devices fails

* update CHANGELOG.md

* fix tests

* fix imports
  • Loading branch information
szdziedzic committed Jan 16, 2024
1 parent 189d163 commit 4c07b89
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This is the log of notable changes to EAS CLI and related packages.
### 🧹 Chores

- Remove "bare"-specific **eas.json** template. ([#2179](https://github.com/expo/eas-cli/pull/2179) by [@sjchmiela](https://github.com/sjchmiela))
- Prompt users if they want to continue if EAS CLI fails to provision the devices. ([#2181](https://github.com/expo/eas-cli/pull/2181) by [@szdziedzic](https://github.com/szdziedzic))

## [6.0.0](https://github.com/expo/eas-cli/releases/tag/v6.0.0) - 2024-01-12

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ProfileType } from '@expo/apple-utils';
import { Errors } from '@oclif/core';
import assert from 'assert';
import chalk from 'chalk';
import nullthrows from 'nullthrows';
Expand All @@ -15,7 +16,12 @@ import {
} from '../../../graphql/generated';
import Log from '../../../log';
import { getApplePlatformFromTarget } from '../../../project/ios/target';
import { confirmAsync, pressAnyKeyToContinueAsync, promptAsync } from '../../../prompts';
import {
confirmAsync,
pressAnyKeyToContinueAsync,
promptAsync,
selectAsync,
} from '../../../prompts';
import differenceBy from '../../../utils/expodash/differenceBy';
import { CredentialsContext } from '../../context';
import { MissingCredentialsNonInteractiveError } from '../../errors';
Expand Down Expand Up @@ -181,6 +187,22 @@ export class SetUpAdhocProvisioningProfile {
Log.log(
'Most commonly devices fail to to be provisioned while they are still being processed by Apple, which can take up to 24-72 hours. Check your Apple Developer Portal page at https://developer.apple.com/account/resources/devices/list, the devices in "Processing" status cannot be provisioned yet'
);
const shouldContinue = await selectAsync(
'Do you want to continue without provisioning these devices?',
[
{
title: 'Yes',
value: true,
},
{
title: 'No (EAS CLI will exit)',
value: false,
},
]
);
if (!shouldContinue) {
Errors.exit(1);
}
}

// 7. Create (or update) app build credentials
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
} from '../../../../graphql/generated';
import Log from '../../../../log';
import { getApplePlatformFromTarget } from '../../../../project/ios/target';
import { selectAsync } from '../../../../prompts';
import { Actor } from '../../../../user/User';
import { Client } from '../../../../vcs/vcs';
import { CredentialsContext, CredentialsContextProjectInfo } from '../../../context';
Expand All @@ -34,6 +35,7 @@ jest.mock('../DeviceUtils', () => {
};
});
jest.mock('../../../../project/ios/target');
jest.mock('../../../../prompts');

describe(doUDIDsMatch, () => {
it('return false if UDIDs do not match', () => {
Expand Down Expand Up @@ -67,6 +69,7 @@ describe('runWithDistributionCertificateAsync', () => {
developerPortalIdentifier: 'provisioningProfileId',
},
} as IosAppBuildCredentialsFragment);
jest.mocked(selectAsync).mockImplementation(async () => true);
ctx.ios.updateProvisioningProfileAsync = jest.fn().mockResolvedValue({
appleTeam: {},
appleDevices: [{ identifier: 'id1' }],
Expand Down

0 comments on commit 4c07b89

Please sign in to comment.