Skip to content

chore(apps): regenerate API clients against merged API surface (#715 follow-up)#726

Merged
DorianZheng merged 2 commits into
mainfrom
chore/regen-api-clients-merged-surface
Jun 10, 2026
Merged

chore(apps): regenerate API clients against merged API surface (#715 follow-up)#726
DorianZheng merged 2 commits into
mainfrom
chore/regen-api-clients-merged-surface

Conversation

@DorianZheng

Copy link
Copy Markdown
Member

What

Regenerates the committed API clients against the post-#715 (merged A2 + MVP) API surface — the follow-up that #715's merge commit explicitly deferred:

⚠️ CI will be red until generated clients are regenerated against the merged API surface … Generated clients now carry ZERO diff in this PR (reset to main in f9ea0730) — regenerate upstream against the merged API surface.

Since that merge, the API client drift check fails on every PR touching apps/** (e.g. #725's run 8 minutes after the merge). This PR turns it green again.

Content

Commit 2 — the regen (apps/libs/api-client, apps/api-client-go, 231 files). Pure openapi-generator 7.23.0 output, zero hand edits, produced with the exact api-client-drift.yml recipe (pinned generator via openapitools.json, NestJS spec boot with local Redis, GNU sed for the postprocess script). analytics-api-client and toolbox-api-client regenerated to zero diff (already current since #721/#723).

Surface delta (mirrors the A2 + MVP API changes):

  • removed: snapshots / docker-registry / build / backup / archive-lifecycle / quota / usage-overview endpoints and models; BoxState build states (pending_build, build_failed, …); write:snapshots + delete:snapshots permission values; listBoxesPaginated's snapshots filter param
  • added: SystemRole, UpdateOrganizationName (+ PATCH /organizations/{organizationId}/name), admin overview/observability models

Commit 1 — prek lint unblock (34 deleted lines, dashboard). The Sandbox→Box rename left LEGACY_* route enum members byte-identical to the canonical ones — 4 pre-existing @typescript-eslint/no-duplicate-enum-values errors at HEAD that fail the repo's prek pre-commit hook (make lint:fix) for every local commit. The legacy routes are unreachable (identical paths, canonical registrations precede them), so this deletes them plus the orphaned LegacyBoxRedirect. No behavior change. Included here because nothing can be committed locally until it lands.

Verification

  • go build ./... passes in apps/api-client-go (standalone), apps/common-go, apps/otel-collector/exporter.
  • The API client drift check on this PR is the canonical byte-for-byte proof.

Known follow-up (intentionally split)

Per review preference, this PR is generated code only. Three consumers still reference removed APIs and will not compile against the new clients until the prepared follow-up PR lands (branched on top of this one):

  • apps/cli — Dockerfile-build flow (CreateBuildInfo, BOXSTATE_BUILD_FAILED/PENDING_BUILD, --dockerfile/--context, MCP buildInfo arg, pkg/minio)
  • apps/dashboard — Registries page + registry hooks, usage-overview wiring in Spending/Limits, templates filter arg
  • apps/libs/sdk-typescriptBox.buildInfo/backupState/backupCreatedAt, getBuildLogsUrl

No CI workflow compiles these consumers on PR today (the drift check is the only apps/** gate), so this PR is green-mergeable; the follow-up restores local builds. Note apps/runner has a pre-existing unrelated compile failure on main (boxlite.WithPort undefined in pkg/boxlite) — out of scope here.

…values)

The Sandbox→Box rename collapsed the legacy route paths into exact
duplicates of the canonical ones, making the LEGACY_* registrations
unreachable and tripping @typescript-eslint/no-duplicate-enum-values —
4 pre-existing eslint errors at HEAD that fail the prek pre-commit hook
(make lint:fix) for every commit. Remove the dead routes, enum members,
and the orphaned LegacyBoxRedirect component. No behavior change.
… surface

Pure openapi-generator 7.23.0 output, zero hand edits — regenerated via the
api-client-drift recipe (NestJS spec boot, pinned generator, postprocess).
analytics-api-client and toolbox-api-client regenerated to zero diff.

#715 deliberately reset the generated clients to main's pre-merge side
('Generated clients now carry ZERO diff in this PR — regenerate upstream
against the merged API surface'), leaving the API client drift check red
on every apps/** PR since. This is that follow-up regen.

Surface delta (mirrors the A2 + MVP API changes):
- removed: snapshots/docker-registry/build/backup/archive-lifecycle/quota/
  usage-overview endpoints and models; BoxState build states;
  write:snapshots + delete:snapshots permission values; listBoxesPaginated
  'snapshots' filter param
- added: SystemRole, UpdateOrganizationName
  (+ PATCH /organizations/{organizationId}/name),
  admin overview/observability models

Consumers (apps/cli, apps/dashboard, apps/libs/sdk-typescript) still
reference removed APIs; their adaptation is split into a follow-up PR.
@DorianZheng DorianZheng requested a review from a team as a code owner June 10, 2026 16:16
@DorianZheng DorianZheng merged commit e2f7ca8 into main Jun 10, 2026
29 of 30 checks passed
@DorianZheng DorianZheng deleted the chore/regen-api-clients-merged-surface branch June 10, 2026 16:19
DorianZheng added a commit that referenced this pull request Jun 10, 2026
…API clients (#727)

## What

The consumer-adaptation follow-up that #726 disclosed: makes `apps/cli`,
`apps/dashboard`, and `apps/libs/sdk-typescript` compile against the
regenerated API clients by removing code whose server-side API was
deleted in the A2+MVP merge (#715). 52 files, +115/−3063 — almost
entirely deletions.

## cli

- Deletes the Dockerfile-build flow: `--dockerfile`/`-f` and
`--context`/`-c` flags on `boxlite create`, `CreateBuildInfo`
construction (`cmd/common/build.go` with its Dockerfile parsing + MinIO
context upload), build-log streaming (`cmd/common/logs.go`, hit the
removed `/build-logs` endpoint), the MCP `create_box` `buildInfo`
argument, and `pkg/minio` (its only consumer was the build flow; `go mod
tidy` drops the dependency).
- Drops `BOXSTATE_BUILD_FAILED` / `BOXSTATE_PENDING_BUILD` handling
(states removed from the enum).
- Regenerates cobra docs via `hack/generate-cli-docs.sh` — also clears
stale `boxlite snapshot` docs left from the super PR.

## dashboard

- Deletes the **Registries** page, `RegistryTable`, the 4 registry
hooks, its route enum + hidden-routes entry, and `apiClient.ts` wiring
(`DockerRegistryApi` was removed). The page was already in
`HIDDEN_DASHBOARD_ROUTES`.
- Removes the **usage-overview** wiring (`getOrganizationUsageOverview`
removed with no successor): the
`UsageOverview`/`UsageOverviewIndicator`/`LimitUsageChart` components,
the quota-driven usage timeline chart (its "percent of quota" mode is
built on the deleted `RegionUsageOverview` quotas throughout), the hook
+ query keys + `LiveIndicator` they orphaned. **Spending and Limits keep
their billing/tier features** (wallet, cost breakdown, tier comparison,
rate limits).
- Drops the orphaned `templates` box filter (the `snapshots` query param
left `listBoxesPaginated`; nothing set the filter).

## sdk-typescript

- `Box`: drops `template`/`backupState`/`backupCreatedAt`/`buildInfo` —
fields no longer on the wire model.
- `BoxLite.create()`: the wire `CreateBox` accepts neither `buildInfo`
nor `templateId` anymore, so `create()` now **throws a clear
`BoxliteError`** when `image` or `templateId` params are provided
instead of silently dropping them. The `CreateBoxFromImageParams` type,
overload, and `Image` class stay exported (marked `@deprecated`) because
the dashboard Playground imports them — its image flow now gets an
honest runtime error (it was already broken server-side); the full
Playground rework belongs to the MVP track (`PlaygroundProvider.tsx`
already carries `TODO(image-rewrite)` markers).
- Deletes the dead `processStreamingResponse` helper (`stdDemuxStream`
stays — `Process.ts` uses it).
- **Adds guard tests** (`__tests__/BoxLite.create-guards.test.ts`) for
the two new throws, wiring the dormant jest harness to
`tsconfig.spec.json` + the workspace path aliases so it actually runs
(`yarn jest --config libs/sdk-typescript/jest.config.js`, 2/2 pass). The
asserted messages are produced only by the guards — without them the
call rejects with a network `AxiosError`.

## Verification

- `go build ./...` + `gofmt` clean in `apps/cli`; `go mod tidy` applied.
- sdk `tsconfig.lib` **and** `tsconfig.spec` typecheck clean; jest guard
tests 2/2.
- dashboard `tsc`: **216 errors vs the 232-error pre-merge baseline,
zero new** (position-normalized diff; the dashboard has never been
tsc-clean — #719 tracks that).
- `make lint:fix` exits 0 modifying nothing.
- Grep sweeps: zero remaining references to any removed client symbol
outside the generated dirs.

## Out of scope (pre-existing)

`apps/runner` fails to compile on main (`boxlite.WithPort` undefined in
`pkg/boxlite`) — fails identically at clean HEAD, unrelated to the
regen.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant