fix(workspace): round-trip compute.provider (+ data_persistence) in GET #2410

Merged
core-devops merged 1 commits from fix/compute-serialize-provider into main 2026-06-07 21:20:20 +00:00
Member

workspaceComputeJSON hand-builds the serialized compute map and only emitted instance_type/volume/display. So compute.provider and compute.data_persistence were forwarded to CP at provision time (2f5536fd / internal#734) but never returned by GET /workspaces.

Consequences (both read back by the canvas):

  • the per-workspace provider badge (core#2404) always showed the default AWS, regardless of the real cloud;
  • the data-persistence selector always showed auto.

This completes the round-trip. Still omit-when-empty → existing AWS/default rows serialize byte-identically (the exact-JSON TestWorkspaceComputeJSON_OmitsEmptyNestedSections is unchanged and green). workspaceComputeIsZero now accounts for both fields so a provider-only compute isn’t collapsed to {}.

Tests: 2 new (RoundTripsProviderAndDataPersistence, ProviderOnlyIsNotZero); full compute suite green.

Surfaced by the multi-provider e2e (cp#611): the persisted compute came back without provider — which I initially mis-read as a staging-image lag; it was this serialization gap on main.

`workspaceComputeJSON` hand-builds the serialized compute map and only emitted `instance_type`/`volume`/`display`. So `compute.provider` and `compute.data_persistence` were **forwarded to CP** at provision time (2f5536fd / internal#734) but **never returned by GET /workspaces**. **Consequences (both read back by the canvas):** - the per-workspace **provider badge** (core#2404) always showed the default **AWS**, regardless of the real cloud; - the **data-persistence** selector always showed `auto`. This completes the round-trip. Still omit-when-empty → existing AWS/default rows serialize **byte-identically** (the exact-JSON `TestWorkspaceComputeJSON_OmitsEmptyNestedSections` is unchanged and green). `workspaceComputeIsZero` now accounts for both fields so a provider-only compute isn’t collapsed to `{}`. **Tests:** 2 new (`RoundTripsProviderAndDataPersistence`, `ProviderOnlyIsNotZero`); full compute suite green. Surfaced by the multi-provider e2e (cp#611): the persisted compute came back without `provider` — which I initially mis-read as a staging-image lag; it was this serialization gap on `main`.
core-devops added 1 commit 2026-06-07 21:06:37 +00:00
fix(workspace): round-trip compute.provider (+ data_persistence) in GET
ci-arm64-advisory / fast-checks (pull_request) Waiting to run
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 5s
CI / Python Lint & Test (pull_request) Successful in 3s
CI / Detect changes (pull_request) Successful in 7s
Lint shellcheck (arm64 pilot) / shellcheck-arm64 (pilot) (pull_request) Successful in 15s
E2E API Smoke Test / detect-changes (pull_request) Successful in 7s
sop-tier-check / tier-check (pull_request_target) Has been cancelled
E2E Chat / detect-changes (pull_request) Successful in 11s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 6s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 4s
Harness Replays / detect-changes (pull_request) Successful in 33s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 9s
Lint forbidden tenant-env keys / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 10s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 17s
gate-check-v3 / gate-check (pull_request_target) Successful in 11s
sop-checklist / review-refire (pull_request_target) Has been skipped
qa-review / approved (pull_request_target) Failing after 11s
security-review / approved (pull_request_target) Successful in 8s
sop-checklist / all-items-acked (pull_request) acked: 0/7 — missing: comprehensive-testing, local-postgres-e2e, staging-smoke, +4 — body-unfilled: comprehensive-testing, local-postgres-e2
sop-checklist / na-declarations (pull_request) N/A: (none)
sop-checklist / all-items-acked (pull_request_target) Successful in 10s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m21s
CI / Canvas (Next.js) (pull_request) Successful in 8s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 7s
qa-review / approved (pull_request_review) Has been skipped
security-review / approved (pull_request_review) Has been skipped
sop-tier-check / tier-check (pull_request_review) Failing after 7s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2m18s
E2E Chat / E2E Chat (pull_request) Successful in 9s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 16s
Harness Replays / Harness Replays (pull_request) Successful in 10s
CI / Canvas Deploy Status (pull_request) Successful in 1s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 1m10s
CI / Platform (Go) (pull_request) Successful in 8m37s
CI / all-required (pull_request) Successful in 18s
audit-force-merge / audit (pull_request_target) Successful in 5s
598520b9a4
workspaceComputeJSON hand-builds the serialized compute map and only emitted
instance_type/volume/display — so compute.provider and compute.data_persistence
were FORWARDED to CP at provision time (2f5536fd / internal#734) but never
returned by GET /workspaces. Consequences:
  - the canvas per-workspace provider badge (core#2404) always showed the
    default AWS, regardless of the workspace's real cloud;
  - the data-persistence selector always showed "auto".

Both are read back by the canvas (data.compute.provider / .data_persistence),
so this completes the round-trip. Still omit-when-empty, so existing
AWS/default rows serialize byte-identically (the exact-JSON test is unchanged).
workspaceComputeIsZero now also accounts for these two fields so a
provider-only compute isn't collapsed to "{}".

Surfaced by the multi-provider e2e (cp #611): the persisted compute came back
without provider, which I initially mis-read as a staging-image lag — it was
this serialization gap on main.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
molecule-code-reviewer approved these changes 2026-06-07 21:07:42 +00:00
molecule-code-reviewer left a comment
Member

APPROVED — round-trips compute.provider + data_persistence in GET (were forwarded but dropped from serialization). Makes the core#2404 provider badge functional. Omit-when-empty preserves byte-identical output for existing rows (exact-JSON test unchanged). 2 new regression tests green.

APPROVED — round-trips compute.provider + data_persistence in GET (were forwarded but dropped from serialization). Makes the core#2404 provider badge functional. Omit-when-empty preserves byte-identical output for existing rows (exact-JSON test unchanged). 2 new regression tests green.
core-security approved these changes 2026-06-07 21:07:45 +00:00
core-security left a comment
Member

APPROVED (security) — serialization-only; no auth/secret surface. provider/data_persistence are non-sensitive enums.

APPROVED (security) — serialization-only; no auth/secret surface. provider/data_persistence are non-sensitive enums.
core-devops merged commit 7e86f71ca1 into main 2026-06-07 21:20:20 +00:00
core-devops deleted branch fix/compute-serialize-provider 2026-06-07 21:20:21 +00:00
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#2410