Skip to content

gate-58 e2e-networkidle matches COMMENT lines — larpingapp reports 1 finding with zero live calls #230

Closed

Description

@rubenvdlinde

Same shape as gate-48 (#191): the checker greps for the pattern with no comment filter, so a comment warning against networkidle is reported as a use of it.

Measured

Full-tree run of run-hydra-gates.sh (hydra-gates main @ 756fe89) against ConductionNL/larpingapp@development c73df92d:

[gate-58] e2e-networkidle: FAIL — 1 networkidle wait(s) in changed e2e file(s)

The single log line is:

tests/e2e/spec-coverage/detail-forms-admin.spec.ts:187:	// live `waitForLoadState('networkidle')` in the suite; every other mention

In context (lines 185-189):

// ADR-074 rule 4: `networkidle` never settles on Nextcloud — the
// notification poll keeps the network permanently busy. This was the LAST
// live `waitForLoadState('networkidle')` in the suite; every other mention
// is a comment warning against it.

The repo has zero live calls. Every one of the 10 occurrences under tests/ is a comment:

$ grep -rn "networkidle" tests/ src/ | grep -vE "^\S+:[0-9]+:\s*(//|\*|/\*|#)"
$ echo $?
1        # no matches

Cause

run-hydra-gates.sh around line 4515:

grep -nE "waitForLoadState\([[:space:]]*['\"]networkidle['\"]|waitUntil:[[:space:]]*['\"]networkidle['\"]" "$f" \
    | grep -v "e2e-networkidle exclude" \
    | while IFS= read -r hit; do ...

The only filter is the exclude marker. There is no comment stripping, so // … waitForLoadState('networkidle') … matches exactly like a call.

Note this is a doubly perverse failure mode: the more carefully a repo documents why it removed its networkidle waits, the more findings it accrues. larpingapp is the repo the gate was written against (its index-pages.spec.ts is cited in the gate header), so it has the most such comments in the fleet.

Suggested fix

Strip line comments before matching — drop lines whose match position sits after a //, *, or # on the same line. A minimal version that would fix this case without touching the pattern:

grep -nE "<pattern>" "$f" \
    | grep -v "e2e-networkidle exclude" \
    | grep -vE "^[0-9]+:[[:space:]]*(//|\*|/\*)" \

That still catches a real call with a trailing comment, and stops counting prose. A code-aware strip would be better but this closes the observed shape.

Impact

Any repo that documented the ADR-074 rule 4 removal in a comment now carries a permanent, unfixable gate-58 finding — unfixable because the only way to clear it is to delete the explanation of why the code is correct, or to add an exclude marker to a comment, which is comment-satisfaction.

Activity

  1. rubenvdlinde commented on Aug 8, 2026

    @rubenvdlinde
    ContributorAuthor

    Fixed and merged to main in #269 (cdfbd7a). Live fleet-wide now.

    Measured post-merge on larpingapp, attribution-isolated between main@32fa23e (immediately before the merge) and main@cdfbd7a, read from the runner's stdout:

    A (before): [gate-58] e2e-networkidle: FAIL — 1 networkidle wait(s) in changed e2e file(s)
    B (after):  [gate-58] e2e-networkidle: PASS
    

    Zero changes in larpingapp. Your line is a unit fixture now, verbatim.

    On the minimal fix you sketched (grep -vE "^[0-9]+:[[:space:]]*(//|\*|/\*)") — deliberately not taken, and there are tests for why:

    • it still counts const x = 1 // waitForLoadState('networkidle') is banned — a mention after code on the same line;
    • it still counts a block-comment interior line that begins with a letter, e.g. waitForLoadState('networkidle') must never be used. between /* and */;
    • it loses a real call carrying a trailing comment.

    The mask blanks the comment regions, whatever column they start in, and preserves offsets — which is what makes the e2e-networkidle exclude marker still work, since that marker lives in a comment, exactly what the mask removes. It is read from the original line at the matched line number. Asserted both ways, including that an exclude on a neighbouring line does not suppress.

    openbuild in the same run: 22 → 14. All 8 removed were verified individually as comments explaining why networkidle is not used; the 14 that remain are live calls. That is the doubly-perverse effect you named — the better a repo documented the ADR-074 rule 4 removal, the redder it got.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions