From 9b62d14e691eedafcefc0cc414c82f3f7d13636d Mon Sep 17 00:00:00 2001 From: Piotr Grzesik Date: Thu, 7 Apr 2022 14:51:22 +0200 Subject: [PATCH] fix(CLI): Do not attempt to resolve full config for `login` --- scripts/serverless.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/serverless.js b/scripts/serverless.js index fa66759b4..88cef4365 100755 --- a/scripts/serverless.js +++ b/scripts/serverless.js @@ -235,6 +235,12 @@ processSpanPromise = (async () => { // IIFE for maintenance convenience await (async () => { + // We do not need to attempt resolution of further variables for login command as the only variable from configuration that we + // potentially rely on is `console` + // TODO: Remove when dashboard/console triage won't be needed - when that happens + // login command should once again be service independent + if (command === 'login') return; + processLog.debug('resolve variables meta'); const resolveVariablesMeta = require('../lib/configuration/variables/resolve-meta'); @@ -474,6 +480,8 @@ processSpanPromise = (async () => { if (!ensureResolvedProperty('frameworkVersion')) return; if (!ensureResolvedProperty('app')) return; if (!ensureResolvedProperty('org')) return; + if (!ensureResolvedProperty('dashboard')) return; + if (!ensureResolvedProperty('console')) return; if (!ensureResolvedProperty('service')) return; if (isDashboardEnabled({ configuration, options })) { // Dashboard requires AWS region to be resolved upfront @@ -574,6 +582,13 @@ processSpanPromise = (async () => { // IIFE for maintanance convenience await (async () => { if (!configuration) return; + + // We do not need to attempt resolution of further variables for login command as the only variable from configuration that we + // potentially rely on is `console` + // TODO: Remove when dashboard/console triage won't be needed - when that happens + // login command should once again be service independent + if (command === 'login') return; + let hasFinalCommandSchema = false; if (configuration.plugins) { // After plugins are loaded, re-resolve CLI command and options schema as plugin