Skip to content

Update maven version pattern for new parser - #11767

Merged
kbukum1 merged 4 commits into
mainfrom
jonabc/update-maven-version-pattern-for-new-parser
Mar 12, 2025
Merged

Update maven version pattern for new parser#11767
kbukum1 merged 4 commits into
mainfrom
jonabc/update-maven-version-pattern-for-new-parser

Conversation

@jonabc

@jonabc jonabc commented Mar 9, 2025

Copy link
Copy Markdown
Member

What are you trying to accomplish?

The maven version parser was recently broadened to support a newer version format, however the Dependabot::Maven::Version::VERSION_PATTERN was not updated to match. I'm updating the pattern to be more flexible in order to match the new version parsers behavior.

Anything you want to highlight for special attention from reviewers?

This branch and PR are based on #11764 because the added requirement test case uses a dynamic version, and the only way I could find to keep the full version string intact is using a predefined ruby-style requirement string which needs the linked PR to work.

I think this change should be safe. I looked at maven's ComparableVersion, which specifies unlimited number of version components as a feature. The Dependabot::Maven::VersionParser implementation also looks to allow any number of version parts. All of that together means that the regex pattern can be simplified to look for any number of trailing version parts.

How will you know you've accomplished your goal?

@dependabot ignore this version should work with for a maven dependency version like 25-ea+5.a0

Checklist

  • I have run the complete test suite to ensure all tests and linters pass.
  • I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
  • I have written clear and descriptive commit messages.
  • I have provided a detailed description of the changes in the pull request, including the problem it addresses, how it fixes the problem, and any relevant details about the implementation.
  • I have ensured that the code is well-documented and easy to understand.

jonabc added 2 commits March 7, 2025 17:50
a requirement like `> 1.2.3+0.1.1` can be provided as part of an ignore condition
a requirement like `> 1.2.3+0.1.1` can be provided as part of an ignore condition
@jonabc
jonabc requested a review from a team as a code owner March 9, 2025 05:28
@github-actions github-actions Bot added L: java:gradle Maven packages via Gradle L: java:maven Maven packages via Maven labels Mar 9, 2025
The maven version parser was broadened in #10704,
however VERSION_PATTERN was not updated to match.
Looking at the version parser and the details of maven's
ComparableVersion https://maven.apache.org/ref/3.5.2/maven-artifact/apidocs/org/apache/maven/artifact/versioning/ComparableVersion.html,
it looks like "unlimited number of version components" means
that the regex pattern can be simplified.
@jonabc
jonabc force-pushed the jonabc/update-maven-version-pattern-for-new-parser branch from 2aa8372 to 515970a Compare March 9, 2025 05:33
honeyankit
honeyankit previously approved these changes Mar 10, 2025
kbukum1
kbukum1 previously approved these changes Mar 12, 2025

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

LGTM

@kbukum1

kbukum1 commented Mar 12, 2025

Copy link
Copy Markdown
Contributor

Will be deployed after #11764 is deployed.

Base automatically changed from jonabc/gradle-support-ruby-requirement-ops to main March 12, 2025 19:17
@kbukum1
kbukum1 dismissed stale reviews from honeyankit and themself March 12, 2025 19:17

The base branch was changed.

@kbukum1

kbukum1 commented Mar 12, 2025

Copy link
Copy Markdown
Contributor

Going to deploy after conflict is fixed.

@kbukum1
kbukum1 merged commit ceb84cd into main Mar 12, 2025
@kbukum1
kbukum1 deleted the jonabc/update-maven-version-pattern-for-new-parser branch March 12, 2025 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L: java:gradle Maven packages via Gradle L: java:maven Maven packages via Maven

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants