Skip to content

[quality] GroupLinkStatus's plural drift wording and invalid-checkedAt guard have no end-to-end coverage #1094

Closed

Description

@hivecommons-hive

Finding

src/components/GroupLinkStatus/index.js is the lowest-covered file in the
end-to-end report
— 60.00% of regions — with four uncovered regions at lines
7, 23, 32 and 33. Three of them are reachable; the fourth is a different class.

 5 function formatDate(isoDate) {
 6   const parsed = new Date(isoDate);
 7   if (Number.isNaN(parsed.getTime())) return null;      // uncovered
...
23   const stale = (groupsData?.groups || []).filter(      // uncovered: the `|| []` fallback
...
28       {checkedAt && <p>Upstream group links last verified on {checkedAt}.</p>}
...
32           {stale.length === 1 ? 'has an' : 'have'}      // uncovered: the plural arm
33           archived or unreachable upstream {stale.length === 1 ? 'repository' : 'repositories'}

tests/e2e/fixtures/data/community-groups.json appends exactly one archived
group, so the coverage build always renders the singular grammar and the plural
arms at lines 32 and 33 are never taken. Line 7 needs a checkedAt that does
not parse, which the real file never has.

Two groups drifting at once is an ordinary shape — data/community-groups.json
has two groups today and npm run check:community-group-links sets archived /
reachable on both independently — and it is the shape the overlay cannot
currently produce.

Line 23's || [] is a defensive fallback over a field that is always present;
it is not in scope here, and reaching it would require clearing groups
entirely, which would stop the warning rendering at all.

Evidence and provenance

  • Unit — covered. tests/group-link-status.test.mjs already drives all
    three arms directly: "two drifted groups are listed together with plural
    wording"
    , "an unparseable checkedAt drops the verification line rather than
    rendering 'Invalid Date'"
    and "missing groups data renders without
    throwing"
    . npm run test:unit:coverage
    (TZ=UTC node tests/tools/coverage-report.mjs, node v26.10.0) run locally at
    8afaa67 reports no sub-100% region for this file.
  • E2E — not covered. CI artifact e2e-coverage, id 11348560988, from run
    37317061554,
    workflow Validate repository, job End-to-end coverage, main at
    8afaa67 — the same revision as the unit run. report.json:
    {"file":"src/components/GroupLinkStatus/index.js","regions":10,"coveredRegions":6,"regionPercent":60,"uncoveredRegions":[7,23,32,33]}.
  • Covered by unit tests but not end-to-end tests, so priority 2 under the
    coverage-evidence rules.

Recommendation

Both arms have to be reachable in one Playwright run, so this is a variant-build
case, exactly like AwardsTimeline's provenance paragraph: the ordinary
coverage build keeps the singular grammar and the rendered checkedAt line,
and a second build renders the arms beside them.

Add tests/e2e/fixtures/data-variants/community-groups.json:

{
  "description": "Appends a second drifted group and makes checkedAt unparseable, so GroupLinkStatus renders the plural arms of its drift warning (src/components/GroupLinkStatus/index.js lines 32-33) and takes formatDate's Number.isNaN guard at line 7. The ordinary coverage overlay appends exactly one archived group, so that build renders the singular grammar and the verification line; both arms are only reachable in one Playwright run because the variant build is served beside the real one.",
  "set": {
    "checkedAt": "not a timestamp"
  },
  "append": {
    "groups": [
      {
        "slug": "e2e-coverage-unreachable",
        "name": "Second Coverage Fixture User Group",
        "repository": "https://github.com/cncf/endusers",
        "archived": false,
        "reachable": false
      }
    ]
  }
}

The variant directory is additive and applies second
(tests/tools/e2e-data-fixtures.cjs:100-107), so this layers on top of the
existing tests/e2e/fixtures/data/community-groups.json and the variant build
sees two drifted groups.

This change also requires an edit to a currently-pinned unit test

tests/e2e-data-fixtures.test.mjs:170-173 uses community-groups.json as the
contrast case for awards.json — it asserts the file has no variant
overlay:

const groups = join(DATA_DIR, 'community-groups.json');
assert.deepEqual(overlayPathsFor(groups, { E2E_COVERAGE_VARIANT: '1' }), [
  join(FIXTURE_DIR, 'community-groups.json'),
]);

Adding the overlay above makes that assertion false. It must be updated to
expect both overlay paths, and another data file with no variant overlay
(members.json) should take over the contrast role so the test keeps proving
that the variant directory is consulted only when it has something to say.

  • tests/e2e/fixtures/data-variants/community-groups.json added as above
  • tests/e2e-data-fixtures.test.mjs:170-173 updated to expect both overlays, with members.json as the new contrast case
  • A spec pairs /community with /e2e-coverage-variant/community, asserting the singular grammar and the verification line on the first and the plural grammar with both group names on the second
  • src/components/GroupLinkStatus/index.js lines 7, 32 and 33 leave the uncovered-region list

Coordination

No PR is opened for this, deliberately. The required edit to
tests/e2e-data-fixtures.test.mjs collides with two open hold-gated PRs that
are already editing that file — #1034 (lines 178-215) and #1078 (lines 78-91) —
and the natural home for the spec, tests/e2e/data-variants.spec.js, is being
edited by #1034 in the same hunks a new case would take. This should be picked
up once #1034 and #1078 land.

Distinct from #1092, which is MetricsDashboard's single-point Sparkline arm
and touches no file in common; its PR (#1093) adds a separate spec file and only
edits tests/e2e/fixtures/data-variants/metrics.json.

Priority

  • Impact: medium (the lowest-covered file in the e2e report; three reachable regions)
  • Effort: low

🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5n31 | SHA: bd7842d

— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88

Activity

  1. added
    qualityApproved by a Hive merger/owner for auto-merge on green CI
    testingApproved by a Hive merger/owner for auto-merge on green CI
    agent/qualityApproved by a Hive merger/owner for auto-merge on green CI
    hive/covered-by-prHive verified that an open PR references or claims this issue; still actionable until confirmed
    hive/likely-doneHive verified that a merged PR references or claims this issue; pending confirmation
    and removed
    hive/covered-by-prHive verified that an open PR references or claims this issue; still actionable until confirmed
    on Oct 5, 2026
  2. hivecommons-hive commented on Oct 7, 2026

    @hivecommons-hive
    ContributorAuthor

    task-list sweep: 0 of 4 items ticked. Not closing yet — outstanding boxes remain.

    Outstanding items:

    • 🔲 tests/e2e/fixtures/data-variants/community-groups.json added as above
    • 🔲 tests/e2e-data-fixtures.test.mjs:170-173 updated to expect both overlays, with members.json as the new contrast case
    • 🔲 A spec pairs /community with /e2e-coverage-variant/community, asserting the singular grammar and the verification line on the first and the plural grammar with both group names on the second
    • 🔲 src/components/GroupLinkStatus/index.js lines 7, 32 and 33 leave the uncovered-region list

    Merged PRs referencing this issue so far:

    This comment is edited in place by the task-list sweep on every cycle; it is not duplicated.

  3. mrbobbytables commented on Oct 7, 2026

    @mrbobbytables
    Member

    Resolved by #1113 (merged): tests/e2e/group-link-status-variant.spec.js now covers exactly the two arms this issue names — the variant build strips checkedAt so the invalid-checkedAt guard returns null (verification line absent), and asserts the plural grammar of the drift warning on the variant page while the ordinary page keeps the singular/verification line contrast case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/qualityApproved by a Hive merger/owner for auto-merge on green CIhive/hosted-available-lke648397-260827-5n31Approved by a Hive merger/owner for auto-merge on green CIhive/likely-doneHive verified that a merged PR references or claims this issue; pending confirmationqualityApproved by a Hive merger/owner for auto-merge on green CItestingApproved by a Hive merger/owner for auto-merge on green CI

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions