Skip to content

Fall back to generic versioning scheme if no PURL is available#5714

Merged
nscuro merged 1 commit intoDependencyTrack:masterfrom
nscuro:issue-5712
Jan 19, 2026
Merged

Fall back to generic versioning scheme if no PURL is available#5714
nscuro merged 1 commit intoDependencyTrack:masterfrom
nscuro:issue-5712

Conversation

@nscuro
Copy link
Copy Markdown
Member

@nscuro nscuro commented Jan 19, 2026

Description

Falls back to generic versioning scheme if no PURL is available.

Addressed Issue

Fixes #5712

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

@nscuro nscuro added this to the 4.14.0 milestone Jan 19, 2026
Copilot AI review requested due to automatic review settings January 19, 2026 17:16
@nscuro nscuro added the defect Something isn't working label Jan 19, 2026
@owasp-dt-bot
Copy link
Copy Markdown

owasp-dt-bot commented Jan 19, 2026

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

Status Scanner 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.

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

This pull request addresses issue #5712 by implementing a fallback to the generic versioning scheme when no PURL (Package URL) is available for a component or vulnerable software entry. This prevents failures when version comparisons are needed but PURL information is missing.

Changes:

  • Refactored version scheme determination in VersionPolicyEvaluator to use Optional-based approach with fallback to generic scheme
  • Modified VulnerableSoftware to always create a Vers object with generic scheme fallback instead of returning null
  • Upgraded versatile library from 0.15.0 to 0.16.0 to leverage new versioning scheme APIs

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/main/java/org/dependencytrack/policy/VersionPolicyEvaluator.java Refactored scheme determination to use KnownVersioningSchemes.fromPurl() with fallback to SCHEME_GENERIC
src/main/java/org/dependencytrack/model/VulnerableSoftware.java Changed buildVersFromFields() to always return a Vers object using KnownVersioningSchemes.fromPurlType() with generic fallback, plus whitespace cleanup
pom.xml Upgraded versatile library dependency from version 0.15.0 to 0.16.0

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

@nscuro
Copy link
Copy Markdown
Member Author

nscuro commented Jan 19, 2026

Test failures are unrelated, caused by connectivity issues with GitHub.

@nscuro nscuro merged commit 0c21ab9 into DependencyTrack:master Jan 19, 2026
8 of 9 checks passed
@nscuro nscuro deleted the issue-5712 branch January 19, 2026 18:15
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

defect Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vulnerability not found after changes to AbstractVulnerableSoftwareAnalysisTask

3 participants