From 413e395f705ef6e22b758741412410fda15633bb Mon Sep 17 00:00:00 2001 From: mrbobbytables Date: Fri, 30 Oct 2026 06:07:26 -0500 Subject: [PATCH 1/2] ci: run every document-contract suite on the focused path The focused validation path from ADR 0011 ran only three unit suites, so a document-only PR could merge with an ADR missing from adr/README.md, a broken relative link in README.md, a blog post with malformed front matter or a docs page pointing at a missing static asset. Extend the "Check content contracts" step to every unit suite that reads an authored document and pin the list in the workflow test so a suite cannot drop out silently. tests/audit-gate.test.mjs also reads SECURITY.md but spends about 40s driving npm audit subprocesses; it stays on the full path. Fixes #2002 Refs #2003 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: mrbobbytables --- .github/workflows/ci.yml | 28 +++++++++++++++++++++---- tests/content-only-ci-workflow.test.mjs | 26 +++++++++++++++++++++-- 2 files changed, 48 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a3e5e2dd..7eeae361 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -108,10 +108,30 @@ jobs: npm run validate:members - name: Check content contracts if: ${{ !cancelled() && env.CONTENT_ONLY == 'true' }} - run: >- - node --test tests/docs-contract.test.mjs - tests/markdown-references.test.mjs - tests/community-group-coverage.test.mjs + # Every unit suite that reads an authored document (docs/, blog/, + # adr/ or a root document). tests/audit-gate.test.mjs also reads + # SECURITY.md but spends ~40s exercising npm audit, so it stays on + # the full path. + run: | + node --test \ + tests/docs-contract.test.mjs \ + tests/markdown-references.test.mjs \ + tests/community-group-coverage.test.mjs \ + tests/adr-contract.test.mjs \ + tests/architectures-sidebar-contract.test.mjs \ + tests/blog-frontmatter.test.mjs \ + tests/community-people-data.test.mjs \ + tests/content-security-contract.test.mjs \ + tests/contributing-e2e-setup.test.mjs \ + tests/contributing-just-build-parity.test.mjs \ + tests/dev-environment.test.mjs \ + tests/docs-threshold-parity.test.mjs \ + tests/e2e-docs-threshold-parity.test.mjs \ + tests/enduser-directory-copy.test.mjs \ + tests/governance-hygiene-parity.test.mjs \ + tests/root-docs-links.test.mjs \ + tests/sitemap-exclusions.test.mjs \ + tests/static-assets.test.mjs - name: Build production site run: npm run build:production diff --git a/tests/content-only-ci-workflow.test.mjs b/tests/content-only-ci-workflow.test.mjs index 11214ca9..fcc6413e 100644 --- a/tests/content-only-ci-workflow.test.mjs +++ b/tests/content-only-ci-workflow.test.mjs @@ -1,11 +1,12 @@ import assert from 'node:assert/strict'; -import { readFileSync } from 'node:fs'; +import { existsSync, readFileSync } from 'node:fs'; import { join } from 'node:path'; import test from 'node:test'; import { resolveRepoRoot } from './helpers.mjs'; import { readWorkflow } from './helpers-workflows.mjs'; +const repoRoot = resolveRepoRoot(import.meta.url); const workflow = readWorkflow('ci.yml').doc; function step(jobName, name) { @@ -49,10 +50,31 @@ test('keeps content contracts and the production build on the focused path', () workflow.jobs.validate.env.CONTENT_ONLY, /document_only == 'true'/u, ); + const contracts = step('validate', 'Check content contracts'); assert.equal( - step('validate', 'Check content contracts').if, + contracts.if, "${{ !cancelled() && env.CONTENT_ONLY == 'true' }}", ); + // The focused path must run every suite that reads an authored document, + // or a broken README link or unlisted ADR merges unnoticed (#2002). + const suites = contracts.run + .replaceAll('\\\n', ' ') + .trim() + .split(/\s+/u) + .slice(2); + for (const required of [ + 'tests/docs-contract.test.mjs', + 'tests/markdown-references.test.mjs', + 'tests/adr-contract.test.mjs', + 'tests/blog-frontmatter.test.mjs', + 'tests/root-docs-links.test.mjs', + 'tests/static-assets.test.mjs', + ]) { + assert.ok(suites.includes(required), `focused path omits ${required}`); + } + for (const suite of suites) { + assert.ok(existsSync(join(repoRoot, suite)), `${suite} does not exist`); + } assert.equal( step('validate', 'Build production site').run, 'npm run build:production', From 8305903970d6ed90cbe07cfb26c79829af9a6093 Mon Sep 17 00:00:00 2001 From: mrbobbytables Date: Fri, 30 Oct 2026 06:25:42 -0500 Subject: [PATCH 2/2] test: state the focused-path gap in prose rather than by issue number Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: mrbobbytables --- tests/content-only-ci-workflow.test.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/content-only-ci-workflow.test.mjs b/tests/content-only-ci-workflow.test.mjs index fcc6413e..56c384c2 100644 --- a/tests/content-only-ci-workflow.test.mjs +++ b/tests/content-only-ci-workflow.test.mjs @@ -56,7 +56,7 @@ test('keeps content contracts and the production build on the focused path', () "${{ !cancelled() && env.CONTENT_ONLY == 'true' }}", ); // The focused path must run every suite that reads an authored document, - // or a broken README link or unlisted ADR merges unnoticed (#2002). + // or a broken README link or unlisted ADR merges unnoticed. const suites = contracts.run .replaceAll('\\\n', ' ') .trim()