From d07ca19bedc8151fd9a28de7b408189ccc97cb0a Mon Sep 17 00:00:00 2001 From: Jeromy Cannon Date: Tue, 27 Aug 2024 14:28:22 +0100 Subject: [PATCH 1/4] reset disabled prompts before using them Signed-off-by: Jeromy Cannon --- src/commands/flags.mjs | 11 +++++++++++ src/commands/prompts.mjs | 2 ++ 2 files changed, 13 insertions(+) diff --git a/src/commands/flags.mjs b/src/commands/flags.mjs index 847eb9150..d445afaea 100644 --- a/src/commands/flags.mjs +++ b/src/commands/flags.mjs @@ -725,6 +725,17 @@ export const allFlags = [ valuesFile ] +/** + * Resets the definition.disablePrompt for all flags + */ +export function resetDisabledPrompts () { + allFlags.forEach(f => { + if (f.definition.disablePrompt) { + delete f.definition.disablePrompt + } + }) +} + export const allFlagsMap = new Map(allFlags.map(f => [f.name, f])) export const nodeConfigFileFlags = new Map([ diff --git a/src/commands/prompts.mjs b/src/commands/prompts.mjs index 0e5b2f9f9..6a5b32ccc 100644 --- a/src/commands/prompts.mjs +++ b/src/commands/prompts.mjs @@ -20,6 +20,7 @@ import { FullstackTestingError, IllegalArgumentError } from '../core/errors.mjs' import { ConfigManager, constants } from '../core/index.mjs' import * as flags from './flags.mjs' import * as helpers from '../core/helpers.mjs' +import { resetDisabledPrompts } from './flags.mjs' async function prompt (type, task, input, defaultValue, promptMessage, emptyCheckMessage, flagName) { try { @@ -531,6 +532,7 @@ export async function execute (task, configManager, flagList = []) { * @param {CommandFlag[]} flags list of flags to disable prompts for */ export function disablePrompts (flags) { + resetDisabledPrompts() for (const flag of flags) { if (flag.definition) { flag.definition.disablePrompt = true From 8e464fff126acd58175b7546daaa30adf3b53efc Mon Sep 17 00:00:00 2001 From: Jeromy Cannon Date: Tue, 27 Aug 2024 14:28:40 +0100 Subject: [PATCH 2/4] don't prompt for local build path Signed-off-by: Jeromy Cannon --- src/commands/node.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/commands/node.mjs b/src/commands/node.mjs index 166a48df8..32cd94507 100644 --- a/src/commands/node.mjs +++ b/src/commands/node.mjs @@ -1452,6 +1452,7 @@ export class NodeCommand extends BaseCommand { flags.endpointType, flags.force, flags.fstChartVersion, + flags.localBuildPath, flags.gossipEndpoints, flags.grpcEndpoints ]) From 5e04edcf74977336855a14b8a2ad26b449865c37 Mon Sep 17 00:00:00 2001 From: Jeromy Cannon Date: Tue, 27 Aug 2024 14:37:21 +0100 Subject: [PATCH 3/4] don't prompt for local build path Signed-off-by: Jeromy Cannon --- src/commands/node.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/commands/node.mjs b/src/commands/node.mjs index 32cd94507..95694624c 100644 --- a/src/commands/node.mjs +++ b/src/commands/node.mjs @@ -1194,7 +1194,8 @@ export class NodeCommand extends BaseCommand { // disable the prompts that we don't want to prompt the user for prompts.disablePrompts([ flags.devMode, - flags.force + flags.force, + flags.localBuildPath ]) await prompts.execute(task, self.configManager, NodeCommand.REFRESH_FLAGS_LIST) From 11046c9e10aa14cb6670e8815e047024ef41393b Mon Sep 17 00:00:00 2001 From: Jeromy Cannon Date: Tue, 27 Aug 2024 14:55:57 +0100 Subject: [PATCH 4/4] increase test timeout Signed-off-by: Jeromy Cannon --- test/e2e/commands/node-add.test.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/commands/node-add.test.mjs b/test/e2e/commands/node-add.test.mjs index 2765de628..3ba5904f5 100644 --- a/test/e2e/commands/node-add.test.mjs +++ b/test/e2e/commands/node-add.test.mjs @@ -75,7 +75,7 @@ describe('Node add', () => { flags.devMode.constName ]) await nodeCmd.accountManager.close() - }, 600000) + }, 800000) balanceQueryShouldSucceed(nodeCmd.accountManager, nodeCmd, namespace)