Repository navigation
test(coverage): reach MetricsDashboard's trends fallback with an overlay add op - #1171
Merged
Merged
Conversation
…lay add op
The trend grid at src/components/MetricsDashboard/index.js line 76 renders
through `Object.entries(lifecycle?.trends || {})`. It is the fifth of the
file's five empty-collection fallbacks and the only one no build reached:
the variant overlay could not clear `referenceArchitectureLifecycle.trends`
while it also had to append a point onto `trends.submissions.values` for the
single-point Sparkline arm, because `set` runs before `append`.
The constraint was the overlay vocabulary, not the build count. `set`,
`append` and `setWhere` all require the key they name to be present, so an
overlay could reshape a record the real data carried but never introduce one
under a keyed collection. `submissions` is the only trend with no values, so
giving it a point traded the no-values arm for the single-point one.
`add` introduces a key whose parent object exists and whose leaf does not --
the fail-loud rule pointing the other way, so a regenerated data file that
grows the same key breaks the build instead of having its record silently
overwritten by the fixture. The ordinary coverage build now `add`s a trend
beside the real two, rendering all three Sparkline arms on the one /metrics
page, and the variant build clears `trends` with the four collections it
already cleared.
Verified at 03cfcfe by rendering both builds: the real /metrics carries one
`No trend data yet` placeholder, the five-point `publications` sparkline and
a lone point at `points=50,4`; the variant /metrics renders the lifecycle
panel with no sparkline, no placeholder and no trend label at all. The full
unit suite is green at 2030 tests.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: quality <quality@hive.kubestellar.io>
Contributor
Author
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the Hive will keep the |
This was referenced Oct 7, 2026
Closed
Merged
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.
Test Improvement
src/components/MetricsDashboard/index.jsline 76 renders the lifecycle trendgrid through
Object.entries(lifecycle?.trends || {}). It is the fifth of thatfile's five empty-collection fallbacks and the only one no build reached:
the variant overlay could not clear
referenceArchitectureLifecycle.trendswhile it also had to
appenda point ontotrends.submissions.valuesfor thesingle-point
Sparklinearm, becausesetruns beforeappend.The blocker was the overlay vocabulary, not the build count.
set,appendand
setWhereall require the key they name to be present, so an overlaycould reshape a record the real data already carried but never introduce one
under a keyed collection.
submissionsis the only trend carrying no values,so giving it a point traded the no-values arm for the single-point one.
What changed
tests/tools/e2e-data-fixtures.cjsgains anaddoperation: the dottedpath's parent object must exist and the leaf key must not. That is the
fail-loud rule pointing the other way from
set's — a regenerateddata/metrics.jsonthat grows the same key breaks the build instead ofhaving the record it grew silently overwritten by the fixture. Order is now
set,add,append,setWhere, so an overlay can add an array and thenpush onto it.
tests/e2e/fixtures/data/metrics.json(new)adds one trend carryingexactly one value, beside the real two. Both keep rendering as they did, so
all three
Sparklinearms — no values, one value, many values — render onthe one real
/metricspage in one build.tests/e2e/fixtures/data-variants/metrics.jsondrops itsappendandclears
referenceArchitectureLifecycle.trendsalongside the four collectionsit already cleared, reaching line 76.
tests/e2e/metrics-sparkline-variant.spec.js→metrics-sparkline.spec.js— the arm now lives in the ordinary build, so the spec asserts all three arms
together on the real route instead of pairing a real page against a variant
one. Asserting the lone point alone would pass just as well if the grid had
quietly stopped rendering the other trends.
tests/e2e/metrics-empty-collections-variant.spec.jscovers fivecollections rather than four, and its preamble no longer says line 76 "needs
a second variant build".
tests/e2e-data-fixtures.test.mjspinsadd: it adds an absent key,rejects a key the real data already carries, rejects a missing parent, clones
the value rather than sharing it with the overlay, and composes with
append. Two new cases in every committed overlay still applies to its datafile assert that the coverage build carries exactly one single-point trend
and that the added trend did not displace the zero- and many-value trends
beside it.
Verification
Playwright cannot launch in this agent's environment (
libglib-2.0.so.0missing, no root), so the browser assertions are left to CI. What was verified
locally at
03cfcfe:npm run test:unit— 2030 passed, 0 failed, including the five newaddcases and the two new overlay cases.
npm run check:formatandnpm run check:spelling— clean.npm run build:e2e:coveragecompiled both sites, and their server-rendered/metricsis the evidence that the arms switched. The real build:The variant build renders the lifecycle panel — heading and the static
What is not yet measurabledisclosure — with no sparkline, noNo trend data yetplaceholder and no trend label, which is the|| {}arm at line 76 supplying the empty grid.
What this does not promise is that region 76 leaves the e2e report's
uncovered list:
tests/tools/e2e-coverage-report.mjskeys a region on its exactoriginal coordinates, and the region-attribution problem tracked in #1066 /
#1079 (open PR #1163) decides whether the two builds' coordinates fold. The
browser taking the arm is pinned by the specs regardless. The CI gate is
--check-source-regions 80, which only rises; no workflow file is touched.Related Issue
Closes #1170
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88