-
-
Notifications
You must be signed in to change notification settings - Fork 597
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
Exclude pre-releases from NuGet latest version check #3468
Conversation
Signed-off-by: Brent <[email protected]>
src/main/java/org/dependencytrack/tasks/repositories/NugetMetaAnalyzer.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Brent <[email protected]>
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesYou may notice some variations in coverage metrics with the latest Coverage engine update. For more details, visit the documentation |
@sebD how is the state for this pull-request. Is it possible to merge? :) Kind Regards |
//cc @nscuro |
It would be quite useful if this was merged as we have the same issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Is there something more I need to do on this pull request or some process I have not followed. I'm new to this, and not sure if this is standard timeframe or you are waiting on something. |
src/main/java/org/dependencytrack/tasks/repositories/NugetMetaAnalyzer.java
Outdated
Show resolved
Hide resolved
What about this pull request, whats the state? Kind Regards |
Based on the feedback, the pr doesn't work with the way the data is stored in the database. Their can only be one latest version of a package and this pr was to dynamically return different versions depending on if the version testing against is a prerelease or not. Two options could be
Alternatively further investigation on how other repositories store prerelease data is required. |
Whats the state of this PR? 4.12 is soon to be released and this has the milestone for this and there was long no development? |
Will likely un-assign from v4.12. We can still ship this with a bugfix release so that doesn't mean having to wait for it for too long. |
Hi @nscuro, Could I get some direction on this PR? The simplest approach would be to always ignore packages with a - in the version, as this aligns with NuGet's pre-release convention. According to the NuGet spec, versions with suffixes are treated as pre-release, and versions without a suffix take precedence. Would this approach be acceptable as a global solution, or do you think a more configurable option is needed? Thanks! |
src/test/java/org/dependencytrack/tasks/repositories/NugetMetaAnalyzerTest.java
Show resolved
Hide resolved
Sounds fine to me for now. |
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesCodacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more Footnotes
|
Description
This PR addressed the issue of pre-release nuget packages being returned as the latest version.
The Nuget Documentation identifies packages with a "-" in their version string as a pre-release package.
The change is to filter the list of Nuget Packages that contain an "-" when determining the latestVersion. If the component being inspected is a pre-release itself, then pre-release versions are not filtered.
Addressed Issue
fixes #3467
Additional Details
There are 2 tests in this PR (NugetMetaAnalyzerTest.java), but due to the transient nature of the Nuget packages, these tests could fail if there is a non "pre-release" as the latest nuget version of the Microsoft.Extensions.DependencyInjection package.
I would have liked to have created a mock dataset for this scenario, but I the current tests appear tied to connecting directly to the live nuget package urls.
These 2 tests have their
@Test
commented as to not break future builds.Checklist