[quality] parentOf's empty-prefix fallback in e2e-data-fixtures.cjs is the file's only uncovered region
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 90/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript
- Domain
- testing
Research direction
Read the existing non-object-parent test at tests/e2e-data-fixtures.test.mjs:78 and the parentOf() guard in tests/tools/e2e-data-fixtures.cjs. Add a test for top-level non-object documents that asserts the error names the full dotted path. Run npm run test:unit:coverage; done means the fallback region is covered and the tests pass.
Written by the indexing model from the issue text.
Description
Finding
parentOf() in tests/tools/e2e-data-fixtures.cjs builds the error that
rejects an overlay naming a path the real data does not have:
if (cursor === null || typeof cursor !== 'object' || Array.isArray(cursor))
throw new Error(
`${label}: "${walked.join('.') || dottedPath}" is not an object in the real data`,
);
The || dottedPath arm has never been executed. npm run test:unit:coverage
reports tests/tools/e2e-data-fixtures.cjs at 100.00% lines but 98.59%
regions, with the sole uncovered region at line 130 — that fallback.
tests/e2e-data-fixtures.test.mjs:78 covers the other arm only. Its case,
applyOverlay({ a: [1] }, { set: { 'a.b.c': 1 } }), walks one segment
successfully before the array stops it, so walked is ['a'] and the message
names "a".
Why the uncovered arm matters
It is the arm taken when the first segment fails, where walked is still
empty. Without the fallback the overlay is rejected with
f: "" is not an object in the real data
which names nothing. The whole purpose of these guards, as the file's own
header says, is that "a regenerated data file breaks the build instead of
taking the coverage with it" — a diagnosis that identifies no path defeats
that.
It is reachable, not defensive. applyOverlay() validates that the overlay
is a JSON object (e2e-data-fixtures.cjs:158) but never validates the real
data: overlaySource() passes whatever JSON.parse returned for the data
file. Every file under data/ is an object today, so nothing exercises it —
but a data file regenerated as a top-level array, which is the shape a list of
records most naturally takes, lands here on its first segment.
Evidence and provenance
- Unit:
npm run test:unit:coverage(TZ=UTC node tests/tools/coverage-report.mjs,
node v26.10.0), run locally 2026-10-05 atcncf/endusersmainrev
900592b:tests/tools/e2e-data-fixtures.cjs100.00% lines / 98.59%
regions, uncovered region at line 130. - End-to-end: not applicable, and not claimed either way. This module runs
inside the webpack build, not in the browser, so it carries no source-mapped
regions in theEnd-to-end coveragereport
(run 37259905958,
artifacte2e-coverage,report.json, which listssrc/**only). - Reachability confirmed by mutation: replacing
${walked.join('.') || dottedPath}with${walked.join('.')}leaves all 22
existing tests intests/e2e-data-fixtures.test.mjspassing. Nothing on
mainpins this arm.
Recommendation
Add one case to tests/e2e-data-fixtures.test.mjs, beside the existing
non-object-parent test, asserting that a document which is not an object is
rejected with the full dotted path rather than an empty prefix:
test('a document that is not an object names the whole path, not an empty prefix', () => {
for (const document of [[], null, 'text', 7]) {
assert.throws(
() => applyOverlay(document, overlay({ set: { 'a.b': 1 } }), 'f'),
/"a\.b" is not an object in the real data/,
`${JSON.stringify(document) ?? 'undefined'}: the message must name the path`,
);
}
});
The four documents cover each disjunct of the guard — array, null, and two
non-object primitives — all of which fail on the first segment, which is the
condition the fallback exists for.
No change to tests/tools/e2e-data-fixtures.cjs itself; the fallback is
correct, it was simply unpinned.
Scope
One deliverable, one file, one PR. This does not touch
tests/tools/e2e-coverage-report.mjs, tests/tools/e2e-coverage-run.mjs,
tests/e2e/** or any src/** file, so it is disjoint from the open
hold-gated PRs over the e2e reporter (#1040, #1051, #1070, #1072), the
coverage CLI (#1048) and the e2e specs (#1034, #1054, #1058, #1060, #1065,
#1075). #1034 is the only open PR that edits
tests/e2e-data-fixtures.test.mjs; its diff is confined to the
the variant build clears the fields the ordinary build keeps test and does
not touch parentOf or any of its error messages.
Priority
- Impact: medium (an unpinned diagnostic in the guard that protects every e2e data fixture)
- Effort: low
🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5n31 | SHA: 900592b
— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88
- Dominant language
- JavaScript
- Stars
- 0
- Forks
- 2
- Avg merge
- 22h 21m
- Merged PRs (30d)
- 404
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cncf/endusers
-
agent/scanner bug hive/hosted-available-lke648397-260827-5n31
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
[quality] the member-dialog logo-less e2e case reads data/members.json, so a landscape refresh can silently retire itPossibly taken @hivecommons-hive claimed this today. Openagent/quality hive/covered-by-pr hive/hosted-available-lke648397-260827-5n31 quality testing
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
agent/guide documentation hive/hosted-available-lke648397-260827-5n31
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
agent/quality hive/covered-by-pr hive/hosted-available-lke648397-260827-5n31 quality testing
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
agent/guide documentation hive/hosted-available-lke648397-260827-5n31
Difficulty 1/5 Under an hour Newbie friendliness 82/100
Maintainers usually reply within 1 day
Similar issues
-
Bug pulumi/pulumi
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
andromarces/agent-loops#571 ·
Maintainers usually reply within 1 day
-
Code Cleanup Dev Environment
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ProjectSidewalk/SidewalkWebpage#5699 ·
Maintainers usually reply within 1 day
-
automated issue report
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
lirantal/discoprint#38 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
zenstackhq/zenstack#2873 ·
Maintainers usually reply within 1 day