Skip to content

Fixes #1295: getAllUpdates(boolean) should respect currentVersionRange#1297

Merged
slachiewicz merged 1 commit into
mojohaus:masterfrom
andrzejj0:issue-1296
Oct 26, 2025
Merged

Fixes #1295: getAllUpdates(boolean) should respect currentVersionRange#1297
slachiewicz merged 1 commit into
mojohaus:masterfrom
andrzejj0:issue-1296

Conversation

@andrzejj0
Copy link
Copy Markdown
Contributor

@andrzejj0 andrzejj0 commented Oct 21, 2025

Fixes this small bug.

It's currently used in DisplayDependencyUpdates, but the bug does not affect performance of the plugin whatsoever: DisplayDependencyUpdates filters all versions once again after retrieving all updates.

@slawekjaranowski because of that, I thought of maybe making all plugins just use the Resolver, or a thin wrapper on it, to retrieve all versions, and then use ArtifactVersions to filter them once they are retrieved. That will make it much more clear. Currently, there's so many of different getDependencyUpdates variants in VersionsHelper, which just make the whole architecture messy. That in a different PR.

@andrzejj0 andrzejj0 self-assigned this Oct 21, 2025
@andrzejj0 andrzejj0 added the bug label Oct 21, 2025
@andrzejj0 andrzejj0 force-pushed the issue-1296 branch 2 times, most recently from 19a34c0 to 850c8bb Compare October 21, 2025 05:25
@andrzejj0 andrzejj0 changed the title Fixes #1296: getAllUpdates(boolean) should respect currentVersionRange Fixes #1295: getAllUpdates(boolean) should respect currentVersionRange Oct 21, 2025
@andrzejj0 andrzejj0 requested a review from slachiewicz October 21, 2025 05:46
@slachiewicz slachiewicz requested a review from Copilot October 21, 2025 05:48
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug where getAllUpdates(boolean) does not properly filter versions based on the current version range when no current version is set. The fix ensures that when an artifact has a version range but no specific current version, the method correctly excludes versions within the current range and only returns versions higher than the upper bound.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
AbstractVersionDetails.java Adds filtering logic to exclude versions within the current version range when no current version is set
ArtifactVersionsTest.java Adds parameterized test to verify that getAllUpdates correctly respects version range constraints

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@slachiewicz slachiewicz merged commit 82c95c8 into mojohaus:master Oct 26, 2025
26 checks passed
@github-actions github-actions Bot added this to the 2.19.2 milestone Oct 26, 2025
@andrzejj0 andrzejj0 deleted the issue-1296 branch October 26, 2025 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AbstractVersionDetails.getAllUpdates(boolean) ignores version ranges.

3 participants