Skip to content

Use ecosystem-aware version comparison for latest version detection#5993

Merged
nscuro merged 1 commit intoDependencyTrack:masterfrom
nscuro:ecosystem-aware-latest-version-detection
Apr 2, 2026
Merged

Use ecosystem-aware version comparison for latest version detection#5993
nscuro merged 1 commit intoDependencyTrack:masterfrom
nscuro:ecosystem-aware-latest-version-detection

Conversation

@nscuro
Copy link
Copy Markdown
Member

@nscuro nscuro commented Apr 2, 2026

Description

Uses ecosystem-aware version comparison for latest version detection.

This was missed when originally introducing versatile. Both the Composer and NuGet meta analyzer rely on manual version comparison to determine the latest component version. Both used ComparableVersion before, which is a class from Maven, and thus can only apply Maven-specific semantics.

Addressed Issue

N/A

Additional Details

N/A

Checklist

  • I have read and understand the contributing guidelines
  • This PR fixes a defect, and I have provided tests to verify that the fix is effective
  • This PR implements an enhancement, and I have provided tests to verify that it works as intended
  • This PR introduces changes to the database model, and I have added corresponding update logic
  • This PR introduces new or alters existing behavior, and I have updated the documentation accordingly

Copilot AI review requested due to automatic review settings April 2, 2026 10:23
@nscuro nscuro added defect Something isn't working backport/4.14.1 PRs to be backported to v4.14.1 labels Apr 2, 2026
@owasp-dt-bot
Copy link
Copy Markdown

owasp-dt-bot commented Apr 2, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@codacy-production
Copy link
Copy Markdown

codacy-production bot commented Apr 2, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 5 complexity · 0 duplication

Metric Results
Complexity 5
Duplication 0

View in Codacy

🟢 Coverage 70.59% diff coverage · -0.05% coverage variation

Metric Results
Coverage variation -0.05% coverage variation (-1.00%)
Diff coverage 70.59% diff coverage (70.00%)

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (d3ff4c1) 24774 20111 81.18%
Head commit (d89365f) 24793 (+19) 20115 (+4) 81.13% (-0.05%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#5993) 51 36 70.59%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

TIP This summary will be updated as you push new changes. Give us feedback

Copy link
Copy Markdown
Contributor

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

Updates repository meta analyzers to use ecosystem-aware version parsing/comparison (via Versatile) instead of Maven’s ComparableVersion, improving correctness for NuGet and Composer latest-version detection.

Changes:

  • Replace ComparableVersion with Versatile VersionFactory using SCHEME_NUGET and SCHEME_COMPOSER.
  • Use Versatile stability detection (isStable()) to filter pre-release/dev versions during latest-version selection.
  • Minor formatting/Javadoc touch-ups in the analyzers.

Reviewed changes

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

File Description
src/main/java/org/dependencytrack/tasks/repositories/NugetMetaAnalyzer.java Switch NuGet page/leaf version comparisons to Versatile; adjust pre-release detection; minor Javadoc tweaks.
src/main/java/org/dependencytrack/tasks/repositories/ComposerMetaAnalyzer.java Switch Composer version comparisons to Versatile; filter to stable versions; minor formatting tweaks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nscuro nscuro force-pushed the ecosystem-aware-latest-version-detection branch from a65fb4e to ea1e672 Compare April 2, 2026 15:18
@nscuro nscuro requested a review from Copilot April 2, 2026 15:59
Copy link
Copy Markdown
Contributor

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

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nscuro nscuro force-pushed the ecosystem-aware-latest-version-detection branch from ea1e672 to 93adf34 Compare April 2, 2026 16:28
@nscuro nscuro requested a review from Copilot April 2, 2026 16:58
Copy link
Copy Markdown
Contributor

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

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

This was missed when originally introducing versatile. Both the Composer and NuGet meta analyzer rely on manual version comparison to determine the latest component version. Both used ComparableVersion before, which is a class from Maven, and thus can only apply Maven-specific semantics.

Signed-off-by: nscuro <[email protected]>
@nscuro nscuro force-pushed the ecosystem-aware-latest-version-detection branch from 93adf34 to d89365f Compare April 2, 2026 17:20
@nscuro nscuro merged commit 4bea950 into DependencyTrack:master Apr 2, 2026
11 checks passed
@nscuro nscuro deleted the ecosystem-aware-latest-version-detection branch April 2, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/4.14.1 PRs to be backported to v4.14.1 defect Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants