Skip to content

feat: CLI exclusions, write confirmations, and job alias removal - #13

Merged
ClayMav merged 6 commits into
mainfrom
feat/cli-confirmation-exclusions
Apr 6, 2026
Merged

feat: CLI exclusions, write confirmations, and job alias removal#13
ClayMav merged 6 commits into
mainfrom
feat/cli-confirmation-exclusions

Conversation

@ClayMav

@ClayMav ClayMav commented Apr 3, 2026

Copy link
Copy Markdown
Member

Summary

  • x-exclude-from-cli support: The spec parser now reads the x-exclude-from-cli: true OpenAPI extension and omits those operations from the auto-generated api command tree. Superuser and legacy/internal endpoints set this flag in studio-backend and will no longer appear in the CLI.
  • Write confirmation prompt: Any auto-generated command for a POST, PUT, DELETE, or PATCH request now prompts Proceed? [y/N] before executing. Use --yes / -y to skip (for CI or scripts).
  • Remove job alias subcommands: job-runs running, job-runs failed, and job-runs completed are removed. Use job-runs list --status RUNNING|FAILED|COMPLETED instead — the list command already supports all status filters.
  • CODEOWNERS: Added .github/CODEOWNERS assigning @wherobots/wbc-crew to all files.

Test plan

  • wbc api --tree no longer shows superuser/legacy endpoints
  • Write commands (POST/PUT/DELETE) prompt for confirmation; --yes skips it
  • wbc job-runs list --status RUNNING works; wbc job-runs running is gone
  • wbc --dry-run on a write command does not prompt

ClayMav added 3 commits April 2, 2026 17:22
- Parse x-exclude-from-cli OpenAPI extension; skip excluded ops in
  auto-generated command tree (superuser and legacy endpoints stay
  accessible via API but are hidden from CLI)
- Add --yes / -y persistent flag to bypass write confirmation prompt
- Prompt for confirmation on POST/PUT/DELETE/PATCH unless --yes or
  --dry-run (CI-friendly: use --yes in scripts)
- Add Excluded bool field to Operation struct
- Remove job-runs running/failed/completed alias subcommands; use
  job-runs list --status RUNNING|FAILED|COMPLETED instead
- Add CODEOWNERS assigning @wherobots/wbc-crew to all files
- TestParseExcludeFromCLIExtension: asserts parser sets Excluded=true
  on operations with x-exclude-from-cli: true extension
- TestExcludedOperationsAbsentFromTree: asserts excluded operations
  are completely absent from --tree output
- Parse operation description field from OpenAPI spec
- --tree: leaf verb nodes now show their summary aligned in a column
  (group nodes like 'catalogs' or 'storage' show name only)
- --help: OpenAPI description (longer text) is prepended to the Long
  help body before the parameter listing
- Tests: add TestTreeShowsSummaryOnLeafNodes, TestDescriptionAppearsInHelp;
  update TestRootTreeOutput for new padded leaf format
@ClayMav
ClayMav marked this pull request as ready for review April 4, 2026 00:37
@ClayMav
ClayMav requested review from a team and kcheng486 and removed request for a team April 4, 2026 00:37
ClayMav added 3 commits April 3, 2026 19:22
Cache files are now named spec-<fnv32hex>.json / spec-<fnv32hex>.meta.json
where the hex suffix is an FNV-1a hash of the OpenAPI URL. Switching
WHEROBOTS_API_URL no longer serves a stale spec from a different endpoint,
and switching back to a previously-used URL hits its own warm cache.
operationIDVerb now extracts only the action prefix from the operation ID
("get", "list", "cancel", "destroy", etc.) rather than normalising the
entire thing. This prevents double-resource names in the tree:

  Before: api flags get-flags          (path "flags" + verb "get-flags")
  After:  api flags get                (path "flags" + verb "get")

Path hierarchy from the URL already provides resource context; repeating
it in the verb name was noisy and confusing.

@sfishel18 sfishel18 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.

lgtm, though some tests for the confirmation / --yes flag behavior would be nice

@ClayMav
ClayMav merged commit e2a4b76 into main Apr 6, 2026
1 check passed
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