Skip to content

fix(planetscale): make resize-request restart optional#385

Merged
sam-goodwin merged 1 commit into
alchemy-run:mainfrom
agcty:fix/planetscale-resize-request-restart
Jul 22, 2026
Merged

fix(planetscale): make resize-request restart optional#385
sam-goodwin merged 1 commit into
alchemy-run:mainfrom
agcty:fix/planetscale-resize-request-restart

Conversation

@agcty

@agcty agcty commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Fixes #384.

PlanetScale removed the restart field ("ports requiring a restart") from the branch change-request payload — it is gone from the current published spec (distilled-spec-planetscale main no longer has it on PostgresClusterResizeRequest), and the live API stopped returning it. The generated client still requires it, so every getBranchChangeRequest / listBranchChangeRequests / updateBranchChangeRequest call fails at decode with SchemaError: Missing key ["restart"] — the server-side change succeeds, leaving callers (e.g. alchemy's Planetscale.PostgresBranch replica reconciliation) half-applied.

Changes:

  • patches/resize-request.patch.json: drop restart from both required lists (the patch previously re-asserted it while making completed_at nullable). Optional rather than removed, so the client tolerates both old and new API behavior.
  • The three generated operations: restart → optional (restart?: ReadonlyArray<number> / Schema.optional(Schema.Array(Schema.Number))), matching the existing optional-field idiom.

Note: the generated files are hand-adjusted to the minimal semantic change rather than fully regenerated — running bun run generate today produces ~150 files of unrelated drift (formatting + SensitiveOutputNullableStringSensitiveOutputString changes), which I did not want to fold into this fix. bun run check (tsc + oxlint + oxfmt) passes; the test suite requires live PlanetScale credentials I did not run against.

Verified against the live API: a PATCH .../branches/{branch}/changes response today carries no restart key, and the patched schema decodes it.

PlanetScale removed the restart field from the branch change-request
payload (it is gone from the current published spec), so the required
Schema.Array decode now fails every get/list/update change-request call
with SchemaError: Missing key ["restart"].

Drop restart from the required lists in resize-request.patch.json and
make the field optional in the three generated operations. The generated
files are hand-adjusted to the minimal semantic change because a full
regenerate currently drags in unrelated drift.

Fixes alchemy-run#384
@sam-goodwin
sam-goodwin merged commit 3f68985 into alchemy-run:main Jul 22, 2026
25 of 26 checks passed
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.

planetscale: change-request operations fail to decode — PlanetScale removed restart from the response

2 participants