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

Implement maven version specification #10524

Merged
merged 8 commits into from
Sep 9, 2024
Merged

Implement maven version specification #10524

merged 8 commits into from
Sep 9, 2024

Conversation

amazimbe
Copy link
Contributor

@amazimbe amazimbe commented Aug 30, 2024

What are you trying to accomplish?

Implement the maven version specification described here: https://maven.apache.org/pom.html#Version_Order_Specification.

Our current maven version implementation is not consistent with the maven specification above. In some cases, this causes versions to be compared incorrectly and inconsistently.

Fix issues related to version precedence or malformed version errors.

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.

@github-actions github-actions bot added the L: java:maven Maven packages via Maven label Aug 30, 2024
@amazimbe amazimbe self-assigned this Aug 30, 2024
@amazimbe amazimbe marked this pull request as ready for review September 4, 2024 10:07
@amazimbe amazimbe requested a review from a team as a code owner September 4, 2024 10:07
@abdulapopoola
Copy link
Member

Thanks @amazimbe , as discussed, can you add the test coverage information for before/after?

Also, what's the plan to actually start using this version code instead of the old one?

@amazimbe
Copy link
Contributor Author

amazimbe commented Sep 4, 2024

Also, what's the plan to actually start using this version code instead of the old one?

That will come in my next PR. I had a look at it briefly yesterday and some of it is just updating references from Gem::Version to Dependabot::Maven::Version. I also need to define a satified_by?(version) method on requirement.rb plus a few other things.

@amazimbe
Copy link
Contributor Author

amazimbe commented Sep 4, 2024

Thanks @amazimbe , as discussed, can you add the test coverage information for before/after?

For the current version.rb
Code coverage: 100%
Branch coverage: 88.57%

For new_version.rb
Code coverage: 100%
Branch coverage: 100%

@abdulapopoola
Copy link
Member

Thanks @amazimbe , as discussed, can you add the test coverage information for before/after?

For the current version.rb Code coverage: 100% Branch coverage: 88.57%

For new_version.rb Code coverage: 100% Branch coverage: 100%

what about the original code coverage numbers?

@amazimbe
Copy link
Contributor Author

amazimbe commented Sep 5, 2024

In this PR I'm just adding new_version.rb and that's what has 100% code and branch coverage. I didn't change maven's version.rb in this PR so the code coverage stays at 100% and branch coverage at 88.57%.

Copy link
Member

@abdulapopoola abdulapopoola left a comment

Choose a reason for hiding this comment

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

Approving pending resolution of comments and @sachin-sandhu 's review

params(
first: T::Array[T.any(String, Integer)],
second: T::Array[T.any(String, Integer)]
).returns(T.nilable(Integer))
Copy link
Member

Choose a reason for hiding this comment

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

any reason this is a nilable Integer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one is mostly because the call on line 43 is nilable. I tried to change this one but sorbet keeps complaining.

@amazimbe amazimbe merged commit d111771 into main Sep 9, 2024
119 checks passed
@amazimbe amazimbe deleted the maven-version-spec branch September 9, 2024 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: java:maven Maven packages via Maven
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants