Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ruby style requirements as gradle requirements #11764

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jonabc
Copy link
Member

@jonabc jonabc commented Mar 8, 2025

What are you trying to accomplish?

NOTE: Support ruby-style version requirements that are created from
PR ignore conditions

This change addresses the comment found in both gradle and maven requirement types

A requirement like > 1.2.3+0.1.1 can be provided as part of an ignore condition from a chat command like @dependabot ignore. The string contains a dynamic version and without this change will end up being translated to ~> > 1.2.3+0.1.1 with dual operators making it an invalid requirement.

If a caller has already provided an operator as part of the requirement, it seems like we should be respecting that and not overwriting it. The java version classes seems to work fine with comparisons between dynamic versions.

Anything you want to highlight for special attention from reviewers?

Is there any case where a dynamic requirement string could be used with a non-gradle requirement or version class? If Gradle's requirement class ever passes off the requirement as a string to Gem::Version for example, this change would be incorrect.

How will you know you've accomplished your goal?

@dependabot ignore works on a gradle or maven dependency with a dynamic version

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 8, 2025 01:07
@github-actions github-actions bot added L: java:gradle Maven packages via Gradle L: java:maven Maven packages via Maven labels Mar 8, 2025
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.

1 participant