@forge/cli

13.2.0-next.6-experimental-a1600ff13.2.0-next.4-experimental-fda9df6
out/command-line/controller/deploy-controller.js
~out/command-line/controller/deploy-controller.jsModified
+15−6
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
@@ -103,17 +103,26 @@
             return { proceed, connectKeyChanged: proceed, connectKeyDeleted: false };
         }
         return { proceed: true, connectKeyChanged: false, connectKeyDeleted: false };
     }
-    async verifyPreDeployment(environment) {
+    async verifyPreDeployment(environment, approveRules) {
         this.deployView.displayLintRunning();
-        const { lintResults } = await this.lintService.run(environment, { fix: false }, this.deployView.getLogger());
+        const { lintResults } = await this.lintService.run(environment, { fix: false, approveRules }, this.deployView.getLogger());
         const problemCount = this.lintService.problemCount(lintResults);
-        if (problemCount.errors) {
+        if (problemCount.errors && problemCount.approvals) {
+            this.deployView.displayLintErrorsWithApprovals(lintResults);
+            const failures = this.lintService.failedScopes(lintResults);
+            throw new DeployLintFailureError(failures);
+        }
+        else if (problemCount.errors) {
             this.deployView.displayLintErrors(lintResults);
             const failures = this.lintService.failedScopes(lintResults);
             throw new DeployLintFailureError(failures);
         }
+        else if (problemCount.approvals) {
+            this.deployView.displayLintApprovals(lintResults.filter((r) => r.approvals.length));
+            throw new DeployLintFailureError([]);
+        }
         else if (problemCount.warnings) {
             this.deployView.displayLintWarnings(problemCount.warnings);
         }
         else {
@@ -202,18 +211,18 @@
             await this.confirmAndCreateEnvironment(environment, nonInteractive);
             return this.appEnvironmentClient.getAppEnvironmentDetails(id, environment);
         }
     }
-    async run({ environment, verify, nonInteractive, majorVersion, buildTag, skipRollout }) {
+    async run({ environment, verify, nonInteractive, majorVersion, buildTag, skipRollout, approveRules }) {
         const { id } = await this.appConfigProvider();
         const appDetails = await this.getAppEnvironmentDetails(id, environment, nonInteractive);
         appDetails.buildTag = buildTag;
         this.deployView.displayStart(environment, appDetails.environmentType, buildTag);
         await this.devSpaceService.displayEnforcementWarningsIfNeeded(this.deployView.getLogger(), id, 'deploy');
         let hasConnectKeyChanged = false;
         let hasConnectKeyDeleted = false;
         if (verify && !buildTag) {
-            await this.verifyPreDeployment(environment);
+            await this.verifyPreDeployment(environment, approveRules);
             const keys = await this.migrationKeysService.getMigrationKeysForAppEnvironment(environment);
             const { proceed, connectKeyChanged, connectKeyDeleted } = await this.validateConnectKeyChange(environment, keys);
             if (!proceed) {
                 return;
@@ -252,9 +261,9 @@
             modules: config.modules,
             i18nConfig: config.translations,
             buildTag,
             skipRollout
-        }));
+        }), approveRules);
         if (verify) {
             await this.verifyPostDeployment(environment, appDetails.environmentType, majorVersion);
         }
         try {