Repository navigation
feat(cli): add ADLC extension kinds to hsctl with grouped help - #466
Conversation
Add get, list, create, and delete subcommands for the six ADLC extension kinds: AgentRuntime, SandboxTemplate, ProviderSpec, ProviderBinding, InferenceRoute, SecretSource. Use Cobra command groups to split the help output of each parent command (get, list, create, delete) into two sections: - Core (hypershell/v1/) for stable kinds - Extensions (hypershell/ext/) with a note that extension APIs are experimental, unsupported, and subject to change Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
Amber reviewStatus: Complete |
- Fix gofmt alignment in create/agentRuntime/cmd.go (CI failure) - Replace %v with %w in all 24 new ext command files for proper error chain propagation - Add apply support for all 6 ADLC extension kinds (AgentRuntime, SandboxTemplate, ProviderSpec, ProviderBinding, InferenceRoute, SecretSource) in isSupportedKind and applyResource path mapping - Update apply test to assert all 6 new kinds are supported - Add pkg/urls/urls_test.go: verify all ext paths use /ext/ prefix, not /v1/, and item path helpers append the ID correctly - Add cmd/hsctl/get/cmd_test.go: verify all 12 subcommands registered, core commands in core group, ext commands in ext group, ext group title contains "experimental" and "unsupported" - Add cmd/hsctl/list/cmd_test.go: same group registration coverage Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Verdict
The new hsctl extension subcommands remain clean, and the latest commit resolved both style nits: the agentRuntime args struct is now gofmt-aligned and every new command wraps errors with %w. The one substantive item is unchanged and is a merge-ordering dependency rather than a code defect: all extension commands target /api/hypershell/ext/..., while the server on main still serves these kinds under /api/hypershell/v1/... (and nests secret_sources under agent_runtimes), so the CLI is non-functional until the companion server-side move lands.
Findings
[Major] CLI targets /api/hypershell/ext/, but main's server serves /api/hypershell/v1/ (still present)
components/cli/pkg/urls/urls.go:11-17 defines ExtAPIPrefix = "/api/hypershell/ext" and routes all six extension kinds through it; urls_test.go now also codifies this prefix. On main these kinds are still registered on the /api/hypershell/v1 router (components/api-server/plugins/agentRuntimes/plugin.go:42-46), and secret_sources is registered nested under /agent_runtimes/{agent_runtime_id}/secret_sources (components/api-server/plugins/secretSources/plugin.go:46), not as a flat top-level resource. Merged on its own, all 24 new commands would 404. This is a merge-ordering dependency on the server-side relocation - see Cross-PR coordination. I am not re-posting an inline comment; the existing inline thread tracks this: #466 (comment)
Cross-PR coordination
Two coordination items need a maintainer decision:
-
#462 is the server-side counterpart and must land first (or together). It moves all six ADLC extension kinds from
/api/hypershell/v1/to/api/hypershell/ext/and flattenssecret_sourcesto a top-level route - exactly the surface this CLI assumes (ExtAPIPrefix, flatSecretSourcesPath). If this PR merges before that server move, the newhsctlcommands point at endpoints that do not exist onmainand will 404. Maintainers should gate this PR on #462 or sequence them together. -
#447 adds
gatewayAccessCLI subcommands into the samecreate/list/deleteregistration files that this PR restructures. This PR introduces a core/ext help-grouping convention (Cmd.AddGroup(groupCore, groupExt)plus aGroupIDon every subcommand increate/cmd.go,list/cmd.go,get/cmd.go,delete/cmd.go). #447 registers its new commands with a plainAddCommandand noGroupID. Whichever PR merges second must assign the other PR's new commands to the correct group, or the un-grouped commands fall outside the Core/Extensions taxonomy as cobra "Additional Commands". The owners should agree on who adds theGroupIDwiring and in what order.
Previous concerns
- [Major] CLI routes to
/ext/while the server serves/v1/(#466 (comment)) - still present.components/cli/pkg/urls/urls.go:11-17still uses/ext/, andcomponents/api-server/plugins/agentRuntimes/plugin.go:46/components/api-server/plugins/secretSources/plugin.go:46still serve/v1and the nestedsecret_sourcesroute onmain. - [Minor]
create/agentRuntime/cmd.gonot gofmt-clean (#466 (comment)) - addressed. Theargsstruct atcomponents/cli/cmd/hsctl/create/agentRuntime/cmd.go:18-27is now aligned to a single space (commit 225b729). - [Minor] Error wrapping used
%vinstead of%w- addressed. The new commands now wrap with%w(e.g.components/cli/cmd/hsctl/create/secretSource/cmd.go:67,91,97,103; same across the other create/get/list/delete commands in commit 225b729).
Findings Summary (ordered by severity, highest first)
- [Major] CLI routes extension kinds to
/ext/whilemain's server serves them at/v1/(and nestssecret_sources); depends on the server-side move landing first - Interface / Change Order (urls.go L11-17)
Convention Checklist
| Convention | Result |
|---|---|
No panic() in production code |
Pass |
Errors wrapped with fmt.Errorf("...: %w", err) |
Pass |
gofmt applied |
Pass |
| No secrets in logs or responses | Pass |
| Secret stored as reference, not inline value | Pass |
| Conventional commit messages | Pass |
| CLI paths match server routes | Fail (pending server move) |

Summary
Help output
Test plan
hsctl get --helpshows two groupshsctl list --helpshows two groupshsctl create --helpshows two groupshsctl delete --helpshows two groupsgo build ./...andgo vet ./...pass clean🤖 Generated with Claude Code