Skip to content

fix(core): clear errors for bad --data-dir, config and number flags; wrap tables in narrow terminals (+Claude) - #302

Merged
SakshiKoli-CS merged 2 commits into
v2-devfrom
CL-8896
Nov 20, 2026
Merged

SakshiKoli-CS merged 2 commits into
v2-devfrom
CL-8896

Conversation

@SakshiKoli-CS

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

Copy link
Copy Markdown
Contributor

What

Fixes three of the cross-cutting defects found in section 10 of the Launch CLI V2 manual QA sheet (CL-8896).

10.2: --data-dir and .cs-launch.json

  • A --data-dir that does not exist now fails with No folder found at '…' (exit 2) when the CLI needs the config file. It used to fail with a misleading "Missing --org". When the flags already supply everything, the command still runs without the folder (for example, deployments:create --last-upload).
  • A .cs-launch.json that exists but is not valid JSON, or is not a project config, is now refused with an error naming the file. It used to be silently ignored.
  • The Using … from .cs-launch.json notice now goes to stderr, so url=$(csdx launch:site:open …) captures only the URL.
  • -c is not added back. It was removed on purpose in 144a862, so the QA sheet needs updating.

10.6: Invalid flag values

  • --limit and --skip are now whole-number flags with their own message, for example: Invalid --limit value "abc". Provide a whole number from 1 to 1000. They no longer print oclif's raw Parsing --limit / Expected an integer… text.
  • functions:serve keeps V1's exit 1 for a bad --port. AGENTS.md records that as the product owner's decision (bf9a139), so 10.6's functions:serve item is by design.

10.9: Narrow terminals

  • renderTable now shrinks the widest column first. No column goes below its minWidth: UID_WIDTH for UID columns and the value column of detail tables, and 10 characters otherwise. Cell text wraps instead of being cut with …, so UIDs are never truncated.
  • When the columns cannot fit even at those minimums, each record prints as a stacked LABEL value list, and long values wrap under themselves.
  • The flexible-column argument is removed from renderTable and its callers.
  • A detail table (env:get, deployments:get) never shrinks its field-name column. If it can't fit, it prints plain <field> <value> lines instead.
  • Piped output (no known width) is unchanged.

Guards (both listed in AGENTS.md):

  • test/guards/whole-number-flags.test.ts fails if any Flags.integer appears in src.
  • test/guards/narrow-terminal.test.ts draws the real env:list, env:get, deployments:list, deployments:get, projects:list and projects:get tables at 30 to 100 columns. It checks that no line is wider than the terminal, that nothing is cut with …, that every UID appears whole, and that detail tables print every field label whole.

Out of scope

Tests

  • Every test suite passes: 199 of 199. One full coverage run stalled after 189 suites with no failures, and the remaining 10 passed when run on their own.
  • The changed files are at 100% coverage.
  • npm run lint is clean.
  • Talisman and TruffleHog are clean. Test UIDs are generated with randomBytes, and the .talismanrc checksums are refreshed.
  • Regression tests cover each fix end to end through runCommand: missing --data-dir, broken config file, the stderr notice, and --limit abc.

#claude_code#
🤖 Generated with Claude Code

@SakshiKoli-CS
SakshiKoli-CS requested review from a team as code owners November 20, 2026 08:21
@snyk-io

snyk-io Bot commented Nov 20, 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.

@SakshiKoli-CS SakshiKoli-CS changed the title CL-8896 | Fix section-10 QA findings: config errors, number flags and narrow tables fix(core): clear errors for bad --data-dir, config and number flags; wrap tables in narrow terminals (+Claude) Nov 20, 2026
@github-actions

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 0 2 25 ✅ Passed
🟡 Medium Severity 0 1 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: 2
  • Medium without fixes: 1
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

…wrap tables in narrow terminals (+Claude)

CL-8896. Fixes three of the cross-cutting defects found in section 10 of the
Launch CLI V2 manual QA sheet.

--data-dir and .cs-launch.json (10.2)
- A --data-dir that does not exist now fails with "No folder found at ..."
  (exit 2) when the CLI needs the config file, instead of a misleading
  "Missing --org". Commands whose flags already supply everything (for
  example deployments:create --last-upload) still run without the folder.
- A .cs-launch.json that exists but is not valid JSON or not a project
  config is refused, naming the file, instead of being silently ignored.
- The "Using ... from .cs-launch.json" notice goes to stderr, so
  url=$(csdx launch:site:open ...) captures only the URL.
- -c is not added back: it was removed on purpose in 144a862.

Invalid flag values (10.6)
- --limit and --skip are whole-number flags whose parse throws a
  FlagValueError, so --limit abc prints one sentence naming the flag and
  its range instead of oclif's "Parsing --limit / Expected an integer".
- functions:serve exits 2, not 1, for a bad --port or --data-dir, like every
  other bad input.

Narrow terminals (10.9)
- renderTable shrinks the widest column first, never below a column's
  minWidth (UID_WIDTH for UID and detail-value columns) or ten
  characters, and wraps cell text instead of cutting it with an ellipsis.
- When the columns cannot fit, each record prints as a stacked
  "LABEL  value" list, wrapping long values under themselves.
- The flexible-column argument is gone from renderTable and its callers.

Guards: test/guards/whole-number-flags.test.ts (no Flags.integer in src)
and test/guards/narrow-terminal.test.ts (real tables at 60/80/100
columns fit, no ellipsis, every UID whole), both listed in AGENTS.md.
.talismanrc checksums refreshed for the changed files.

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

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

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 0 2 25 ✅ Passed
🟡 Medium Severity 0 1 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: 2
  • Medium without fixes: 1
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

Comment thread src/core/render.ts Resolved
Comment thread src/core/project-config.ts Resolved
Comment thread src/core/launch-command.ts Resolved
Comment thread src/core/catalog.ts Resolved
Comment thread src/core/render.ts Resolved
Comment thread src/core/render.ts Resolved

@tejas-contentstack tejas-contentstack left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not approved: a high-effort review found 8 issues (1 important, 6 nits, 1 pre-existing), each left as an inline comment. The important one: on narrow terminals, env:get and deployments:get detail tables break labels mid-word at about 45 to 50 columns, and below that they switch to a hard-to-read stacked layout. Checks are green and the PR is not a draft; the findings alone block approval.

— 🤖 Claude review (Opus 5.5, high effort)


Generated by Claude Code

…nfig advice (+Claude)

CL-8896. Round 1 of PR #302 review.

Critical:
- src/core/render.ts: env:get and deployments:get broke field labels
  mid-word near 45 columns and, narrower, printed each detail row as a
  FIELD/VALUE record; a label column now never shrinks and a detail table
  that cannot fit prints plain "<field>  <value>" lines.
- src/commands/launch/functions/serve.ts: restored exit 1 for a bad
  --port or --data-dir. AGENTS.md records exit 1 as V1 behaviour kept on the
  product owner's instruction (bf9a139), so the change to 2 is reverted.

Also fixed:
- src/core/render.ts: a stacked value that would not fit beside its label
  goes on its own indented line, so stacked output no longer outgrows the
  terminal; a wrapped line no longer starts with a space.
- src/core/catalog.ts: --limit/--skip reject digit strings that are not
  safe integers, so a huge --skip no longer reaches the API as Infinity.
- src/core/project-config.ts: a broken config file says "pass the missing
  flags" instead of naming --project, which org-only commands lack.
- AGENTS.md: config notice documented as stderr; narrow-terminal guard row
  updated (30-100 columns, label columns, 26-column floor).

Not changed: 2 disputed with reasoning (see the PR summary comment).

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

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

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 0 2 25 ✅ Passed
🟡 Medium Severity 0 1 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: 2
  • Medium without fixes: 1
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

@SakshiKoli-CS

Copy link
Copy Markdown
Contributor Author

/ship 2b summary (round 1, 863786a)

Fixed: 6 comments, 1 important and 5 nits.

  • Important: env:get and deployments:get now keep field labels whole at any width. Below the box width they print plain <field> <value> lines.
  • Stacked output no longer runs past the terminal; a value that doesn't fit beside its label goes on its own indented line (floor: 26 columns).
  • Wrapped lines no longer start with a space.
  • --skip/--limit refuse values that aren't safe integers.
  • The broken-config message says "pass the missing flags".
  • functions:serve is back to exit 1, as AGENTS.md requires (bf9a139).
  • AGENTS.md updated to match.

Not changed (reasoned replies posted, threads left open):

  • Colouring the stderr notice by stdout: that's the repo-wide convention (failure.ts:34, test/guards/tty-streams.test.ts).
  • CJK/emoji display width: pre-existing, needs its own change. Follow-up ticket to come.

General comments: 3 Snyk/security scan reports, all passed, nothing asked.

Left for a human: none. Next: waiting for a human approval.

@SakshiKoli-CS
SakshiKoli-CS merged commit 6e07cfc into v2-dev Nov 20, 2026
7 checks passed
@SakshiKoli-CS
SakshiKoli-CS deleted the CL-8896 branch November 20, 2026 10:44
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.

4 participants