Skip to content

feat(deps): run Launch CLI V2 on csdx 2.x with cli-utilities 2 and cli-command 2 - #279

Merged
Harshi-Shah-CS merged 2 commits into
v2-devfrom
CL-8328
Nov 3, 2026
Merged

Harshi-Shah-CS merged 2 commits into
v2-devfrom
CL-8328

Conversation

@SakshiKoli-CS

@SakshiKoli-CS SakshiKoli-CS commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

What

Upgrades Launch CLI V2 to the csdx 2.x libraries, so it runs on @contentstack/cli 2.x, the current npm latest.

On csdx 2.x every launch:* command crashed at startup with error: inquirer.registerPrompt is not a function. csdx 2.x's bin/run.js makes plugins resolve @contentstack/cli-utilities to csdx's own 2.x copy (inquirer 12), whatever the plugin pins. The new Launch-cli-v2-dev11-integration-sanity GoCD pipeline found it on its first run. This replaces the inquirer 8/12 compatibility shim in #278 (closed).

Dependencies

  • @contentstack/cli-utilities ^1.18.5 → ^2.0.2
  • @contentstack/cli-command ^1.8.7 → ^2.0.2, which now shares that cli-utilities instead of a nested 1.x copy
  • Every new lockfile entry resolves from registry.npmjs.org.

Prompts (src/core/search-list.ts)

  • The custom search-list is registered on inquirer 12's registry (inquirer.default, via promptLibrary()).
  • The list/checkbox paging subclass is removed. inquirer 12 has no lib/prompts to extend, and it pages list and checkbox itself from the pageSize and loop: false options askOption/askChoices already pass. The scroll window may look slightly different from the old custom scroller.

Exit codes (src/core/failure.ts, src/secrets/secret.rules.ts)

  • Found by running the e2e suite on csdx 2.x. cli-command 2's Command extends cli-utilities' Command, so on csdx 2.x its errors come from csdx's @oclif/core, and instanceof against Launch CLI's copy failed. A declined confirm exited 1 with error: EEXIT: 3 instead of exit 3.
  • isOclifError() now matches oclif errors by shape. reportFailure() and the secrets:set argv redaction (asSafeArgvFailure) use it.

Tests

  • npm test: 193 suites, 3819 tests pass. npm run lint and tsc are clean.
  • Directly after the bump, 467 tests failed: about 406 were the startup crash and 10 read inquirer 8 internals. The commits fix both.
  • New tests cover oclif errors raised by another copy of oclif (exit request, exit code, argv-parse redaction) and inquirer 12's registry shape.
  • End to end on real csdx 2.0.1 against dev11, with this build linked, using the CL-7176 V2 e2e suite:
    • Full suite: 19 of 21 passed. One failure was the exit-3 bug above (fixed in the second commit). The other was a deployments:list timeout while dev11's API was slow.
    • Rerun of those two specs on the final build: 9 of 9 passed. That includes the rollback (y/N) prompt answered n exiting 3, and the custom search picker.
    • Every test project was cleaned up.

Note

Launch CLI V2 now targets csdx 2.x. It hasn't been run on csdx 1.x after this change. V2 is unreleased (npm latest for @contentstack/cli-launch is 1.11.4).

Jira: https://contentstack.atlassian.net/browse/CL-8328

#claude_code#
🤖 Generated with Claude Code

SakshiKoli-CS and others added 2 commits November 3, 2026 14:41
csdx 2.x makes every plugin resolve @contentstack/cli-utilities to csdx's own
2.x copy, which ships inquirer 12, so Launch CLI V2 crashed on startup with
"inquirer.registerPrompt is not a function". Rather than shim inquirer 8 and
12, move to the 2.x packages csdx now ships:

- @contentstack/cli-utilities ^1.18.5 -> ^2.0.2
- @contentstack/cli-command ^1.8.7 -> ^2.0.2, which now shares that
  cli-utilities instead of carrying its own 1.x copy

registerSearchList() registers the custom search-list on inquirer 12's
registry (its default export, via promptLibrary()). The list/checkbox
paging subclass is gone: inquirer 12 has no lib/prompts to extend, and it
pages list and checkbox itself from the pageSize and loop: false options
askOption and askChoices already pass.

Tests read the registry through promptLibrary(). The prompt-types guard
puts the original registry object back, because inquirer 12's
restoreDefaultPrompts() swaps in a new one rather than resetting it.

Refs CL-8328

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
… own copy

cli-command 2's Command extends cli-utilities' Command, so on csdx 2.x the
errors it throws (this.exit, parse failures) come from csdx's @oclif/core,
not Launch CLI's. reportFailure() matched them with instanceof, so a
declined confirm's exit 3 came out as "error: EEXIT: 3" with exit 1, and an
oclif error's own exit code was lost.

isOclifError() recognises an oclif error by its shape (an oclif object, and
code EEXIT for an exit request) whichever copy raised it. reportFailure() and
asSafeArgvFailure() use it, so the secrets:set argv redaction also still
applies to a parse failure raised by csdx's copy.

Refs CL-8328

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@SakshiKoli-CS
SakshiKoli-CS requested review from a team as code owners November 3, 2026 09:29
@snyk-io

snyk-io Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 6 9 25 ✅ Passed
🟡 Medium Severity 5 7 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ 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:

  • Critical without fixes: 0
  • High without fixes: 9
  • Medium without fixes: 7
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

@Harshi-Shah-CS
Harshi-Shah-CS merged commit e025edc into v2-dev Nov 3, 2026
7 checks passed
@Harshi-Shah-CS
Harshi-Shah-CS deleted the CL-8328 branch November 3, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants