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

Switch to the Semver4j fork #6154

Merged
merged 1 commit into from
Jan 5, 2023
Merged

Switch to the Semver4j fork #6154

merged 1 commit into from
Jan 5, 2023

Conversation

sschuberth
Copy link
Member

Please have a look at the individual commit messages for the details.

@sschuberth sschuberth force-pushed the semver4j-fork branch 3 times, most recently from ee57875 to 404ac51 Compare December 2, 2022 19:39
@sschuberth sschuberth force-pushed the semver4j-fork branch 2 times, most recently from 96a4f67 to ca6f534 Compare December 7, 2022 17:12
@sschuberth sschuberth force-pushed the semver4j-fork branch 3 times, most recently from be394c2 to f86ceb9 Compare December 7, 2022 20:45
@sschuberth sschuberth force-pushed the semver4j-fork branch 2 times, most recently from 0f61618 to cff197b Compare January 4, 2023 17:38
@sschuberth sschuberth changed the title Test the Semver4j fork Switch to the Semver4j fork Jan 4, 2023
@sschuberth sschuberth marked this pull request as ready for review January 4, 2023 18:58
@sschuberth sschuberth requested a review from a team as a code owner January 4, 2023 18:58
The new semver4j GitHub organization contains a maintained fork / copy
[1] of the original semver4j library by @vdurmont [2]. However, the API
changed quite significantly. Catch up with those changes in order to
(partly) fix issue #6153.

[1]: https://github.com/semver4j/semver4j
[2]: https://github.com/vdurmont/semver4j

Signed-off-by: Sebastian Schuberth <[email protected]>
@sschuberth sschuberth requested review from MarcelBochtler and a team January 5, 2023 10:16
analyzer/src/main/kotlin/managers/Npm.kt Show resolved Hide resolved
Comment on lines -123 to +125
it == CommandLineTool.ANY_VERSION || it.isSatisfiedBy(actualVersion)
Semver.coerce(actualVersion).satisfies(it)
Copy link
Member

Choose a reason for hiding this comment

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

Why is the check for ANY_VERSION dropped?

Copy link
Member Author

@sschuberth sschuberth Jan 5, 2023

Choose a reason for hiding this comment

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

ANY_VERSION was introduced here in d8c65c3 to work around a limitation of the original isSatisfiedBy() call which does not handle non-semantic versions, but even those should be accepted here. This is not necessary anymore with the new code as it uses coerce() before.

// '1.0' does not satisfy the version range [1.0,2.0], see
// https://github.com/vdurmont/semver4j/issues/67.
Requirement.buildIvy(id.version).isSatisfiedBy(Semver(pkgId.version, Semver.SemverType.LOOSE))
Semver.coerce(pkgId.version).satisfies(id.version)
Copy link
Member

Choose a reason for hiding this comment

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

satisfies(String) never uses coerce internally.
Isn't this required to solve the TODO above?

Copy link
Member Author

Choose a reason for hiding this comment

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

It shouldn't be necessary (anymore), see semver4j/semver4j#100. And I just manually verified that Semver.coerce("1.0").satisfies("[1.0,2.0]") == true.

@sschuberth sschuberth requested review from MarcelBochtler and a team January 5, 2023 11:04
@sschuberth sschuberth enabled auto-merge (rebase) January 5, 2023 11:04
@sschuberth sschuberth merged commit 8142cdc into main Jan 5, 2023
@sschuberth sschuberth deleted the semver4j-fork branch January 5, 2023 11:25
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.

2 participants