Skip to content

URL-encode coordinate segments in reproducible-central report URLs - #256

Merged
hboutemy merged 3 commits into
masterfrom
fix-249
Oct 17, 2026
Merged

hboutemy merged 3 commits into
masterfrom
fix-249

Conversation

@elharo

@elharo elharo commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Fixes #249

renderReproducibleCentralArtifact() interpolated groupId, artifactId and version straight from the POM into the Reproducible Central badge and link URLs. Coordinates are arbitrary user input for third-party projects, and characters such as &, ?, #, " or / produced a broken/misleading badge as well as potentially malformed/foreign HTML in the generated site report.

This change URL-encodes each coordinate segment (UTF-8) when building both URLs:

  • badge: https://img.shields.io/reproducible-central/artifact/{groupId}/{artifactId}/{version}?labelColor=1e5b96
  • link: https://jvm-repo-rebuild.github.io/reproducible-central/badge/artifact/{groupId path}/{artifactId}.html

The group-id path still maps dots to / after encoding.

Test

Added ReproducibleCentralReportTest with unit tests asserting that special characters in coordinates are percentage-encoded in the generated URLs. The tests were verified to fail on the unpatched code and pass with the fix.

All 4 unit tests pass; checkstyle, spotless and RAT are clean.

@elharo
elharo marked this pull request as draft September 19, 2026 13:22
@elharo
elharo marked this pull request as ready for review September 26, 2026 13:38
@elharo
elharo requested review from slachiewicz and a lite review from Copilot September 26, 2026 13:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Spaces are form-encoded as + in URL path segments; use URI-component encoding and add space coverage.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Updates Reproducible Central report URLs to safely encode Maven coordinates.

Changes:

  • Added UTF-8 URL encoding for badge and artifact links.
  • Added tests for special-character coordinates.
File Description
src/​test/​java/​org/​apache/​maven/​plugins/​artifact/​buildinfo/​ReproducibleCentralReportTest.java Tests coordinate URL encoding.
src/​main/​java/​org/​apache/​maven/​plugins/​artifact/​buildinfo/​ReproducibleCentralReport.java Builds encoded report URLs.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

elharo and others added 3 commits October 18, 2026 00:45
Render POM coordinates into the Reproducible Central artifact badge and
link URLs with each segment URL-encoded, so characters such as &, ?, #,
" and / in groupId, artifactId or version cannot break the badge image
or inject foreign HTML into the generated site report.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@hboutemy hboutemy added the bug Something isn't working label Oct 17, 2026
@hboutemy
hboutemy merged commit b804778 into master Oct 17, 2026
21 checks passed
@hboutemy
hboutemy deleted the fix-249 branch October 17, 2026 23:05
@github-actions github-actions Bot added this to the 3.7.1 milestone Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

reproducible-central report: artifact coordinates not URL-encoded in badge URL

4 participants