fix(workspace): round-trip compute.provider (+ data_persistence) in GET #2410
Reference in New Issue
Block a user
Delete Branch "fix/compute-serialize-provider"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
workspaceComputeJSONhand-builds the serialized compute map and only emittedinstance_type/volume/display. Socompute.providerandcompute.data_persistencewere forwarded to CP at provision time (2f5536fd/ internal#734) but never returned by GET /workspaces.Consequences (both read back by the canvas):
auto.This completes the round-trip. Still omit-when-empty → existing AWS/default rows serialize byte-identically (the exact-JSON
TestWorkspaceComputeJSON_OmitsEmptyNestedSectionsis unchanged and green).workspaceComputeIsZeronow 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 onmain.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 (security) — serialization-only; no auth/secret surface. provider/data_persistence are non-sensitive enums.