Vendor the API client into the CLI, drop the planetscale-go dependency#1286
Draft
no-itsbackpack wants to merge 6 commits into
Draft
Vendor the API client into the CLI, drop the planetscale-go dependency#1286no-itsbackpack wants to merge 6 commits into
no-itsbackpack wants to merge 6 commits into
Conversation
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>
Co-authored-by: Cursor <cursoragent@cursor.com>
…client branch. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
github.com/planetscale/planetscale-go/planetscalenow importgithub.com/planetscale/cli/internal/planetscale. The package name is unchanged so no call sites moved.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.mdexplains the new workflow for contributors and coding agents, andAGENTS.mdlinks 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 fullgo test ./...suite pass, including the vendored client's own tests.