Skip to content

feat(http): migrate /api/v1/db/timeline to sid-level timeline - #184

Merged
zzylol merged 1 commit into
mainfrom
feat/schema-retire-2-http-timeline
May 13, 2026
Merged

zzylol merged 1 commit into
mainfrom
feat/schema-retire-2-http-timeline

Conversation

@zzylol

@zzylol zzylol commented May 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Schema retirement #2 of 5. The /api/v1/db/timeline handler now reads from the sid catalog (state.sketch_index) via sketch_db::query::timeline::timeline_for_metric (PR #183) instead of state.schemas.timeline_for_metric.

User-visible behavior

  • Endpoint always works (no more 503 when schema-registry isn't wired — the sid catalog is always present).
  • agg_id field carries a stable content-derived signature id (xxh64 of metric + agg_kind + group_by_keys).
  • Segments reflect the sid catalog directly; reconfigure semantics propagate once the next sub-PR (lifecycle reconcile) lands.

Test impact

  • test_get_timeline_without_registry_returns_503 rewritten to ..._with_no_sids_returns_empty_200.
  • test_get_timeline_returns_segments_after_reconfigure ignored — uses POST /streaming-configSchemaRegistry::reconcile, which doesn't yet propagate to the sid catalog. Re-enabled in the next sub-PR.

Test plan

  • cargo test -p data_plane --lib — 789 pass, 3 ignored (2 pre-existing + this one).

🤖 Generated with Claude Code

Schema retirement #2 of 5. The `/api/v1/db/timeline` handler now
reads from `state.sketch_index` (always attached) via
`sketch_db::query::timeline::timeline_for_metric` (PR #183) instead
of `state.schemas.timeline_for_metric`.

User-visible behavior:

- Endpoint always works (no more 503 when schema-registry isn't
  wired — the sid catalog is always present).
- `agg_id` field carries a stable content-derived signature id
  (xxh64 of `metric + agg_kind + group_by_keys`) instead of the
  controller-emitted `agg_id` (which is gone after M2.2 / PR #152).
- Segments now reflect the sid catalog directly; reconfigure
  semantics propagate once the next sub-PR (lifecycle reconcile)
  lands.

Test impact:

- `test_get_timeline_without_registry_returns_503` rewritten to
  `..._with_no_sids_returns_empty_200` matching the new semantics.
- `test_get_timeline_returns_segments_after_reconfigure` ignored
  (uses POST /streaming-config → SchemaRegistry::reconcile, which
  doesn't yet propagate to the sid catalog; re-enabled in the next
  sub-PR with the lifecycle reconcile).

789/792 lib tests pass (3 ignored — 2 pre-existing + this one).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@zzylol
zzylol merged commit 50d6cad into main May 13, 2026
@zzylol
zzylol deleted the feat/schema-retire-2-http-timeline branch July 17, 2026 20:05
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