Skip to content

Vendor the API client into the CLI, drop the planetscale-go dependency#1286

Draft
no-itsbackpack wants to merge 6 commits into
mainfrom
remove-planetscale-go-dependancy
Draft

Vendor the API client into the CLI, drop the planetscale-go dependency#1286
no-itsbackpack wants to merge 6 commits into
mainfrom
remove-planetscale-go-dependancy

Conversation

@no-itsbackpack

Copy link
Copy Markdown
Contributor

Problem:

Every API change in the CLI required touching two repos. You had to add the new endpoint to planetscale-go, get that PR merged, tag a release, bump the version in the CLI's go.mod, and only then start the actual CLI work. The CLI is the only thing here that consumes planetscale-go, so this release dance added overhead to every feature without buying us anything.

Solution:

Copy the API client from planetscale-go (v0.175.0, the exact version we were pinned to) into this repo at internal/planetscale/ and remove the module dependency. Adding or changing an endpoint is now a normal change in this repo, done in the same PR as the feature that needs it.

Details:

  • The client code is byte-for-byte the v0.175.0 release, including its tests. Only the import path changed, plus the User-Agent handling below.
  • All ~290 files that imported github.com/planetscale/planetscale-go/planetscale now import github.com/planetscale/cli/internal/planetscale. The package name is unchanged so no call sites moved.
  • The User-Agent header is now just pscale-cli/<version>. The old second token (planetscale-go/<version>) no longer means anything since the client version is the CLI version.
  • doc/api-client.md explains the new workflow for contributors and coding agents, and AGENTS.md links to it so nobody reintroduces the two-repo process out of habit.

The planetscale-go repo itself is not touched by this PR. It still exists for external users of the Go SDK; its future is a separate conversation.


Security impact:

None expected. No new dependencies, no auth changes, no behavior changes to requests other than the User-Agent string.


Testing:

  • go build ./... and the full go test ./... suite pass, including the vendored client's own tests.
  • Built the binary and confirmed it runs.

no-itsbackpack and others added 4 commits July 8, 2026 16:16
The CLI was the only internal consumer of planetscale-go, and every API
change required a second PR plus a release/tag/bump cycle there before
CLI work could start. Copy the client (v0.175.0) into the repo and drop
the module dependency so API changes land in a single CLI PR.

The User-Agent now reports pscale-cli/<version> only; the separate
library version token is gone since the client version is the CLI
version.

Co-authored-by: Cursor <cursoragent@cursor.com>
doc/api-client.md explains why the planetscale-go dependency was
removed and how to add endpoints now; AGENTS.md points developers at it
so nobody reintroduces the two-repo workflow.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Brings in the WithReplication field on PostgresRole and
CreatePostgresRoleRequest, the only change between v0.175.0 and
v0.176.0.

Co-authored-by: Cursor <cursoragent@cursor.com>
no-itsbackpack and others added 2 commits July 8, 2026 16:51
Co-authored-by: Cursor <cursoragent@cursor.com>
…client branch.

Co-authored-by: Cursor <cursoragent@cursor.com>
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