Skip to content

fix(e2e): assert real prod metrics shape in live-reads (object of named series) - #182

Closed
mastermanas805 wants to merge 1 commit into
mainfrom
live-reads-metrics-fix
Closed

fix(e2e): assert real prod metrics shape in live-reads (object of named series)#182
mastermanas805 wants to merge 1 commit into
mainfrom
live-reads-metrics-fix

Conversation

@mastermanas805

Copy link
Copy Markdown
Member

What

Fix-forward for the Batch A live-reads spec (#181). The W-RES /:id/metrics leg asserted metrics was an array, but the real prod shape (api/internal/handlers/resource_metrics.go returns samples.series) is an object keyed by series name ({connections_active: number[], cpu: number[], ...}).

e2e-prod run 27002031272 caught this against real prod:

Error: metrics must carry a metrics[] series; got {"data_source":"stub","metrics":{"connections_active":[3.28,...]}}

Now asserts the REAL shape: a non-empty metrics{} object whose values are numeric series arrays, plus data_source. (Per the hard rule: when a read returns an unexpected-but-correct prod shape, assert the REAL shape.)

Because the file runs serial, this single abort masked the vault/apikeys/billing/audit legs (they showed as - skipped); they execute once this lands.

Verification

  • npm run gate GREEN.
  • Will drive a fresh e2e-prod run to green after merge.

🤖 Generated with Claude Code

@mastermanas805

Copy link
Copy Markdown
Member Author

Superseded by the clean metrics-shape fix (off current main).

auto-merge was automatically disabled June 5, 2026 07:46

Pull request was closed

@mastermanas805 mastermanas805 reopened this Jun 5, 2026
@mastermanas805
mastermanas805 enabled auto-merge (squash) June 5, 2026 07:47
mastermanas805 added a commit that referenced this pull request Jun 5, 2026
… array) (#183)

Batch A read run failed: /api/v1/resources/:id/metrics returns
{ok, data_source, metrics:{<name>:number[]}} (object keyed by metric name),
but the spec asserted Array.isArray(metrics). Assert the real shape: metrics
is a non-array object with >=1 named time-series array + a data_source.
Supersedes the conflicted #182.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… array)

The W-RES metrics leg in live-reads.spec.ts asserted `metrics` was an array,
but the real prod shape (api resource_metrics.go) is an OBJECT keyed by series
name ({connections_active: number[], ...}). e2e-prod run 27002031272 caught
this on real prod. Assert the REAL shape: a non-empty object whose values are
numeric series, plus data_source. Serial-mode meant this abort masked the
vault/apikeys/billing/audit legs — they run once this lands.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mastermanas805
mastermanas805 force-pushed the live-reads-metrics-fix branch from 4eba85d to 429cfbb Compare June 5, 2026 08:09
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

size-limit report 📦

Path Size
dist/assets/index-902QtfQT.js 161.98 KB (0%)
dist/assets/index-BsJUZYRr.css 6.13 KB (0%)

auto-merge was automatically disabled June 5, 2026 08:11

Pull request was closed

@mastermanas805
mastermanas805 deleted the live-reads-metrics-fix branch June 5, 2026 08:11
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