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

BUG: .Net pinned dependency should support Central Package Management #4252

Open
balteravishay opened this issue Jul 23, 2024 · 1 comment · May be fixed by #4369
Open

BUG: .Net pinned dependency should support Central Package Management #4252

balteravishay opened this issue Jul 23, 2024 · 1 comment · May be fixed by #4369
Labels
kind/bug Something isn't working

Comments

@balteravishay
Copy link
Contributor

Describe the bug
In the .NET ecosystem all packages that are uploaded to NuGet.org are digitally signed with a x.509 certificate, and NuGet checks the validity of these signatures (and their certificate lineage) as part of the NuGet Restore action.

The current implementation of .Net pinned dependency only checks for using lock file mechanism, but instead it should check if either a lock file mechanism is used as implemented and described here, OR if the Central Package Management feature had been enabled together with pinning to specific versions of dependencies.

Reproduction steps
Steps to reproduce the behavior:

  1. The pinned dependency check for .net repositories should return the dependencies as pinned in cases where CPM feature is enabled and the versions of dependencies are pinned to specific versions.
  2. for example: go run main.go --repo Noggog/CSharpExt --checks Pinned-Dependencies --format json --show-details | jq

Expected behavior
.net repositories can pin dependencies with an exact version by using Central Package Management or utilize lock files.
for the example above (Noggog/CSharpExt), it is expected that 2 out of 2 nugetCommand dependencies will be pinned.

@balteravishay balteravishay added the kind/bug Something isn't working label Jul 23, 2024
@Apetree100122
Copy link

this overrides

<PropertyGroup> 
<ManagePackageVersionsCentrally>false
</ManagePackageVersionsCentrally>
</PropertyGroup>

this enables

<Project>
  <PropertyGroup>
    <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
  </PropertyGroup>
  <ItemGroup>
    <PackageVersion Include="Newtonsoft.Json" Version="13.0.1" />
  </ItemGroup>
</Project>
```

## 
< There are 3 package sources defined in 
<your configuration. When using central package management,
< please map your package sources with  package source mapping
< (https://aka.ms/nuget-package-source-mapping)  or specify a single package source.

@balteravishay balteravishay linked a pull request Oct 6, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants