fixed the auth error in clone command#198
Open
cs-raj wants to merge 1 commit into
Open
Conversation
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
Consider reviewing these vulnerabilities when fixes become available. |
harshitha-cstk
approved these changes
Jun 1, 2026
naman-contentstack
approved these changes
Jun 1, 2026
netrajpatel
approved these changes
Jun 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Running
cm:stacks:clonewhile unauthenticated produced no output at all whenshowConsoleLogswasfalse(the default afterconfig:set:log --level info).Expected:
ERROR: Please login to execute this command, csdx auth:loginActual: Silent exit — user has no idea why the command stopped
Root Cause
Two compounding issues in
run():1.
progressSupportedModulewas set unconditionally at the top ofrun()cloneis inPROGRESS_SUPPORTED_MODULES, so setting this put the logger into "progress-bar mode" whereshowConsoleLogsdefaults tofalse. The Console transport was never added to the winston logger, solog.error(...)only wrote to the log file.2. Stale value persisted across CLI invocations
configHandler.setwrites to an encrypted config file on disk. Once set by any run, the value persisted for all subsequent runs — meaning even commands that never calledhandleClone()(i.e. auth failures) still started withprogressSupportedModule: 'clone'from disk, silencing their error output.Fix
src/commands/cm/stacks/clone.tsprogressSupportedModuletonullat the very start ofrun()— beforeparse()or any log call — so a fresh logger instance is created without progress-bar mode active.'clone'as the first line ofhandleClone()— so progress-bar mode only activates after authentication passes and the actual clone operation begins.Changes
src/commands/cm/stacks/clone.tsprogressSupportedModuleat start ofrun(); move set intohandleClone()test/commands/cm/stacks/clone.test.tsprogressSupportedModuleassertionsTest Updates
should exit when not authenticated and no management token aliasesconfigHandler.getto forceisAuthenticated() = false, stubscleanUp, assertslog.errorfires with correct message andprogressSupportedModuleis never set to'clone'should exit when management token aliases + branches but not authenticatedshould handle run with authenticated user and all optional flagsprogressSupportedModuleIS set to'clone'insidehandleCloneafter auth passesBehaviour
showConsoleLogs: falseERROR: Please login to execute this commandshowConsoleLogs: trueshowConsoleLogs: false