Skip to content

Enable NuGet Audit in the VMR orchestrator, normalize and update dependencies #45830

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

Merged
merged 5 commits into from
Jan 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/SourceBuild/content/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@
<!-- Don't use Arcade's ExcludeFrom* build infra in the VMR orchestrator. -->
<DisableArcadeExcludeFromBuildSupport>true</DisableArcadeExcludeFromBuildSupport>
<LangVersion>latest</LangVersion>
<!-- Explicitly set NuGetAuditModel level as it's currently disabled in the product. -->
<NuGetAuditMode>all</NuGetAuditMode>
<!-- Only upgrade NuGetAudit warnings to errors for official builds. -->
<WarningsNotAsErrors Condition="'$(OfficialBuildId)' == ''">$(WarningsNotAsErrors);NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>
</PropertyGroup>

<PropertyGroup>
Expand Down
9 changes: 7 additions & 2 deletions src/SourceBuild/content/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,20 @@
<!-- MSBuild dependencies -->
<PackageVersion Include="Microsoft.Build.Tasks.Core" Version="$(MicrosoftBuildVersion)" />
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="$(MicrosoftBuildVersion)" />
<!-- NuGet dependencies -->
<PackageVersion Include="NuGet.ProjectModel" Version="$(NuGetProjectModelVersion)" />
<PackageVersion Include="NuGet.Protocol" Version="$(NuGetProtocolVersion)" />
<!-- Runtime dependencies -->
<PackageVersion Include="Microsoft.Extensions.FileSystemGlobbing" Version="$(MicrosoftExtensionsFileSystemGlobbingVersion)" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="$(MicrosoftExtensionsLoggingConsoleVersion)" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="$(MicrosoftExtensionsLoggingVersion)" />
<!-- External dependencies -->
</ItemGroup>

<!-- External dependencies -->
<ItemGroup>
<PackageVersion Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
<PackageVersion Include="xunit.extensibility.core" Version="$(XUnitVersion)" />
<PackageVersion Include="xunit.extensibility.execution" Version="$(XUnitVersion)" />
<PackageVersion Include="NuGet.Protocol" Version="$(NuGetProtocolVersion)" />
<PackageVersion Include="Octokit" Version="$(OctokitVersion)" />
</ItemGroup>

Expand Down
4 changes: 4 additions & 0 deletions src/SourceBuild/content/NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@
<disabledPackageSources>
<clear />
</disabledPackageSources>
<auditSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</auditSources>
</configuration>
7 changes: 4 additions & 3 deletions src/SourceBuild/content/eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@
<!-- command-line-api dependencies -->
<SystemCommandLineVersion>2.0.0-beta4.24126.1</SystemCommandLineVersion>
<!-- msbuild dependencies -->
<MicrosoftBuildVersion>17.8.3</MicrosoftBuildVersion>
<MicrosoftBuildVersion>17.12.6</MicrosoftBuildVersion>
<!-- nuget dependencies -->
<NuGetProtocolVersion>6.12.1</NuGetProtocolVersion>
<NuGetProjectModelVersion>6.12.1</NuGetProjectModelVersion>
<!-- runtime dependencies -->
<MicrosoftExtensionsFileSystemGlobbingVersion>9.0.0</MicrosoftExtensionsFileSystemGlobbingVersion>
<MicrosoftExtensionsLoggingConsoleVersion>9.0.0</MicrosoftExtensionsLoggingConsoleVersion>
<MicrosoftExtensionsLoggingVersion>9.0.0</MicrosoftExtensionsLoggingVersion>
<!-- nuget dependencies -->
<NuGetProtocolVersion>6.11.0</NuGetProtocolVersion>
<!-- external dependencies -->
<NewtonsoftJsonVersion>13.0.3</NewtonsoftJsonVersion>
<OctokitVersion>10.0.0</OctokitVersion>
Expand Down
12 changes: 0 additions & 12 deletions src/SourceBuild/content/eng/tools/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,4 @@
<RestoreSources Condition="'$(DotNetBuildSourceOnly)' == 'true'">$(ReferencePackagesDir);$(PrebuiltPackagesPath);$(PrebuiltSourceBuiltPackagesPath)</RestoreSources>
</PropertyGroup>

