Skip to content

feat: add testtrack show to read a split's remote weights#72

Draft
bestdan wants to merge 2 commits into
Betterment:mainfrom
bestdan:bestdan/show-split-weights
Draft

feat: add testtrack show to read a split's remote weights#72
bestdan wants to merge 2 commits into
Betterment:mainfrom
bestdan:bestdan/show-split-weights

Conversation

@bestdan

@bestdan bestdan commented Jun 24, 2026

Copy link
Copy Markdown
Member

What

Adds a read-only testtrack show <split> command that prints the current variant weights of a split / feature gate from the remote TestTrack server, without modifying the local schema.

Why

Reading live weights previously required testtrack sync (which mutates the local schema), the admin UI, or a raw curl. show is a side-effect-free lookup so devs can check a feature gate's current weights directly.

Usage

TESTTRACK_CLI_URL=https://tt.example.com testtrack show my_app.my_feature_enabled
# my_app.my_feature_enabled
#   false  100%
#   true     0%

--json emits the raw weights map for scripting. Works against both a real server and a local testtrack server.

Notes

  • GETs api/v2/split_registry (no .json suffix) so it resolves against both the real Rails server and the bundled fakeserver (which registers the suffix-less route). Verified live against a demo environment.
  • Reuses the existing serializers.RemoteRegistry; no new dependencies.
  • Tests cover human/JSON formatting, sorted output, the not-found error, and the missing-TESTTRACK_CLI_URL path.

bestdan added 2 commits June 24, 2026 12:26
Reading live split weights previously required `sync` (which mutates the
local schema), the admin UI, or a raw curl. `show` is a read-only lookup
against the split registry so devs can check a feature gate's current
weights without side effects.
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