Skip to content

test: cover reference-style cross-plugin link rewriting in e2e suite - #434

Merged
nate-double-u merged 2 commits into
mainfrom
quality/test-e2e-reference-link-rewrite
Nov 20, 2026
Merged

nate-double-u merged 2 commits into
mainfrom
quality/test-e2e-reference-link-rewrite

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

e2e/linkRewrite.test.mjs asserts cross-plugin .md link rewriting only
via an inline link (analyses/2024/keda/analysis.md's
[criteria](../../docs/analysis/criteria.md), a link mdast node).
lib/remarkRewriteLinks/index.ts's remark plugin also visits
definition nodes, which resolve reference-style links ([criteria]
via a separate [criteria]: ../../docs/analysis/criteria.md line, as
used in analyses/2024/litmuschaos/analysis.md). That branch was
unit-tested in isolation (lib/remarkRewriteLinks/index.test.mts) but
never asserted against the real docusaurus build output, so a
regression confined to the definition visitor would have passed the
full e2e suite silently.

This PR adds one assertion against the litmuschaos page's rendered href,
alongside the existing keda assertion. Verified the gap and the fix: with
definition temporarily dropped from the plugin's node-type list, every
pre-existing e2e assertion still passed and only the new one failed;
restoring the plugin makes the full suite (npm run test:e2e) and
coverage gate (npm run test:coverage, 100/100/100/100) pass again.

Related Issue

Fixes #433


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

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

e2e/linkRewrite.test.mjs asserted cross-plugin .md rewriting only via an
inline link (keda/analysis.md), which exercises the remark plugin's
link-node visitor. Reference-style links ([text][ref] resolved through a
separate [ref]: url definition, as litmuschaos/analysis.md uses) are
resolved via a separate definition-node visitor and were unit-tested in
isolation but never asserted against a real build, so a regression
confined to that branch would have passed the full e2e suite.

Verified by temporarily dropping 'definition' from the plugin's visit()
node-type list: every existing e2e assertion still passed, and only the
new assertion failed.

Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Co-authored-by: clubanderson <407614+clubanderson@users.noreply.github.com>
@hivecommons-hive hivecommons-hive Bot added the ready-for-review Hive's work is done; a maintainer reviews, then removes this label to let it merge. label Nov 20, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Important

Ready for review: held for a maintainer 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.

The hive's work on this PR is done. Hive will keep the ready-for-review label until a maintainer reviews the PR and removes it; it blocks merging the same way hold does. 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 20, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cncf-techdocs ready!

Name Link
🔨 Latest commit c6a9565
🔍 Latest deploy log https://app.netlify.com/projects/cncf-techdocs/deploys/6b0070665ca6e2595e13b9bd
😎 Deploy Preview https://deploy-preview-434--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 plugin and the tree, not just the diff - this looks correct to me.

  • lib/remarkRewriteLinks/index.ts:141 visits ['link', 'image', 'definition'], and analyses/2024/litmuschaos/analysis.md:715 really does carry the reference-style definition [criteria]: ../../docs/analysis/criteria.md, used via [criteria] references - so this assertion exercises the definition branch against a real build, which the existing keda assertion (inline link node, e2e/linkRewrite.test.mjs:48-51) does not.
  • The expected rewrite is right: ../../docs/analysis/criteria.md matches CROSS_PLUGIN_RE, gets mapped site-absolute, .md stripped, trailing / appended -> /docs/analysis/criteria/.
  • The output path analyses/2024/litmuschaos/analysis/index.html follows the same route shape as the adjacent keda assertion.

The claimed verification method (temporarily dropping definition from the visitor list and watching only the new assertion fail) is exactly the right mutation test for this gap. One-file, 18-line, test-only addition; no concerns.

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

There are no active review issues with the added reference-style cross-plugin link rewriting coverage.

No open issues 🎉

What changed in this PR

Adds end-to-end coverage for reference-style cross-plugin link rewriting, addressing #433 without changing production code.

Changes:

  • Checks that the built litmuschaos analysis page links to /docs/analysis/criteria/.
  • Documents how this assertion complements the existing inline-link test by exercising the remark plugin’s definition visitor.
File Description
e2e/​linkRewrite.test.mjs Adds a reference-style link assertion against real build output and explains its coverage purpose.

Review effort: Balanced

@nate-double-u
nate-double-u merged commit eed8181 into main Nov 20, 2026
9 checks passed
@nate-double-u
nate-double-u deleted the quality/test-e2e-reference-link-rewrite branch November 20, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review Hive's work is done; a maintainer reviews, then removes this label to let it merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] e2e link-rewrite suite never asserted reference-style cross-plugin link rewriting

2 participants