Skip to content

Admin console: Reshards nav page + auto-discovering config-store explorer#923

Merged
benben merged 2 commits into
mainfrom
ben/admin-reshards-nav-db-explorer
Jul 9, 2026
Merged

Admin console: Reshards nav page + auto-discovering config-store explorer#923
benben merged 2 commits into
mainfrom
ben/admin-reshards-nav-db-explorer

Conversation

@benben

@benben benben commented Jul 9, 2026

Copy link
Copy Markdown
Member

Two console improvements:

Reshards in the left nav

New GET /api/v1/reshards (all orgs, newest first, limit param) + a Reshards page: every operation with org link, from→to, state badge, current step, runtime, and maintenance-mode duration — each row links to the live operation page (log, cancel). Starting a reshard stays on the org detail page; this is the fleet overview.

Config Store page → real database explorer

The models API previously showed only a hand-curated registry of typed models — every new table (reshard ops, storage usage, spawn log, goose bookkeeping…) needed a registry edit to become visible. Now it auto-discovers every base table in the config schema + CP runtime schema from information_schema, fresh per request (tables created by migrations/AutoMigrate after boot appear immediately). Unregistered tables surface under an Other group with columns in ordinal order; the existing UI groups dynamically, so they render with zero frontend changes.

Safety kept intact:

  • Typed descriptors keep their precise json:"-" redaction (password hashes, ciphertexts) — unchanged.
  • The auto path errs toward redaction: values of credential-shaped columns (password|secret|ciphertext|token|nonce|credential) return [redacted].
  • Auto keys are validated against a fresh information_schema read before any query — a crafted key 404s, never reaches SQL.

Tests

  • models_api_test.go (postgres, CI): seeds an unregistered table with an api_password column → asserts sidebar discovery (probe + goose_db_version), value redaction, column headers, and the crafted-key 404.
  • reshard_test.go: global list envelope.
  • e2e: models_explorer_api asserts goose_db_version + duckgres_reshard_operations are auto-discovered and list with real columns; reshard_validation checks the global-list envelope.
  • UI build + vitest green.

🤖 Generated with Claude Code

benben added 2 commits July 9, 2026 13:42
…orer

Reshards in the left nav: new GET /api/v1/reshards (all orgs, newest
first) + a Reshards page listing every operation — org link, from->to,
state, current step, runtime, maintenance-mode duration — each row
linking to the live operation page. Starting a reshard stays on the org
detail page.

Config Store page becomes a real database explorer: the models API now
auto-discovers every base table in the config and runtime schemas from
information_schema (fresh per request, so tables created by migrations
or AutoMigrate after boot appear immediately) and surfaces the ones
without a typed descriptor under an "Other" group, columns in ordinal
order. Typed descriptors keep their precise json-tag redaction; the
auto path errs toward redaction instead — values of credential-shaped
columns (password/secret/ciphertext/token/nonce/credential) come back
as [redacted], and auto keys are validated against a fresh
information_schema read so a crafted key can never smuggle SQL.

Tests: models postgres test seeds an unregistered table with an
api_password column and asserts discovery + redaction + the crafted-key
404; reshard handler test covers the global list; e2e models_explorer
asserts goose_db_version + duckgres_reshard_operations are discovered
and list with columns, and reshard_validation checks the global-list
envelope.
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Test Impact Plan

Deterministic summary of how this PR changes tests, CI runners, and coverage-risk signals.

Summary

Area Added Changed Deleted
Test files 0 3 0
E2E/journey files 0 1 0
Workflow files 0 0 0

Signals

  • Test cases: +0 / -0
  • Assertions: +18 / -0
  • Skips or known failures added: 0
  • Workflow continue-on-error added: 0
  • Workflow path filters added: 0
  • Test commands removed from justfile: 0
  • E2E/journey retry lines added: 0

Coverage risk: needs review

Warnings

  • E2E or journey files changed (needs review)
    • tests/e2e-mw-dev/harness.sh

@benben benben enabled auto-merge (squash) July 9, 2026 12:54
@benben benben merged commit bf41a3a into main Jul 9, 2026
27 checks passed
@benben benben deleted the ben/admin-reshards-nav-db-explorer branch July 9, 2026 13:02
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