<!--
Use some assemblies from the SDK, instead of package references. This ensures they match what's
found when the task is loaded by the SDK's MSBuild.
Reference NuGet assemblies, except a command line assembly that causes warnings such as:
MSB3277: Found conflicts between different versions of "System.Collections" that could not be resolved.
-->
<ItemGroup>
<SdkAssembly Include="$([MSBuild]::NormalizePath('$(NetCoreRoot)', 'sdk', '$(NETCoreSdkVersion)', 'Newtonsoft.Json.dll'));
$([MSBuild]::NormalizeDirectory('$(NetCoreRoot)', 'sdk', '$(NETCoreSdkVersion)'))NuGet.*.dll"
Exclude="$([MSBuild]::NormalizePath('$(NetCoreRoot)', 'sdk', '$(NETCoreSdkVersion)', 'NuGet.CommandLine.XPlat.dll'))" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,4 @@
<ProjectReference Include="../Microsoft.DotNet.UnifiedBuild.Tasks/Microsoft.DotNet.UnifiedBuild.Tasks.csproj" />
</ItemGroup>

<ItemGroup>
<ReferencePath Include="@(SdkAssembly)" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Build.Tasks.Core" ExcludeAssets="runtime" />
<PackageReference Include="Microsoft.Build.Utilities.Core" ExcludeAssets="runtime" />
<!-- IncludeAssets=compile to treat these packages as targeting-packs only. The assemblies are available in the SDK. -->
<PackageReference Include="Microsoft.Build.Tasks.Core" IncludeAssets="compile" />
<PackageReference Include="Microsoft.Build.Utilities.Core" IncludeAssets="compile" />
</ItemGroup>

<Target Name="InstallResolver" BeforeTargets="PrepareForRun">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Build.Tasks.Core" />
<PackageReference Include="Microsoft.Build.Utilities.Core" />
</ItemGroup>

<ItemGroup>
<ReferencePath Include="@(SdkAssembly)" />
<!-- IncludeAssets=compile to treat these packages as targeting-packs only. The assemblies are available in the SDK. -->
<PackageReference Include="Microsoft.Build.Tasks.Core" IncludeAssets="compile" />
<PackageReference Include="Microsoft.Build.Utilities.Core" IncludeAssets="compile" />
<PackageReference Include="NuGet.Protocol" IncludeAssets="compile" />
<PackageReference Include="NuGet.ProjectModel" IncludeAssets="compile" />
<PackageReference Include="Newtonsoft.Json" IncludeAssets="compile" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,17 @@
<DefaultExcludesInProjectFolder>$(DefaultExcludesInProjectFolder);assets/**/*</DefaultExcludesInProjectFolder>
<VSTestLogger>console%3bverbosity=normal;trx%3bverbosity=diagnostic%3bLogFileName=$(MSBuildProjectName).trx</VSTestLogger>
<VSTestCLIRunSettings>$(VSTestCLIRunSettings);RunConfiguration.DotNetHostPath=$(DotnetTool)</VSTestCLIRunSettings>
<!--
Required while we're using direct SDK assembly references in
$(RepositoryEngineeringDir)tools/Directory.Build.props for all tools projects
including Microsoft.DotNet.UnifiedBuild.Tasks.
-->
<NoWarn>$(NoWarn);MSB3277</NoWarn>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="$(RepositoryEngineeringDir)tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/Microsoft.DotNet.UnifiedBuild.Tasks.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Build.Tasks.Core" />
<PackageReference Include="Microsoft.Build.Utilities.Core" />
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" />
</ItemGroup>

<!--
Copied from $(RepositoryEngineeringDir)tools/Directory.Build.props - keep in sync.
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="NuGet.ProjectModel" />
<PackageReference Include="NuGet.Protocol" />

Use some assemblies from the SDK, instead of package references. This ensures they match what's
found when the task is loaded by the SDK's MSBuild.
Reference NuGet assemblies, except a command line assembly that causes warnings such as:
MSB3277: Found conflicts between different versions of "System.Collections" that could not be resolved.
-->
<ItemGroup>
<SdkAssembly Include="$([MSBuild]::NormalizePath('$(NetCoreRoot)', 'sdk', '$(NETCoreSdkVersion)', 'Newtonsoft.Json.dll'));
$([MSBuild]::NormalizeDirectory('$(NetCoreRoot)', 'sdk', '$(NETCoreSdkVersion)'))NuGet.*.dll"
Exclude="$([MSBuild]::NormalizePath('$(NetCoreRoot)', 'sdk', '$(NETCoreSdkVersion)', 'NuGet.CommandLine.XPlat.dll'))" />
</ItemGroup>

<ItemGroup>
<ReferencePath Include="@(SdkAssembly)" />
<ProjectReference Include="$(RepositoryEngineeringDir)tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/Microsoft.DotNet.UnifiedBuild.Tasks.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading