feat(cli): add catalog command defaults and groups - #66
TristanSpeakEasy wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 6 files
Shadow auto-approve: would not auto-approve because issues were found.
Fix all with cubic | Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Shadow auto-approve: would auto-approve. Adds optional per-command defaults and ordered groups to generated CLI enum catalogs, gated so existing output is unchanged; tests cover legacy, grouped, and malformed cases, and invalid groups fall back to Other.
Re-trigger cubic
|
Catalog normalization updated in dd77aea:
Added human and JSON assertions for these cases, including a long-label fixture that checks exact legacy spacing, and updated the documentation. Validation passed: primary CLI generation, compilation and staticcheck; focused catalog tests; template type-check; formatting and diff checks; and human-output smoke checks. The full test matrix is left to CI. Full repository lint was not repeated because the existing local permissions-file formatting failure is unchanged. |
There was a problem hiding this comment.
0 issues found across 4 files (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Shadow auto-approve: would auto-approve. Adds optional per-command defaults and ordered groups to generated CLI enum catalogs, with tests, docs, changeset, and a release-workflow version-check snapshot; existing output is preserved when the new options are unused.
Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 4 files (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Shadow auto-approve: would auto-approve. Adds optional per-command defaults and ordered groups to CLI enum catalogs while preserving legacy output when unused, fixes PHP constructor enum default namespace qualification with a regression test, and adds a release-tag version guard; all changes are additive or corrective with test coverage.
Re-trigger cubic
There was a problem hiding this comment.
- The PHP enum-default qualification fix (
php/includes/sanitization.ts,php/includes/templating.ts, the PHP test, and the second changeset) is an independent bug fix with its own changelog entry. It is correct as far as I can tell, sinceusageLocationalready exists onTemplateValueContext, but it should probably land in its own PR so the PHP changelog entry and any revert are not tied to a CLI feature. testSharedEnumConstructorDefaultdoes not callCommonHelpers::recordTest, unlike the other tests in that file.
| Description: string; | ||
| IsDefault: boolean; | ||
| DefaultFor: string[]; | ||
| Group: string; |
There was a problem hiding this comment.
I find the concept of "Group" confusing as it makes me feel a bit dumb understanding how CliCatalogValue and CliCatalog now map together.
Can we get a bit more documentation in the PR description with an example of how this might be used?
|
Propose this refinement in configuration:
|
ThomasRooney
left a comment
There was a problem hiding this comment.
Temporarily blocking this with proposals for improved interface to reach same functionality. Non-blocking though: happy for push-back / review dismissal if you disagree.
Why
Offline enum catalogs currently support only one global default and a flat list. Shared enums cannot describe which options are defaults for different commands or organise values into named sections.
What changed
defaultsmappings accepting a command name or an array of command names, with human labels and optionaldefault_formetadata.groups, first-seen deduplication, filtering of unknown values, and a trailingOthersection for unmatched enum values. Human and machine output use the same order.defaultsemantics, existing JSON fields, and exact legacy spacing. Dynamic widths apply only when non-empty new options are configured.Testing
go test -C testSDKs/sdk-cli-primary ./tests -run '^TestCatalog' -count=1 -v. The full runtime suite was not repeated for this test-only correction../scripts/test-target.sh cli reviewpassed with 547 tests, including two existing skips.Otherremainder.npm run format, all template TypeScript checks, both module tidy checks andgit diff --checkpassed.make lintfailed on an existing gofmt complaint in the unchangedtemplates/perms.go. The local-trimpathsetting also prevents permission generation; clearing it for the lint invocation allowed that stage to finish. No permissions-file changes are included.Public-safety check
.claude/skills/public-repo-communication/SKILL.md).git diff --check.Summary by cubic
Adds per-command defaults and ordered groups to offline enum catalogs in the generated CLI, so shared enums can mark which values are defaults for different commands and arrange options into named sections. Previously a catalog only had one global default and a flat list. Release workflow snapshots now also fail when a tag version does not match the generated CLI version, and PHP model constructors now qualify shared enum defaults with the model's namespace instead of the enum's.
defaultsmaps each enum value to a command name or array of command names; only the scalardefaultsets the machine-outputdefaultboolean. Renders as<value> (default: <command>, ...).groupsrenders titled sections in declared order, deduplicating by first occurrence, ignoring unknown values, and placing unmatched values in a trailingOthersection. Malformed group and command-default entries are skipped.default_forandgroupfields only when the corresponding options are configured; existing JSON fields are unchanged.defaultsorgroupskeep the legacy fixed label width of 42; catalogs with effective options size to the longest label.Written for commit 74631fa. Summary will update on new commits.