Fall back to generic versioning scheme if no PURL is available#5714
Merged
nscuro merged 1 commit intoDependencyTrack:masterfrom Jan 19, 2026
Merged
Fall back to generic versioning scheme if no PURL is available#5714nscuro merged 1 commit intoDependencyTrack:masterfrom
nscuro merged 1 commit intoDependencyTrack:masterfrom
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Contributor
There was a problem hiding this comment.
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.
src/main/java/org/dependencytrack/model/VulnerableSoftware.java
Outdated
Show resolved
Hide resolved
Signed-off-by: nscuro <[email protected]>
Member
Author
|
Test failures are unrelated, caused by connectivity issues with GitHub. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Falls back to
genericversioning scheme if no PURL is available.Addressed Issue
Fixes #5712
Additional Details
N/A
Checklist
This PR implements an enhancement, and I have provided tests to verify that it works as intendedThis PR introduces changes to the database model, and I have added corresponding update logicThis PR introduces new or alters existing behavior, and I have updated the documentation accordingly