Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/coverage-floors.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"scripts/auto-close-duplicates.mjs": { "lines": 50, "branches": 83, "functions": 66 },
"scripts/check-conformance.mjs": { "lines": 70, "branches": 94, "functions": 79 },
"scripts/check-conformance.mjs": { "lines": 70, "branches": 92, "functions": 79 },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Row lowered past a branch a real assertion can reach — 🟡 Minor · Coverage

What: The floors rule allows lowering a row only "where only a test asserting nothing could reach it". Of the branches #838 left uncovered, one is checkReleaseWiring's declared-dir-without-manifest path at scripts/check-conformance.mjs:4574-4584 — and it is drivable through the function's own root parameter, which no test passes. release-wiring.test.mjs:487 calls await checkReleaseWiring() with the default root only, which is wired, so the violations.push arm never runs. The same fixture root also reaches the catch { return null } at 4559-4563, the other branch the PR body names.

A test for these asserts the exact documented diagnostic, so it is not the hollow test the rule excludes. The genuinely unreachable part is main()'s dispatch (4620-4675), which is where the row legitimately has to give.

Why it matters: The gate exists so a drop gets looked at, and the two arms involved are the fail-closed ones: a declared package whose manifest went unreadable, and a workflow file that stopped being readable. Those are the #706 shape the check was written for. Moving the row to the measured value retires the only pressure to cover them, and it gives up more of the floor than the untestable branches account for — covering them lets the row land higher than 92.

Fix: add one fixture-root case to scripts/release-wiring.test.mjs, then re-measure the row with pnpm test:scripts rather than assuming a value:

test('a declared directory with no readable manifest is reported, not skipped', async () => {
  const root = await mkdtemp(join(tmpdir(), 'release-wiring-'));
  // The dirs are declared in the workspace file but have no package.json, and
  // neither workflow exists, so both the read() catch and the roster arm run.
  await writeFile(
    join(root, 'pnpm-workspace.yaml'),
    `packages:\n${PNPM_PUBLISHED.map(d => `  - ${d}`).join('\n')}\n`
  );
  const v = await checkReleaseWiring(root);
  for (const dir of PNPM_PUBLISHED) {
    assert.ok(
      v.some(m => m.startsWith(`${dir} is declared in PNPM_PUBLISHED`)),
      `${dir} was dropped from the roster in silence:\n${v.join('\n')}`
    );
  }
});
Evidence

pnpm test:scripts on Node 24 after a full turbo run build, 1122 tests green, check-conformance.mjs at 72.47 | 93.07 | 82.70. Its uncovered-line ranges include 4562-4563, 4578-4584 and 4620-4664 / 4671-4675 — the read catch, the roster arm, and main() respectively. grep -rn checkReleaseWiring scripts/ returns exactly two call sites: the CHECKS table and release-wiring.test.mjs:487, neither passing a root.

Note publishablePackages(root) reads pnpm-workspace.yaml without a catch, so an empty temp dir throws before reaching the arm — the fixture needs that file, as above.

"scripts/check-consumer-sbom.mjs": { "lines": 99, "branches": 88, "functions": 100 },
"scripts/check-pointer-urls.mjs": { "lines": 98, "branches": 86, "functions": 100 },
"scripts/check-security-txt-expiry.mjs": { "lines": 94, "branches": 84, "functions": 88 },
Expand Down
Loading