Skip to content

Make CLI error output concise and consistent - #133

Closed
anmarchenko wants to merge 1 commit into
mainfrom
anmarchenko/concise-cli-errors
Closed

anmarchenko wants to merge 1 commit into
mainfrom
anmarchenko/concise-cli-errors

Conversation

@anmarchenko

Copy link
Copy Markdown
Member

What

Print CLI failures once on stderr without automatically dumping usage. For example, ddtest plan --unknown now prints the error and a ddtest plan --help hint instead of 27 lines ending with a duplicate FAILURE log.

Planner and runner handlers return errors through Cobra, preserving error codes and telemetry flushing. Exit status remains 1 on failure; explicit help and version output are unchanged.

Why

Repeated errors and unrelated flag listings obscure the action users need to take, particularly in CI logs. This follows the CLI guidelines for useful, low-noise errors.

E2E testing

  • Passed GOTOOLCHAIN=go1.26.5 make test and GOTOOLCHAIN=go1.26.5 make lint.
  • Built the CLI and verified plan --unknown, run --min-parallelism=nope, and an unknown subcommand print one error plus a help hint, write nothing to stdout, and exit 1. Running plan with Git absent from PATH prints one prerequisite error without usage or a duplicate log.
  • Verified plan --help and --version still succeed. Regression tests cover these process-level behaviors, missing flag values, planner/runner errors, and telemetry flushing.

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Tests  Code Coverage

✅ All CI checks and tests passed.

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 86.59% (+0.03%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 5ca71d1 | Docs | View more details | Give us feedback!

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.

1 participant