Skip to content

Commit 02a6e9c

Browse files
authored
Merge pull request #10705 from NuGet/dev
[ReleasePrep][2026.02.06]RI of dev into main
2 parents 7f378e0 + 08de4c1 commit 02a6e9c

52 files changed

Lines changed: 1315 additions & 352 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.pipelines/Release-trigger.yml

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ parameters:
1212
- name: TargetPipelines
1313
type: object
1414
default:
15-
- id: 21120 # gallery web app
16-
paramName: NuGetGallerySubmoduleBranch
17-
- id: 21280 # gallery packages
18-
paramName: Branch
19-
- id: 21128 # jobs
20-
paramName: Branch
21-
- id: 21269 # common
22-
paramName: Branch
15+
- id: 21120
16+
name: Gallery Web App
17+
- id: 21280
18+
name: Gallery Packages
19+
- id: 21128
20+
name: Jobs
21+
- id: 21269
22+
name: Common
2323

2424
variables:
2525
- name: NugetMultifeedWarnLevel
@@ -28,16 +28,25 @@ variables:
2828
pool:
2929
vmImage: 'windows-latest'
3030

31-
steps:
32-
- ${{ each pipeline in parameters.TargetPipelines }}:
33-
- powershell: |-
34-
$body = @{
35-
"templateParameters" = @{
36-
"${{ pipeline.paramName }}" = "$(Build.SourceBranchName)"
37-
}
38-
}
39-
$headers = @{ "Authorization" = "Bearer $env:ACCESS_TOKEN" };
40-
$url = "$(System.CollectionUri)$(System.TeamProject)/_apis/pipelines/${{ pipeline.id }}/runs?api-version=7.0"
41-
Invoke-RestMethod -Uri $url -Method POST -Headers $headers -Body ($body | ConvertTo-Json) -ContentType "application/json"
42-
env:
43-
ACCESS_TOKEN: $(System.AccessToken)
31+
stages:
32+
- stage: Trigger
33+
displayName: "Trigger"
34+
jobs:
35+
- job: TriggerTargetPipelines
36+
displayName: "Trigger target pipelines"
37+
steps:
38+
- ${{ each pipeline in parameters.TargetPipelines }}:
39+
- powershell: |
40+
$body = @{
41+
resources = @{
42+
repositories = @{
43+
"NuGetGallery" = @{
44+
refName = "$(Build.SourceBranch)"
45+
}
46+
}
47+
}
48+
}
49+
$headers = @{ "Authorization" = "Bearer $(System.AccessToken)" };
50+
$url = "$(System.CollectionUri)$(System.TeamProject)/_apis/pipelines/${{ pipeline.id }}/runs?api-version=7.1"
51+
Invoke-RestMethod -Uri $url -Method POST -Headers $headers -Body ($body | ConvertTo-Json -Depth 10) -ContentType "application/json"
52+
displayName: "Trigger ${{ pipeline.name }}"

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<PackageVersion Include="EntityFramework" Version="6.5.1" />
2929
<PackageVersion Include="FluentAssertions" Version="5.5.0" />
3030
<PackageVersion Include="FluentLinkChecker" Version="1.0.0.10" />
31-
<PackageVersion Include="HtmlSanitizer" Version="8.1.870" />
31+
<PackageVersion Include="HtmlSanitizer" Version="9.0.892" />
3232
<PackageVersion Include="Knapcode.MiniZip" Version="0.20.0" />
3333
<PackageVersion Include="LibGit2Sharp" Version="0.26.0" />
3434
<PackageVersion Include="Lucene.Net.Contrib" Version="3.0.3" />

