@forge/cli
12.18.1-next.0-experimental-5b726e612.19.0-next.5
out/command-line/controller/deploy-controller.js~
out/command-line/controller/deploy-controller.jsModified+39−13
Index: package/out/command-line/controller/deploy-controller.js
===================================================================
--- package/out/command-line/controller/deploy-controller.js
+++ package/out/command-line/controller/deploy-controller.js
@@ -134,26 +134,52 @@
}
}
}
async verifyPostDeployment(environmentKey, environmentType, majorVersion) {
- const needsVersionUpdate = await this.installationsService.hasOutdatedProductInstallation(environmentKey);
- if (needsVersionUpdate) {
- this.deployView.displayOutdatedInstallationsMessage();
+ const isMajorBump = (version) => {
+ return /^\d+\.0\.0$/.test(version ?? '');
+ };
+ let checksFailed = false;
+ try {
+ const { id: appId } = await this.appConfigProvider();
+ const permissions = await this.installationsService.getAppEnvironmentPermissions(appId, environmentKey);
+ if (permissions &&
+ permissions.hasDeployments &&
+ isMajorBump(permissions.version) &&
+ (permissions.addedScopes.length > 0 || permissions.addedEgressAddresses.length > 0)) {
+ this.deployView.displayOutdatedInstallationsMessage();
+ }
}
- const roaEligibility = await this.roaService.getEligibilityStatus(environmentKey, majorVersion);
- if (!roaEligibility.isEligible) {
- this.deployView.displayRoaEligibilityFailureMessage(roaEligibility.appVersion, environmentKey, environmentType);
+ catch (e) {
+ checksFailed = true;
}
- else {
- this.deployView.displayRoaEligibilitySuccessMessage(roaEligibility.appVersion, environmentKey, environmentType);
+ try {
+ const roaEligibility = await this.roaService.getEligibilityStatus(environmentKey, majorVersion);
+ if (!roaEligibility.isEligible) {
+ this.deployView.displayRoaEligibilityFailureMessage(roaEligibility.appVersion, environmentKey, environmentType);
+ }
+ else {
+ this.deployView.displayRoaEligibilitySuccessMessage(roaEligibility.appVersion, environmentKey, environmentType);
+ }
}
- const manifest = await this.configFile.readConfig();
- if (manifest?.app?.storage?.entities) {
- if (await this.customEntitiesService.isReindexingInProgress(environmentKey)) {
- this.deployView.displaySuccessfulDeploymentWhileReindexing();
+ catch (e) {
+ checksFailed = true;
+ }
+ try {
+ const manifest = await this.configFile.readConfig();
+ if (manifest?.app?.storage?.entities) {
+ if (await this.customEntitiesService.isReindexingInProgress(environmentKey)) {
+ this.deployView.displaySuccessfulDeploymentWhileReindexing();
+ }
+ this.deployView.displayIndexingCommand(environmentKey);
}
- this.deployView.displayIndexingCommand(environmentKey);
}
+ catch (e) {
+ checksFailed = true;
+ }
+ if (checksFailed) {
+ this.deployView.displayPostDeploymentChecksErrorMessage();
+ }
}
async confirmAndCreateEnvironment(environment, nonInteractive) {
if (!nonInteractive) {
this.deployView.displayEnvironmentCreationWarning(environment);