Skip to content

fix(maven): ignore XML comments when reading a POM - #213

Merged
adityankale190895 merged 5 commits into
DiffCI:mainfrom
FredApps:fix/maven-pom-comments
Nov 18, 2026
Merged

adityankale190895 merged 5 commits into
DiffCI:mainfrom
FredApps:fix/maven-pom-comments

Conversation

@FredApps

Copy link
Copy Markdown
Contributor

Fixes #212

parsePom now strips XML comments before reading tags. A commented-out <artifactId>, <dependency> or <sourceDirectory> no longer counts as part of the model.

Validation:

  • tests/repo/maven-pom-comments.test.ts covers a commented identity, where downstream tests are now selected, and a commented <sourceDirectory>, which no longer falls back. Both fail on main and pass here.
  • npm run typecheck, npm test (1169 pass), npm run audit:boundary.

Unsupported: CDATA sections are not handled. POM elements do not normally use them.

parsePom read tags with regular expressions over the raw XML, comments included. A commented-out <artifactId> before the real one became the module's identity, so dependent modules no longer linked to it and a change to it selected only its own tests. A commented-out <sourceDirectory> also triggered the custom source roots fallback.

Signed-off-by: FredApps <[email protected]>
Comment thread src/repo/adapters/maven.ts Fixed
CodeQL flagged the comment-stripping replace as incomplete multi-character sanitization. A single left-to-right pass removes the same comments and keeps an unterminated one, as before.

Signed-off-by: FredApps <[email protected]>

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

Cross-review of 3a66fbd and b8668ac.

Checked:

  • The fix matches #212. Comments are removed in one pass before any tag is read, so a commented-out <artifactId> or <sourceDirectory> no longer counts. An unterminated <!-- is kept as before.
  • The CodeQL "incomplete multi-character sanitization" finding on the first commit is resolved. b8668ac replaced the regex replace with the indexOf loop, and the CodeQL check passes.
  • The new test fails on main's maven.ts (0 of 2) and passes with the fix. tests/repo/maven-pom-comments.test.ts is listed in release-files.json. Commits are DCO-signed. The branch is level with main.

Fixed:

  • ec87478: added the // SPDX-License-Identifier: MIT header to the new test file.

Still open: none. CI is green on ec87478.

…ffCI#211 and DiffCI#253

The manifest is an unordered set, and the PRs listed above add their entries at the same line. Moving this entry one line away lets them merge in either order without a conflict.

Signed-off-by: FredApps <[email protected]>
FredApps added a commit to FredApps/core that referenced this pull request Nov 18, 2026
…ffCI#211 and DiffCI#213

The manifest is an unordered set, and the PRs listed above add their entries at the same line. Moving this entry one line away lets them merge in either order without a conflict.

Signed-off-by: FredApps <[email protected]>
@FredApps
FredApps marked this pull request as ready for review November 18, 2026 01:22
@adityankale190895
adityankale190895 merged commit 8f7df5c into DiffCI:main Nov 18, 2026
13 checks passed
adityankale190895 pushed a commit that referenced this pull request Nov 18, 2026
…tterns (#253)

* fix(runner-universe): resolve a leading <rootDir> in testPathIgnorePatterns

Jest replaces a leading <rootDir> in testPathIgnorePatterns with the root directory. extractTestPatterns kept the token, so a pattern such as <rootDir>/e2e/ never matched and the ignored files stayed in the test universe. A change under e2e/ could then select only those files, and the planned jest e2e/flow.test.js exits 1 with "No tests found". The token is now an anchored ^/, so the pattern does not also ignore packages/*/e2e/.

Signed-off-by: FredApps <[email protected]>

* ci: re-run flaky merge gate smoke

Signed-off-by: FredApps <[email protected]>

* chore: move the release-files.json entry so it merges cleanly with #211 and #213

The manifest is an unordered set, and the PRs listed above add their entries at the same line. Moving this entry one line away lets them merge in either order without a conflict.

Signed-off-by: FredApps <[email protected]>

---------

Signed-off-by: FredApps <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Maven: elements inside XML comments are read as part of the POM

3 participants