NuGetGallery.FunctionalTests.sln

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 18
4-
VisualStudioVersion = 18.3.11322.18 main
4+
VisualStudioVersion = 18.3.11322.18
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{37E5C8A5-C7A6-400E-A0EA-6C2C6F9B160D}"
77
ProjectSection(SolutionItems) = preProject
@@ -12,6 +12,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGetGallery.FunctionalTest
1212
EndProject
1313
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGetGallery.FunctionalTests.Core", "tests\NuGetGallery.FunctionalTests.Core\NuGetGallery.FunctionalTests.Core.csproj", "{8496C7FE-8A93-4D2E-A9DC-5DE44017187C}"
1414
EndProject
15+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGet.Services.KeyVault", "src\NuGet.Services.KeyVault\NuGet.Services.KeyVault.csproj", "{62CBCFA4-FD1F-5454-7934-0220E9A6651C}"
16+
EndProject
17+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{975E68D2-957C-4C58-84EB-75E900CE17E0}"
18+
EndProject
19+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGet.Services.Configuration", "src\NuGet.Services.Configuration\NuGet.Services.Configuration.csproj", "{2A118C67-FC6D-5A6F-035B-D41A64046CBA}"
20+
EndProject
21+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{C28C993D-C81E-4406-B711-34CF72C41C39}"
22+
EndProject
1523
Global
1624
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1725
Debug|Any CPU = Debug|Any CPU
@@ -26,10 +34,24 @@ Global
2634
{8496C7FE-8A93-4D2E-A9DC-5DE44017187C}.Debug|Any CPU.Build.0 = Debug|Any CPU
2735
{8496C7FE-8A93-4D2E-A9DC-5DE44017187C}.Release|Any CPU.ActiveCfg = Release|Any CPU
2836
{8496C7FE-8A93-4D2E-A9DC-5DE44017187C}.Release|Any CPU.Build.0 = Release|Any CPU
37+
{62CBCFA4-FD1F-5454-7934-0220E9A6651C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
38+
{62CBCFA4-FD1F-5454-7934-0220E9A6651C}.Debug|Any CPU.Build.0 = Debug|Any CPU
39+
{62CBCFA4-FD1F-5454-7934-0220E9A6651C}.Release|Any CPU.ActiveCfg = Release|Any CPU
40+
{62CBCFA4-FD1F-5454-7934-0220E9A6651C}.Release|Any CPU.Build.0 = Release|Any CPU
41+
{2A118C67-FC6D-5A6F-035B-D41A64046CBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
42+
{2A118C67-FC6D-5A6F-035B-D41A64046CBA}.Debug|Any CPU.Build.0 = Debug|Any CPU
43+
{2A118C67-FC6D-5A6F-035B-D41A64046CBA}.Release|Any CPU.ActiveCfg = Release|Any CPU
44+
{2A118C67-FC6D-5A6F-035B-D41A64046CBA}.Release|Any CPU.Build.0 = Release|Any CPU
2945
EndGlobalSection
3046
GlobalSection(SolutionProperties) = preSolution
3147
HideSolutionNode = FALSE
3248
EndGlobalSection
49+
GlobalSection(NestedProjects) = preSolution
50+
{073797B8-8D6C-4A82-9788-C38848D4CC59} = {C28C993D-C81E-4406-B711-34CF72C41C39}
51+
{8496C7FE-8A93-4D2E-A9DC-5DE44017187C} = {C28C993D-C81E-4406-B711-34CF72C41C39}
52+
{62CBCFA4-FD1F-5454-7934-0220E9A6651C} = {975E68D2-957C-4C58-84EB-75E900CE17E0}
53+
{2A118C67-FC6D-5A6F-035B-D41A64046CBA} = {975E68D2-957C-4C58-84EB-75E900CE17E0}
54+
EndGlobalSection
3355
GlobalSection(ExtensibilityGlobals) = postSolution
3456
SolutionGuid = {7A4EF1D3-E31D-4FE0-A407-79B054848111}
3557
EndGlobalSection

build/FindDuplicateFiles.cs

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.IO;
77
using System.Linq;
88
using System.Security.Cryptography;
9+
using System.Security.Cryptography.X509Certificates;
910
using Microsoft.Build.Framework;
1011

1112
namespace NuGet.Services.Build
@@ -21,6 +22,8 @@ public class FindDuplicateFiles : Microsoft.Build.Utilities.Task
2122
[Output]
2223
public ITaskItem[] DuplicateFiles { get; set; }
2324

25+
public string SkipAuthenticodeSubjects { get; set; }
26+
2427
public override bool Execute()
2528
{
2629
var infos = GetUniqueTaskItemInfo();
@@ -123,6 +126,57 @@ private Dictionary<string, List<TaskItemInfo>> FindDuplicates(List<TaskItemInfo>
123126
BreakTiesWithLeadingHash(filePathToDuplicates, buffer, fileSizePair);
124127
}
125128

129+
if (!string.IsNullOrWhiteSpace(SkipAuthenticodeSubjects))
130+
{
131+
Log.LogMessage("Skipping files with the following Authenticode subjects: {0}", SkipAuthenticodeSubjects);
132+
133+
var skipSubjects = SkipAuthenticodeSubjects
134+
.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries)
135+
.Select(s => s.Trim())
136+
.ToHashSet(StringComparer.Ordinal);
137+
138+
foreach (var pair in filePathToDuplicates.ToList())
139+
{
140+
var path = pair.Key;
141+
try
142+
{
143+
var cert = X509Certificate.CreateFromSignedFile(path);
144+
var subject = cert.Subject;
145+
146+
if (skipSubjects.Contains(subject))
147+
{
148+
Log.LogMessage(
149+
"Skipping file '{0}' with Authenticode subject '{1}'.",
150+
path,
151+
subject);
152+
153+
filePathToDuplicates.Remove(path);
154+
}
155+
else
156+
{
157+
Log.LogMessage(
158+
"Not skipping file '{0}' with Authenticode subject '{1}'.",
159+
path,
160+
subject);
161+
}
162+
}
163+
catch (Exception ex)
164+
{
165+
if (ex is CryptographicException)
166+
{
167+
// The file is not signed, proceed as normal.
168+
continue;
169+
}
170+
171+
throw;
172+
}
173+
}
174+
}
175+
else
176+
{
177+
Log.LogMessage("No Authenticode subjects to skip were provided.");
178+
}
179+
126180
return filePathToDuplicates;
127181
}
128182

build/FindDuplicateFiles.targets

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77
<Files ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" />
88
<UniqueFiles ParameterType="Microsoft.Build.Framework.ITaskItem[]" Output="true" />
99
<DuplicateFiles ParameterType="Microsoft.Build.Framework.ITaskItem[]" Output="true" />
10+
11+
<!--
12+
MicroBuild test signing fails signing a file that is already signed with the target strong name key.
13+
Because of this, when doing test signing we skip files that are already fully signed.
14+
We use the Authenticode subject to identify files that are signed with the real Microsoft key, since those will also have a complete strong name.
15+
Ideally we would have an option to filter out fully signed files directly, but this is not as simple (requires sn.exe to check).
16+
This is obviously not a full proof check, but it's sufficient for test signing (non-production scenarios).
17+
-->
18+
<SkipAuthenticodeSubjects ParameterType="System.String" />
1019
</ParameterGroup>
1120
<Task>
1221
<Code Type="Class" Language="cs" Source="$(MSBuildThisFileDirectory)FindDuplicateFiles.cs" />

0 commit comments

Comments
 (0)