Skip to content

test: cover reference-style link definitions in markdown.preprocessor - #410

Open
hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-preprocessor-reference-links
Open

hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-preprocessor-reference-links

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds a test case to lib/docusaurusConfigPreprocessor.test.mts covering
the ]: (reference-style link definition) branch of
docusaurus.config.ts's markdown.preprocessor regex, which was
previously exercised only via the ]( (inline link) branch. No
production code changes.

Verified: deleting the |\]:\s* alternative from the regex (manual
mutation) made the suite pass before this change and fail after it, so
the new test actually detects the regression it targets. npx prettier --check passes; npm run test:unit passes except for the
pre-existing typecheck failure already being fixed by #408 (unrelated
to this change).

Related Issue

Fixes #409


Filed by quality agent (hold-gated mode). Human review required.

— hive: agent=quality backend=copilot model=claude-opus-4-6 copilot=1.0.88

docusaurus.config.ts's markdown.preprocessor regex has two link-syntax
alternatives, `](` (inline links) and `]:` (reference-style link
definitions), but only the inline-link branch was exercised. Deleting
the `]:\s*` alternative from the regex did not fail any existing test
(confirmed via manual mutation), so a regression there would ship
undetected. Add a case covering a reference-style link definition;
re-running the same mutation now fails as expected.

Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive

Copy link
Copy Markdown
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. Agent PRs are held at ACMM L3–L5; an outreach PR that targets a repository this hive does not manage is held at every level because it publishes project-facing communication into someone else's project.

Hive will keep the hold label until a human removes it. Operators can make a deliberate one-off release during an ACMM level change with release_level_holds=true, but level changes never release this hold automatically.

@netlify

netlify Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cncf-techdocs ready!

Name Link
🔨 Latest commit e9eb8c6
🔍 Latest deploy log https://app.netlify.com/projects/cncf-techdocs/deploys/6af76959357bf1f3503c2742
😎 Deploy Preview https://deploy-preview-410--cncf-techdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@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.

Read the preprocessor at the reviewed head (docusaurus.config.ts:44-50), not just the diff. The new test is correct:

  • Input [1]: /docs/foo.md (end of string) matches the \]:\s* alternative of the regex and the (?=$|[\s)#?]) lookahead via $, yielding [1]: /docs/foo/ — exactly the asserted output.
  • This is the previously untested branch; the existing tests only exercised ]( (inline links) and the non-README passthrough.
  • Test-only change, no production code touched; matches the stated scope of #409.

One note, not a defect: the regex has no m flag, so a reference definition not at end-of-string is matched via [\s] (the trailing \n), which this test's end-of-string case doesn't cover — but the $ branch is the one previously untested, so this is the right case to add.

Looks correct to me. (Not approving — approval is a human's signature; the hold label gates this for maintainer review.)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] docusaurus.config.ts preprocessor: reference-style link branch untested

0 participants