UTS: flatten the RSC6a stats fixture to the current TS12 Stats shape#508
Open
paddybyers wants to merge 2 commits into
Open
UTS: flatten the RSC6a stats fixture to the current TS12 Stats shape#508paddybyers wants to merge 2 commits into
paddybyers wants to merge 2 commits into
Conversation
uts/rest/unit/stats.md's returns-paginated-stats-0 fixture used the deep per-type Stats structure (all → messages/all → count/data) that was deprecated and removed as of specification version 2.2 (features.md TS12d-o deleted). Replace it with the current flattened TS12 shape — a flat `entries` map keyed by dotted metric path, plus schema/appId — and add assertions covering entries (TS12r), unit (TS12c) and intervalTime (TS12p) so the test actually exercises the flattened API rather than only intervalId/unit. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Adds rest/integration/RSC6/stats-flattened-entries-2: inject known datapoints via the sandbox stats endpoint (G3), read them back, and assert the flattened `entries` API (TS12r) alongside intervalId/unit/schema/appId. Documents the ingestion-vs-flattened shape distinction and the `X-Ably-Version: 6` requirement to receive the flattened API, guarding against a client silently falling back to the deprecated deeply-nested Stats structure. 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.
uts/rest/unit/stats.md'sRSC6a/returns-paginated-stats-0fixture still uses the deep per-type Stats structure (all→messages/all→count/data) that was deprecated and removed as of specification version 2.2. In features.md the deep clauses (TS12d–TS12o) and TS2–TS14 are all deleted; the currentStats(TS12) is flat:intervalId(TS12a),intervalTime(TS12p, parsed from the id),unit(TS12c),inProgress(TS12q),entries— aDict<String, int>(TS12r) —schema(TS12s), andappId(TS12t).The test's assertions only checked
intervalId/unit, so the stale fixture wasn't caught — but any SDK implementing the current flattenedStatstype (as ably-rust now does) would modelentries, not the nested objects, so the fixture misrepresents the API.Change
all: { messages: {...}, all: {...} }fixture with the flattened shape: a flatentriesmap keyed by dotted metric path ("messages.all.all.count", …), plusschema/appId.entries(TS12r),unit(TS12c) andintervalTime(TS12p) so the test exercises the flattened API rather than onlyintervalId/unit.The
pagination-link-headersfixture already used onlyintervalId/unit, which is flattened-compatible, so it's unchanged.Found while implementing the flattened
Statstype in ably-rust.🤖 Generated with Claude Code