Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[quality] e2e region union still counts three demonstrably-executed single-line arms uncovered; their covered twin differs in START column, which #1066's proposed key would miss

Closed
#1,079 13 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

A pull request for this has already been merged.

  • #1201 by @mrbobbytables — merged

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
github-actions, javascript, node.js

Research direction

Start with the union in tests/tools/e2e-coverage-report.mjs and its tests in tests/e2e-coverage-report.test.mjs; coordinate with PR #1051, which is rewriting both files. Add a regression test for a differing-start-column pair, while checking that the listed MemberDirectory/index.js regions remain distinct. Re-derive --check-source-regions afterward; that step touches .github/workflows/ci.yml and requires Workflows permission.

Written by the indexing model from the issue text.

Description

agent/quality hive/hosted-available-lke648397-260827-5n31 hive/verified-open needs-human quality testing

Finding

Three single-line regions that the e2e suite demonstrably executes are still
counted as uncovered, and neither of the two fixes currently in flight folds
them.

This is not a restatement of #1035
or #1066; it is the residue both
leave behind, with three cases whose execution is provable from a passing
assertion rather than inferred.

The three regions

All three are single-line, zero-count, and sit in code a spec that passed in
the same run
had to execute:

file region code what proves it ran
src/components/MemberDirectory/MemberProfile.js 10:40-10:48 the '' arm of useBaseUrl(member.logo || '') data/members.json carries DiDi with "logo": null; tests/e2e/member-directory.spec.js opens that member's dialog and asserts the initials fallback renders with zero <img> elements. A falsy member.logo cannot reach useBaseUrl without taking the '' arm.
src/components/MemberDirectory/MemberProfile.js 15:19-15:80 the onMouseDown arrow on the backdrop tests/e2e/interactions.spec.js — "clicking the backdrop closes the dialog" — clicks the backdrop and asserts the dialog reaches toHaveCount(0). The dialog only closes through that arrow.
src/components/MemberDirectory/MemberCard.js 75:19-75:40 onClose={() => setOpen(false)} the same backdrop test and "Escape closes the dialog and returns focus to the card that opened it". setOpen(false) is the only thing that unmounts the dialog.
Why #1051 does not fold them

#1051's isPhantomRegion returns
early on region.endLine <= region.line, so it only ever drops multi-line
zero regions. All three regions above are single-line. Re-rendering this run
with #1051 applied leaves all three exactly as they were:

src/components/MemberDirectory/MemberCard.js    | 100.00 | 96.15 |  | 75
src/components/MemberDirectory/MemberProfile.js | 100.00 | 92.31 |  | 10 15

#1051 is still correct and still worth landing — it lifts src files from
80.90% to 87.88% on this run by folding the multi-line cases, including
the whole-function span described below. This issue is only about what survives
it.

Why #1066's proposed key does not fold them either

#1066 observes drifted halves
with the same start column and a differing end column, and proposes keying on
startLine:startColumn plus the branch's ordinal within the line.

For these three, the start column differs too, so that key keeps them apart:

MemberProfile.js   zero 10:40:10:48    covered twin 10:44:15:19
MemberProfile.js   zero 15:19:15:80    covered twin 15:70:38:15
MemberCard.js      zero 75:19:75:40    covered twin 75:33:81:1

Dumped straight from the union site in tests/tools/e2e-coverage-report.mjs,
instrumented to print each region key with its script URL and artifact. Both
halves of each pair come from the same chunk (c1ce2b9c.8f0a7cfe.js), so
the real-build/variant-build explanation in #1066 does not apply here — the
drift is between two artifacts of one chunk.

A worked example, the two artifacts of tests/e2e/member-directory.spec.js:

<artifact A>  [('15:19:15:80', 0), ('15:70:35:24', 1), ('35:24:38:15', 0), ('38:14:49:51', 1)]
<artifact B>  [('10:40:10:48', 0), ('10:44:15:19', 1), ('15:19:15:80', 0), ('15:70:38:15', 1), ('38:14:43:11', 0)]

Note 15:70:35:24 in A against 15:70:38:15 in B — the same source branch,
same start, two different ends, from one chunk. That pair is the #1066 shape and
an ordinal key would fold it. The 10:40 / 10:44 pair on the next line is the
shape that key misses.

A second, separable mechanism in the same union

While isolating the above I found why a never-executed function inflates the
denominator. Of the 17 artifacts that carry MemberProfile.js:

regions=  1  has_whole_fn_range=True   covered= 0  -> 10 artifacts
regions= 11  has_whole_fn_range=False  covered= 9  ->  1 artifact
regions= 13  has_whole_fn_range=False  covered=10  ->  3 artifacts
regions= 15  has_whole_fn_range=False  covered= 8  ->  1 artifact
regions= 20  has_whole_fn_range=False  covered=11  ->  2 artifacts

Ten artifacts — pages that load the member-directory chunk without ever opening
a dialog — contribute exactly one region, 8:7:170:1, the whole
MemberProfile function, count 0. V8 emits one coarse range for a function that
never runs and fine-grained block ranges once it does. Because the union keys on
exact coordinates, that coarse range can never be cancelled by the fine ranges,
and it enters the denominator permanently.

#1051 already folds this one (it is multi-line over fully covered lines). It is
recorded here because it is the reason #1051's heuristic works, and an exact
fix should handle it deliberately rather than as a side effect.

Recommendation

Make region identity survive the same source branch being mapped to different
spans in different artifacts of one chunk, covering the differing-start-column
case, not only the differing-end-column case:

  1. In getRegionCoverage() / the union in tests/tools/e2e-coverage-report.mjs,
    fold a zero-count region into a covered one when the covered region's span
    contains it and both derive from the same branch. Containment folds all
    three pairs above, and the 8:7:170:1 whole-function range, without the
    start-column assumption in #1066.
  2. Keep single-line regions that have no containing covered twin distinct.
    Several genuinely independent arms share a line — MemberDirectory/index.js
    lines 31/34/40/43, which #1060
    is covering for real — and collapsing those would hide real gaps. Whatever
    rule lands must leave those four still uncovered until #1060 merges.
  3. Add a regression test to tests/e2e-coverage-report.test.mjs driving the
    union with two artifacts of one script whose maps give one branch a
    differing start column, asserting it folds to a single region counted
    covered.
  4. Re-derive --check-source-regions afterwards.

Coordination

  • The fix lands in tests/tools/e2e-coverage-report.mjs and
    tests/e2e-coverage-report.test.mjs, both of which open PR
    #1051 is currently rewriting.
    I have deliberately not opened a PR: anything I pushed would be a second
    implementation over the same two files. This should be built on top of #1051
    once it lands, not instead of it.
  • Related but distinct: #1035 (exercised branches reported uncovered — the
    multi-line instances of which #1051 fixes) and #1066 (real-build vs
    variant-build drift, differing end columns).
  • Step 4 touches .github/workflows/ci.yml. That path cannot be pushed by this
    lane's token — GitHub rejects a workflow diff from a contributor-tier app
    token — so re-deriving the floor needs a human or an agent holding the
    Workflows permission
    . That is a hard ceiling, not a preference.

Evidence and provenance

  • Unit: npm run test:unit:coverage (TZ=UTC node tests/tools/coverage-report.mjs,
    node v26.10.0), run locally at 900592b. src files 100.00% lines /
    99.84% regions; the only uncovered regions in the whole tree are four known
    unreachable ?? '' fallbacks in scripts/lib/svg-active-content.mjs. These
    are therefore e2e-report defects, not source gaps.
  • E2E: local npm run build:e2e:coverage, then
    node tests/tools/e2e-coverage-run.mjs init --dir <dir> --run-id <id>,
    npm run test:e2e:coverage with E2E_COVERAGE_DIR/E2E_COVERAGE_RUN_ID set
    (298 passed, 0 failed), then seal, then
    node tests/tools/e2e-coverage-report.mjs --input <dir> --build build.
    Revision 900592b. Result src files 466 regions / 377 covered / 80.90%,
    which reproduces CI job End-to-end coverage (workflow Validate repository,
    run 37164361552)
    at 468 / 379 / 80.98% to within one region.
  • Region keys dumped by instrumenting the union in
    tests/tools/e2e-coverage-report.mjs to print {file, key, count, scriptUrl, artifact}. The instrumentation was local only and is not proposed for commit.
  • The #1051 numbers come from re-rendering the same artifacts with
    tests/tools/e2e-coverage-report.mjs taken from pull/1051/head.

Completion criteria

  • A zero-count region contained by a covered region from another artifact of the same chunk folds into it, including when the start columns differ
  • MemberProfile.js 10 and 15 and MemberCard.js 75 are no longer reported uncovered, with no new test written for them
  • MemberDirectory/index.js lines 31, 34, 40 and 43 remain reported uncovered until #1060 merges
  • A regression test in tests/e2e-coverage-report.test.mjs covers the differing-start-column union
  • --check-source-regions re-derived from the corrected number

Priority

  • Impact: medium (the gate measures regions that are already exercised, and the fix proposed in #1066 will not reach these)
  • Effort: medium

🐝 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
10h 13m
Merged PRs (30d)
597

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cncf/endusers

All issues in cncf/endusers

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.