Skip to content

test(automation-docs): assert the gate's remaining branches and clear its coverage-floor entry - #320

Merged
hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-automation-docs-ratchet
Nov 1, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-automation-docs-ratchet

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Why

scripts/coverage-floor.test.mjs still carried "scripts/automation-docs.test.mjs": 4 — four ranges inside automationDocProblems/onEntry that the suite never executed. Same ratchet step as #317, #318 and #319.

Two of the four are the gate's own vacuity guards and are worth pinning:

  • an empty workflow tree is reported as (have: none) rather than (have: ), so a reader of the failure can tell "nothing committed" from "nothing parsed";
  • a doc set without README.md still reports every committed workflow as not introduced there — a runbook that documents everything must not satisfy the README requirement by accident.

The other two were unreachable, so no test could lower them:

  • onEntry: m[2] ?? "" — the second capture group is ([\s\S]*?), which always participates, so m[2] is always a string;
  • the push.branches: [...] message: (t.pushBranches ?? []) — the enclosing condition is false whenever t.push is set and pushBranches is undefined (an unfiltered push does run on main), so inside the message pushBranches is always a list. The existing "an unfiltered push trigger does run on main" assertion already covers that path.

Those two fallbacks are removed with a one-line comment each, rather than leaving the ratchet entry at 2 forever.

Verification

  • node --test scripts/automation-docs.test.mjs → 13 pass
  • node --test scripts/coverage-floor.test.mjs → 14 pass with the entry deleted (0 dead ranges in the file)

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

… its coverage-floor entry

automationDocProblems carried four ranges the suite never executed. Two
are vacuity guards worth pinning: an empty workflow tree must be named
as "none" rather than an empty list, and a doc set without README.md
must still report every committed workflow as undocumented there. The
other two could never run — onEntry's second capture group always
participates, and the push-branches message is only reached once
pushBranches is known to be a list — so they are removed rather than
papered over with a test that cannot reach them.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 1, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked both "unreachable" claims against the code rather than the description, since removing a fallback is the only behaviour-shaped part of this PR:

  • scripts/automation-docs.test.mjs:48-52 — ([\s\S]*?) is a non-optional group, so when the regex matches at all, m[2] is "" at minimum, never undefined. Dropping ?? "" is safe.
  • scripts/automation-docs.test.mjs:138-141 — the enclosing if is !(t.push && (t.pushBranches === undefined || …includes("main"))); inside the t.push ? … : … true branch, the outer condition can only hold if pushBranches === undefined was false, so .join is on a defined array. Safe.

The new fixture test exercises the (have: none) and no-README.md paths with exact expected output. Ran node --test scripts/automation-docs.test.mjs scripts/coverage-floor.test.mjs on the PR head: 27 pass, so the coverage-floor entry deletion holds. Looks correct to me; no findings.

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive
hivecommons-hive Bot merged commit dd76016 into main Nov 1, 2026
6 of 7 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/test-automation-docs-ratchet branch November 1, 2026 20:41
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

Evidence bundle `#320363265a` sha256:4420d143df779921e3b10ad361d5de1c12790d0931efa0cca0815d89f8a22a84 — download from the dashboard or `hivectl review evidence #320`.

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off dco-signoff: yes size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants