Skip to content

Add CI check for Markdown syntax issues - #1737

Merged
elharo merged 11 commits into
masterfrom
test-release-notes-markdown-20261023
Nov 4, 2026
Merged

elharo merged 11 commits into
masterfrom
test-release-notes-markdown-20261023

Conversation

@elharo

@elharo elharo commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Add a test that validates markdown syntax

The test scans all Markdown docs under content/markdown (*.md and *.md.vm) and fails with file:line details. It runs as part of the existing mvn verify build in the Verify Site workflow.

Fix existing unescaped occurrences in release notes (rc-4 through rc-7) so CI passes.

@elharo
elharo requested a balanced review from Copilot October 23, 2026 16:42

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

Is the test actually running? Do we need to add it to the CI config?

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

4 open issues
What changed in this PR

Adds a CI-enforced validation to ensure JIRA issue keys used as Markdown link labels have escaped brackets (e.g., [\[MNG-1234\]](URL)), preventing broken links in generated docs.

Changes:

  • Add a JUnit test that scans Markdown docs for unescaped [[KEY]](URL) link labels and reports file:line violations.
  • Add JUnit Jupiter as a test dependency.
  • Update existing release notes (rc-4 through rc-7) to use escaped-bracket link labels.
File Description
src/​test/​java/​org/​apache/​maven/​site/​MarkdownDocsTest.java Introduces the docs-scanning CI test and violation reporting.
pom.xml Adds JUnit Jupiter dependency needed to run the new test.
content/​markdown/​docs/​4.0.0-rc-7/​release-notes.md Escapes issue-key link labels to satisfy the new validation.
content/​markdown/​docs/​4.0.0-rc-6/​release-notes.md Escapes issue-key link labels to satisfy the new validation.
content/​markdown/​docs/​4.0.0-rc-5/​release-notes.md Fixes/normalizes issue-key links to escaped form for the new validation.
content/​markdown/​docs/​4.0.0-rc-4/​release-notes.md Escapes issue-key link labels to satisfy the new validation.

Review effort: Lite

Comment thread pom.xml Resolved
elharo and others added 2 commits October 23, 2026 17:02
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@elharo

elharo commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the review comments in 47bdbe2:

  • The test now parses documents with flexmark (the parser behind Doxia Markdown) and detects any [[...]](...) link syntax, rather than matching JIRA keys with a regex.
  • IOException is propagated so a file read failure fails the test directly.
  • Files are read as UTF-8, and fenced code blocks are skipped by the parser.

The test runs as part of mvn verify in the existing Verify Site workflow (verify-site.yml), so no CI workflow change is needed.

@elharo

elharo commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

The test already runs in the Verify Site workflow. The workflow invokes ./mvnw ... verify site, and Surefire executes the test during verify. The latest run for e1015de4 shows:

[INFO] Running org.apache.maven.site.MarkdownDocsTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

See https://github.com/apache/maven-site/actions/runs/40420110047. The required Verify and build Maven Site check therefore covers this test; no workflow change is needed.

@elharo
elharo marked this pull request as ready for review October 27, 2026 12:11
@slachiewicz slachiewicz added the build Pull requests that change the build process label Oct 29, 2026
@elharo elharo changed the title Add CI check for escaped issue links in Markdown docs Add CI check for Markdown syntax issues Nov 2, 2026
@elharo
elharo merged commit aec5cd7 into master Nov 4, 2026
4 checks passed
@elharo
elharo deleted the test-release-notes-markdown-20261023 branch November 4, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Pull requests that change the build process

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants