Repository navigation
docs(spec): add Go/TS SDK columns to data-model client reference - #445
markturansky wants to merge 1 commit into
Conversation
Extends the CLI reference section into a full client reference covering hsctl, the Go SDK (components/sdk-go), and the TypeScript SDK (components/sdk-typescript) side by side, so coverage can be verified end to end for every REST operation. Changes: - Renamed section "CLI Reference" -> "Client Reference (hsctl, Go SDK, TypeScript SDK)" with a note that both SDKs are generated from openapi.yaml via `make generate-sdk` - Added Go SDK and TypeScript SDK columns to all eight mapping tables (Gateways, ServiceAccounts, Gateway Networks, Gateway Releases, Managed Clusters, RBAC, Users, Auth & Context) - Auth & Context rows marked N/A for both SDKs - auth is handled at client construction via a static token, no login/logout flow in either SDK - Corrected the RBAC Roles section: removed the fabricated POST and DELETE rows that did not match the server (roles handler registers only GET routes; built-in roles are seeded by database migrations) - Added a prose note explaining roles are read-only migration-seeded resources (gateway:creator, platform:admin, gateway:owner, gateway:viewer) No code changes; spec only. 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 |
There was a problem hiding this comment.
Verdict
This is a clean, well-scoped documentation change that extends the client-reference tables with Go/TS SDK columns, and the SDK method names I spot-checked (Gateways().Create, roles.list, OpenShellGatewayServiceAccounts().Revoke, etc.) match the committed SDK code. The accompanying claims are mostly accurate - roles are genuinely GET-only in the OpenAPI spec and route registration - but a couple of small factual gaps are worth tightening, and there is a cross-PR coordination issue around the gateway-create interface.
Findings
See inline comments. All findings are Minor; nothing blocks merge.
- [Minor] Seeded-roles list is incomplete - the note omits
managed-cluster-registrar, which is also seeded by migration (L407). Spec Completeness - [Minor] The committed SDKs are currently out of sync with
openapi.yaml, so the "kept in sync by the build" claim and themake generate-sdkreference need a small correction (L351). Spec Consistency
Cross-PR coordination
PR #412 redefines the Gateway create interface that this PR documents: it changes the create request's required field from cluster_id to a placement (GatewayPlacementIntent) object, adds a new GET /gateways/placement-availability endpoint, and regenerates both SDKs. This PR's client-reference tables document hsctl create gateway ... --cluster-id <c> ... plus Gateways().Create / gateways.create against the current cluster_id-based model. Maintainers should decide merge order and agree who updates the gateway-create rows (and adds the new placement-availability operation): if #412 merges first, this PR's gateway-create documentation becomes inaccurate; if this PR merges first, #412 must carry the doc update. The same SDK regeneration in #412 is also what would drop the phantom Roles().Create / roles.create methods this PR already documents as absent, so the two changes share an assumption about the post-regeneration SDK surface.
Previous concerns
No prior Amber findings exist in the review history for this pull request, so there is nothing to re-verify.
Convention Checklist
| Convention | Result |
|---|---|
| No em dashes (hyphens only) | Pass |
| Documentation matches code/spec (SDK method names) | Pass |
| Documentation matches code/spec (roles read-only) | Pass |
| Seeded-role list complete | Fail |
| SDK "in sync" / build-target reference accurate | Fail |
| ## Client Reference (`hsctl`, Go SDK, TypeScript SDK) | ||
|
|
||
| The `hsctl` CLI mirrors the REST API 1-for-1. Every REST operation has a corresponding command. | ||
| The `hsctl` CLI mirrors the REST API 1-for-1. The Go SDK (`components/sdk-go`) and TypeScript SDK (`components/sdk-typescript`) are code-generated from `openapi.yaml` and expose the same operations. All three clients are kept in sync by the build (`make generate-sdk`). |
There was a problem hiding this comment.
The committed SDKs are currently out of sync with openapi.yaml, which makes two parts of this sentence slightly inaccurate:
-
make generate-sdkfrom the repo root does not exist. The rootMakefileonly definesgenerate-sdk-go(which delegates tomake -C components/api-server generate-sdk). Runningmake generate-sdkat the repo root hitsNo rule to make target. Considermake generate-sdk-go(root) ormake -C components/api-server generate-sdk. -
The clients are not actually in sync right now. The committed
components/sdk-go/client/role_api.go(Roles().Create) andcomponents/sdk-typescript/src/role_api.ts(roles.create) stillPOST /roles, butopenapi.roles.yamldefines only GET for/rolesand/roles/{id}and the roles plugin registers GET-only routes - so those create methods target a nonexistent endpoint. The TS header'sSpec SHA256also differs from the currentopenapi.yamlhash, confirming the generated SDK predates the current spec. This pre-existing drift is consistent with your decision to omitRoles().Create/roles.createfrom the table, but the SDKs should be regenerated so reality matches this new wording.
| | `GET /api/hypershell/v1/role_bindings/{id}` | `hsctl get roleBinding <id>` | ✅ implemented | | ||
| | `POST /api/hypershell/v1/role_bindings` | `hsctl create roleBinding --role-id <r> --scope <s> [--user-id <u>]` | ✅ implemented | | ||
| | `DELETE /api/hypershell/v1/role_bindings/{id}` | `hsctl delete roleBinding <id>` | ✅ implemented | | ||
| Roles are read-only platform resources seeded by database migrations (`gateway:creator`, `platform:admin`, `gateway:owner`, `gateway:viewer`). There is no REST endpoint to create or delete roles; only listing and lookup are exposed. |
There was a problem hiding this comment.
This list omits a seeded role: migrations also seed managed-cluster-registrar (RoleManagedClusterRegistrar in components/api-server/plugins/roles/model.go, inserted in components/api-server/plugins/roles/migration.go). Please add it so the enumerated set is complete.
|
🤖 Automated message posted by a robot (coordination note from the author of #447). Cross-PR coordination with #447 (gateway access management). We expect #447 to land after this PR, so the rebase burden is on #447 -- no changes are needed here. Flagging so you are aware of what grows:
Nothing to do on your side; this is just a heads-up that #447 will reconcile onto your table shape once this merges. If the merge order changes, let us know and we will swap who rebases. |

Summary
specs/platform/data-model.spec.mdinto a full client reference coveringhsctl, the Go SDK, and the TypeScript SDK side by sidePOST /rolesandDELETE /roles/{id}rows that did not exist on the server; the roles handler registers only GET routes and built-in roles are seeded by database migrations (gateway:creator,platform:admin,gateway:owner,gateway:viewer)Drift surfaced (not fixed here)
components/sdk-go/client/role_api.goandcomponents/sdk-typescript/src/role_api.tsboth contain a staleCreatemethod callingPOST /roles- a ghost from when that route was planned. The server rejects it (no handler registered). These will be cleaned up by the nextmake generate-sdkrun once there is confidence the OpenAPI spec will not grow aPOST /rolesback.Test plan
components/sdk-go/client/*_api.goandcomponents/sdk-typescript/src/*_api.tscomponents/api-server/plugins/roles/plugin.goregisters only GET routes (no POST/DELETE)🤖 Generated with Claude Code