Repository navigation
test: pin the broken-markdown-link policy docs-contract.test.mjs depends on - #1337
Merged
Merged
Conversation
tests/site-config.test.mjs pins onBrokenLinks: 'throw', which is the route checker. Relative links between markdown files are a different checker with a separate setting, and nothing in the suite reads it. tests/docs-contract.test.mjs states the dependency in prose -- "relative links in docs/ must point at files that exist; onBrokenMarkdownLinks is 'warn', so the site build will not catch these" -- and asserts the docs/ half of the rule. Nothing fails when the setting that comment describes changes underneath it: editing docusaurus.config.js from 'warn' to 'ignore' stops the build reporting broken relative markdown links while every check stays green, and check:links only walks root-level *.md. Resolution is pinned rather than the literal, because Docusaurus 3.10.2 accepts the setting under two spellings and rewrites one into the other. Running the real config through the installed validateConfig() pins what the build does and keeps doing so across the migration tracked on #1307, which this lane cannot land: DEPRECATED_ROOT_SPELLING is a retiring baseline in the style of KNOWN_UNBOUNDED_JOBS, and its staleness test fails once the config migrates. Verified non-vacuously at fb75c1a: with the config set to 'ignore' the policy guard goes red; with it migrated to markdown.hooks.onBrokenMarkdownLinks the baseline tests go red as designed. npm run test:unit:coverage:check exits 0. Closes #1336 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: quality <quality@hive.kubestellar.io>
Contributor
Author
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the Hive will keep the |
This was referenced Oct 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test Improvement
Adds
tests/site-config-broken-markdown-links.test.mjs, pinning the policythe site build applies to broken relative links between markdown files.
tests/site-config.test.mjs:193pinsonBrokenLinks: 'throw', which is theroute checker — it fires for a link whose resolved URL is not a page the
site builds. Markdown-to-markdown links are a different checker with a
separate setting, and nothing in the suite reads it.
tests/docs-contract.test.mjs:67already states the dependency in prose —"relative links in docs/ must point at files that exist; onBrokenMarkdownLinks
is 'warn', so the site build will not catch these" — and asserts the
docs/half of the rule, which is the right call. The missing half is that nothing
fails when the setting that comment describes changes underneath it. Editing
docusaurus.config.js:146from'warn'to'ignore'is a one-token changethat stops the build reporting broken relative markdown links altogether while
every check stays green;
check:links(_check:links-md) only walksroot-level
*.md, so it does not coverdocs/orblog/either.What it asserts
Resolution, not the literal. Docusaurus 3.10.2 accepts the setting under two
spellings and rewrites one into the other
(
@docusaurus/core/lib/server/configValidation.js:456-462), so reading thefile would pin a spelling rather than a policy and would go quiet the moment
the config migrated. The tests run the real config through the installed
validateConfig()instead:warnorthrow, neverignoreDEPRECATED_ROOT_SPELLINGfollows the retiring-baseline convention ofKNOWN_UNBOUNDED_JOBSintests/ci-supply-chain.test.mjsNo production code changes. The new file is a
tests/*.test.mjs, so it isneither a
srcnor a harness file fortests/tools/coverage-report.mjsanddoes not move either coverage gate.
Verification
Run at
main(fb75c1a):npm run test:unit:coverage:check— exits0npx prettier --checkon the new file — cleandocusaurus.config.jsset to'ignore', assertion 1 goes red; with it migrated tomarkdown.hooks.onBrokenMarkdownLinks, assertions 2–4 go red exactly as the baseline is designed toScope
Disjoint from the open hold-gated PRs: #1334 (
scripts/lib/mdx-active-content.mjs,CONTENT-SECURITY.md), #1330 (tests/e2e/**DirectoryFreshness fixtures), #1332 (tests/ci-playwright-trace-evidence.test.mjs). This PR adds one new file and edits none.Related Issue
Closes #1336
The companion finding —
docusaurus.config.jsdeclaring the rootonBrokenMarkdownLinksthat Docusaurus v4 removes, whilefuture: { v4: true }is already set — is recorded on #1307 with the exact replacement text. It is a
production-config edit, so this lane cannot land it; when it does land, test 4
here goes red by design and its failure message says exactly what to delete.
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88