feat(tern): support Vitess pull schema#391
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends SchemaBot’s existing “pull live schema → materialize declarative files” onboarding path to support Vitess databases via the existing PlanetScale/Vitess client API, including exporting vschema.json as a namespace artifact.
Changes:
- Allow
PullSchemarouting/execution for Vitess targets and fetch keyspace schemas +vschema.jsonvia the PlanetScale client. - Update
schemabot onboardto accept Vitess pull responses and writevschema.jsonartifacts to disk. - Add unit + integration coverage for Vitess PullSchema behavior and API routing.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/tern/local_client.go | Adds Vitess PullSchema support using PlanetScale client calls (keyspace discovery, schema + VSchema fetch). |
| pkg/tern/local_client_test.go | Adds unit tests for Vitess PullSchema (single keyspace + discovery path) using a mock PS client. |
| pkg/tern/local_client_integration_test.go | Adds integration test that pulls live Vitess schema from a LocalScale container. |
| pkg/cmd/commands/onboard.go | Extends onboard write plan to support Vitess and write vschema.json artifacts. |
| pkg/cmd/commands/onboard_test.go | Adds test verifying Vitess keyspace artifacts are written during onboarding. |
| pkg/api/plan_handlers.go | Allows PullSchema execution for Vitess targets (and updates error messaging accordingly). |
| pkg/api/handlers_test.go | Adds API test for configured Vitess PullSchema routing; updates unsupported-type test to use a different type. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9dd2e9b to
598f756
Compare
Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-019eb30a-8fc6-72de-90a9-6dae7480134e
Amp-Thread-ID: https://ampcode.com/threads/T-019eb30a-8fc6-72de-90a9-6dae7480134e Co-authored-by: Amp <amp@ampcode.com>
598f756 to
dec83e5
Compare
morgo
approved these changes
Jun 17, 2026
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.
Why
SchemaBot onboarding can already pull MySQL schema state, but Vitess databases need the same control-plane initiated path so keyspace schemas can be made declarative.
What
vschema.jsonartifactsschemabot onboardmaterialize Vitess namespaces and VSchema artifactsRisk Assessment
Medium — this extends the pull/onboard path for Vitess, but leaves apply behavior unchanged and only runs when callers explicitly request a Vitess pull.
Generated with Amp