Skip to content

fix(jobs): explain missing positional arguments (WBC-266) - #36

Merged
ClayMav merged 1 commit into
mainfrom
clay/wbc-266-cli-argument-errors
Sep 9, 2026
Merged

ClayMav merged 1 commit into
mainfrom
clay/wbc-266-cli-argument-errors

Conversation

@ClayMav

@ClayMav ClayMav commented Sep 8, 2026

Copy link
Copy Markdown
Member

Missing job-run arguments only reported a count, leaving users to guess what to supply. Create, logs, and metrics now name the required argument and show usage, an example, and a help command. Blank and extra arguments receive the same guidance.

Fixes WBC-266.

Verification

  • make fmt, make test, make build, and git diff --check passed.
  • Added command execution tests for missing, blank, and extra inputs across all three commands. Existing successful command tests pass.
  • Ran the built CLI against a local OpenAPI fixture: missing logs/create inputs and extra metrics inputs exited 1 with the expected guidance. job-runs logs run-123 --dry-run and job-runs logs --help exited 0. Only the local spec endpoint received a request.
  • Independent local agent reviewed commit 52045e4 with no findings and reran the argument-error and successful-creation tests; both passed.
  • GitHub Test and Build, semantic-title-check, and Salty Hambot review passed on the same commit. Salty reported no findings. No live Cloud requests were made.

Authored with GPT-6 in the Codex harness.

@ClayMav

ClayMav commented Sep 8, 2026

Copy link
Copy Markdown
Member Author

@salty-hambot review

@salty-hambot salty-hambot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Reviewed by Salty Hambot 🤖🧂 — rubric mode

Verdict: ✅ pass

Dimension Verdict Notes
correctness ✅ pass Arg validation refactor is sound; UseLine() correctly emits [flags], tests confirm behavior.
security ✅ pass No auth, injection, or secret-handling changes in the touched paths.
privacy ✅ pass No PII or data handling introduced; only CLI arg-validation error text.
reliability ✅ pass Validator handles missing, blank, and extra-arg cases deterministically.
scalability ✅ pass N/A — pure CLI argument parsing, no scaling surface.
observability ✅ pass Error messages are more actionable now (usage + example + help hint).
clarity/maintainability ✅ pass Consolidates three duplicated inline checks into one reusable helper — a net readability win.
test quality ✅ pass Table-driven TestJobsArgumentErrors covers all three commands x missing/blank/extra cases with usage-line assertions.

Clean, well-tested refactor that swaps ad-hoc arg checks for a shared validator with actionable usage hints. Reviewer B's 'missing [flags]' scare is a false alarm — Cobra's UseLine() adds [flags] automatically when the command has flags, which all three do. Ship it.

0 finding(s) posted · 1 filtered as false positives.
💰 Review cost: $2.6400 · 794.1k in / 6.1k out tokens · ⏱️ 1m49.1s
💬 To request a re-review, comment @salty-hambot review

@ClayMav
ClayMav marked this pull request as ready for review September 8, 2026 22:01
@ClayMav
ClayMav requested a review from a team as a code owner September 8, 2026 22:01
@ClayMav
ClayMav merged commit 2fb2696 into main Sep 9, 2026
3 checks passed
@ClayMav
ClayMav deleted the clay/wbc-266-cli-argument-errors branch September 9, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants