feat(localscale): serve the branch table metrics endpoint - #1244
Closed
aparajon wants to merge 1 commit into
Closed
Conversation
The LocalScale PlanetScale API emulator did not serve GET
/v1/organizations/{org}/databases/{db}/branches/{branch}/metrics/tables,
so every plan against LocalScale took the fail-open branch and no
integration test could assert the size fields on planned changes.
Serve the endpoint from the backing cluster's table statistics (data
plus index length), summed across a keyspace's shards on main and read
from the branch databases on other branches, in the real API's flat
per-table storage_bytes shape.
Add integration tests proving a plan's table changes carry the shard
count and the exact byte figure the endpoint reports on the PlanetScale
path — with row counts absent, since the endpoint reports bytes only —
and that a failing metrics endpoint never fails the plan, leaving only
the shard count on each change.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.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.
Stacks on #1238.
LocalScale did not serve
GET /v1/organizations/{org}/databases/{db}/branches/{branch}/metrics/tables, so every plan against it took the metrics fail-open branch and no integration test could assert the size fields on planned changes — a regression in the PlanetScale size path was invisible to CI.SHOW TABLE STATUSdata + index length), summed across a keyspace's shards onmainand read from the branch databases on other branches, in the real API's flat per-tablestorage_bytesshape. Underscore-prefixed internal tables are excluded.Planagainst LocalScale: a change to an existing table must carry the keyspace's shard count and the exact byte figure the endpoint reports, while row counts stay absent on PlanetScale (the endpoint reports bytes only).🤖 Generated with Claude Code