Skip to content
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

Added feature to NugetMetaAnalyzer to exclude pre-release versions. #3468

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

brentos99
Copy link

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

  • 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

Signed-off-by: Brent <brent.england@sunshinecoast.qld.gov.au>
Signed-off-by: Brent <brent.england@sunshinecoast.qld.gov.au>
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.01% (target: -1.00%) 100.00% (target: 70.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (502a768) 21360 15775 73.85%
Head commit (72b6131) 21367 (+7) 15782 (+7) 73.86% (+0.01%)

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 (#3468) 12 12 100.00%

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%

See your quality gate settings    Change summary preferences

You may notice some variations in coverage metrics with the latest Coverage engine update. For more details, visit the documentation

@Doxoh
Copy link

Doxoh commented May 27, 2024

@sebD how is the state for this pull-request. Is it possible to merge? :)

Kind Regards
Till

@Doxoh
Copy link

Doxoh commented May 27, 2024

//cc @nscuro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove nuget pre-release packages from being returned.
4 participants