Skip to content

feat(tern): support Vitess pull schema#391

Merged
aparajon merged 2 commits into
mainfrom
armand/vitess-pull-schema
Jun 17, 2026
Merged

feat(tern): support Vitess pull schema#391
aparajon merged 2 commits into
mainfrom
armand/vitess-pull-schema

Conversation

@aparajon

Copy link
Copy Markdown
Collaborator

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

  • Enable PullSchema execution for Vitess database routes
  • Pull Vitess keyspace schemas through the existing PlanetScale/Vitess client path
  • Return each keyspace as a namespace with table DDL and vschema.json artifacts
  • Let schemabot onboard materialize Vitess namespaces and VSchema artifacts

Risk 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

Copilot AI review requested due to automatic review settings June 17, 2026 01:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 PullSchema routing/execution for Vitess targets and fetch keyspace schemas + vschema.json via the PlanetScale client.
  • Update schemabot onboard to accept Vitess pull responses and write vschema.json artifacts 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.

Comment thread pkg/tern/local_client.go
Comment thread pkg/tern/local_client.go
Comment thread pkg/tern/local_client_integration_test.go Outdated
@aparajon aparajon force-pushed the armand/vitess-pull-schema branch from 9dd2e9b to 598f756 Compare June 17, 2026 01:26
@aparajon aparajon marked this pull request as ready for review June 17, 2026 11:45
@aparajon aparajon requested review from Kiran01bm and morgo as code owners June 17, 2026 11:45
@aparajon aparajon force-pushed the armand/vitess-pull-schema branch from 598f756 to dec83e5 Compare June 17, 2026 12:45
@aparajon aparajon merged commit 9589a47 into main Jun 17, 2026
29 checks passed
@aparajon aparajon deleted the armand/vitess-pull-schema branch June 17, 2026 13:48
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.

3 participants