Skip to content
This repository was archived by the owner on Jul 30, 2024. It is now read-only.

Commit e7b9e8e

Browse files
SymbolsValidatorJob (#488)
Symbols Package validator job.
1 parent a843ac6 commit e7b9e8e

43 files changed

Lines changed: 2087 additions & 7 deletions

Some content is hidden

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

.nuget/NuGet.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<packageSources>
77
<add key="nugetbuild" value="https://dotnet.myget.org/F/nuget-build/api/v3/index.json" />
88
<add key="nuget.org" value="https://www.nuget.org/api/v2" />
9+
<add key="dotnet.core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
910
</packageSources>
1011
<disabledPackageSources>
1112
<clear />

NuGet.Jobs.sln

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Monitoring.RebootSearchInst
141141
EndProject
142142
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Monitoring.RebootSearchInstance.Tests", "tests\Monitoring.RebootSearchInstance.Tests\Monitoring.RebootSearchInstance.Tests.csproj", "{21C0A0EE-8696-4013-950F-D6495D0C6E40}"
143143
EndProject
144+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Validation.Symbols", "src\Validation.Symbols\Validation.Symbols.csproj", "{2DD07A73-8C88-4429-BB24-C2813586EF92}"
145+
EndProject
146+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Validation.Symbols.Tests", "tests\Validation.Symbols.Tests\Validation.Symbols.Tests.csproj", "{640D29AB-4D1B-4FC7-AE67-AD12EE5AC503}"
147+
EndProject
144148
Global
145149
GlobalSection(SolutionConfigurationPlatforms) = preSolution
146150
Debug|Any CPU = Debug|Any CPU
@@ -369,6 +373,14 @@ Global
369373
{21C0A0EE-8696-4013-950F-D6495D0C6E40}.Debug|Any CPU.Build.0 = Debug|Any CPU
370374
{21C0A0EE-8696-4013-950F-D6495D0C6E40}.Release|Any CPU.ActiveCfg = Release|Any CPU
371375
{21C0A0EE-8696-4013-950F-D6495D0C6E40}.Release|Any CPU.Build.0 = Release|Any CPU
376+
{2DD07A73-8C88-4429-BB24-C2813586EF92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
377+
{2DD07A73-8C88-4429-BB24-C2813586EF92}.Debug|Any CPU.Build.0 = Debug|Any CPU
378+
{2DD07A73-8C88-4429-BB24-C2813586EF92}.Release|Any CPU.ActiveCfg = Release|Any CPU
379+
{2DD07A73-8C88-4429-BB24-C2813586EF92}.Release|Any CPU.Build.0 = Release|Any CPU
380+
{640D29AB-4D1B-4FC7-AE67-AD12EE5AC503}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
381+
{640D29AB-4D1B-4FC7-AE67-AD12EE5AC503}.Debug|Any CPU.Build.0 = Debug|Any CPU
382+
{640D29AB-4D1B-4FC7-AE67-AD12EE5AC503}.Release|Any CPU.ActiveCfg = Release|Any CPU
383+
{640D29AB-4D1B-4FC7-AE67-AD12EE5AC503}.Release|Any CPU.Build.0 = Release|Any CPU
372384
EndGlobalSection
373385
GlobalSection(SolutionProperties) = preSolution
374386
HideSolutionNode = FALSE
@@ -429,6 +441,8 @@ Global
429441
{17510A22-176F-4E96-A867-E79F1B54F54F} = {678D7B14-F8BC-4193-99AF-2EE8AA390A02}
430442
{ECD8DFCE-8E3C-4510-AFE3-D7EC168E8D66} = {814F9B31-4AF3-46CC-AD61-CEB40F47083A}
431443
{21C0A0EE-8696-4013-950F-D6495D0C6E40} = {6A776396-02B1-475D-A104-26940ADB04AB}
444+
{2DD07A73-8C88-4429-BB24-C2813586EF92} = {678D7B14-F8BC-4193-99AF-2EE8AA390A02}
445+
{640D29AB-4D1B-4FC7-AE67-AD12EE5AC503} = {6A776396-02B1-475D-A104-26940ADB04AB}
432446
EndGlobalSection
433447
GlobalSection(ExtensibilityGlobals) = postSolution
434448
SolutionGuid = {284A7AC3-FB43-4F1F-9C9C-2AF0E1F46C2B}

build.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ Invoke-BuildStep 'Creating artifacts' {
149149
$ProjectsWithSymbols =
150150
"src/NuGet.Jobs.Common/NuGet.Jobs.Common.csproj",
151151
"src/Validation.Common.Job/Validation.Common.Job.csproj",
152-
"src/Validation.ScanAndSign.Core/Validation.ScanAndSign.Core.csproj"
152+
"src/Validation.ScanAndSign.Core/Validation.ScanAndSign.Core.csproj",
153+
"src/Validation.Symbols.Core/Validation.Symbols.Core.csproj"
153154

154155
$Projects = `
155156
"src/Stats.CollectAzureCdnLogs/Stats.CollectAzureCdnLogs.csproj", `
@@ -176,8 +177,8 @@ Invoke-BuildStep 'Creating artifacts' {
176177
"src/Validation.PackageSigning.ValidateCertificate/Validation.PackageSigning.ValidateCertificate.csproj", `
177178
"src/Validation.PackageSigning.RevalidateCertificate/Validation.PackageSigning.RevalidateCertificate.csproj", `
178179
"src/PackageLagMonitor/Monitoring.PackageLag.csproj", `
179-
"src/Validation.Symbols.Core/Validation.Symbols.Core.csproj", `
180-
"src/Monitoring.RebootSearchInstance/Monitoring.RebootSearchInstance.csproj" `
180+
"src/Monitoring.RebootSearchInstance/Monitoring.RebootSearchInstance.csproj", `
181+
"src/Validation.Symbols/Validation.Symbols.csproj" `
181182
+ $ProjectsWithSymbols
182183

183184
Foreach ($Project in $Projects) {

src/NuGet.Services.Validation.Orchestrator/NuGet.Services.Validation.Orchestrator.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
<Version>2.26.0-master-34394</Version>
128128
</PackageReference>
129129
<PackageReference Include="NuGet.Services.Validation.Issues">
130-
<Version>2.26.0-master-34394</Version>
130+
<Version>2.27.0-master-35351</Version>
131131
</PackageReference>
132132
</ItemGroup>
133133
<ItemGroup>

src/Validation.Common.Job/LoggerDiagnosticsSource.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,21 @@ private static IDictionary<string, string> GetProperties(
8989
return dictionary;
9090
}
9191

92+
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
93+
{
94+
_logger.Log<TState>(logLevel, eventId, state, exception, formatter);
95+
}
96+
97+
public bool IsEnabled(LogLevel logLevel)
98+
{
99+
return _logger.IsEnabled(logLevel);
100+
}
101+
102+
public IDisposable BeginScope<TState>(TState state)
103+
{
104+
return _logger.BeginScope<TState>(state);
105+
}
106+
92107
/// <summary>
93108
/// The parameters provided to <see cref="TraceEvent(TraceEventType, int, string, string, string, int)"/>. This
94109
/// type implements <see cref="IEnumerable{KeyValuePair{string, object}}" /> because Serilog uses this to

src/Validation.Common.Job/Validation.Common.Job.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,11 @@
111111
<PackageReference Include="NuGet.Services.Validation">
112112
<Version>2.27.0</Version>
113113
</PackageReference>
114+
<PackageReference Include="NuGet.Services.Validation.Issues">
115+
<Version>2.27.0</Version>
116+
</PackageReference>
114117
<PackageReference Include="NuGetGallery.Core">
115-
<Version>4.4.5-dev-35356</Version>
118+
<Version>4.4.5-dev-35743</Version>
116119
</PackageReference>
117120
<PackageReference Include="Serilog">
118121
<Version>2.5.0</Version>

src/Validation.Common.Job/Validation.Common.Job.nuspec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
<dependency id="NuGet.Services.Sql" version="2.27.0" />
2323
<dependency id="NuGet.Services.Storage" version="2.27.0" />
2424
<dependency id="NuGet.Services.Validation" version="2.27.0" />
25-
<dependency id="NuGetGallery.Core" version="4.4.5-dev-35356" />
25+
<dependency id="NuGet.Services.Validation.Issues" version="2.27.0" />
26+
<dependency id="NuGetGallery.Core" version="4.4.5-dev-35743" />
2627
<dependency id="Serilog" version="2.5.0" />
2728
<dependency id="System.Net.Http" version="4.3.3" />
2829
</dependencies>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Copyright (c) .NET Foundation. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
4+
using System.IO;
5+
using System.Collections.Generic;
6+
7+
namespace NuGet.Jobs.Validation.Symbols.Core
8+
{
9+
public interface IZipArchiveService
10+
{
11+
/// <summary>
12+
/// Reads the list of files from the zip stream.
13+
/// </summary>
14+
/// <param name="stream">The zip stream.</param>
15+
/// <param name="matchingExtensions">A set of matching file extensions to filter the results.</param>
16+
/// <returns>A list of the full file paths inside the zip stream.</returns>
17+
List<string> ReadFilesFromZipStream(Stream stream, params string[] matchingExtensions);
18+
19+
/// <summary>
20+
/// Extracts the files from the zip stream.
21+
/// </summary>
22+
/// <param name="stream">The zip stream.</param>
23+
/// <param name="targetDirectory">The target diorectoryu where to extract.</param>
24+
/// <param name="filterFileNames">A collection of full symbol file names to be used for filtering.
25+
/// For example if the <paramref name="stream"/> contains foo.dll and bar.dll
26+
/// and the <paramref name="filterFileNames"/> contains only foo.pdb than only the foo.dll wil be extracted.</param>
27+
/// <returns>The list of the full paths for the extracted files.</returns>
28+
List<string> ExtractFilesFromZipStream(Stream stream, string targetDirectory, IEnumerable<string> filterFileNames = null);
29+
}
30+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright (c) .NET Foundation. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
4+
using System;
5+
using System.IO;
6+
7+
namespace NuGet.Jobs.Validation.Symbols.Core
8+
{
9+
public class Settings
10+
{
11+
public const string SymbolServerTempDir = "NuGetSymServ";
12+
13+
public static string GetWorkingDirectory()
14+
{
15+
return Path.Combine(Path.GetTempPath(), SymbolServerTempDir, Guid.NewGuid().ToString());
16+
}
17+
}
18+
}

src/Validation.Symbols.Core/Validation.Symbols.Core.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,13 @@
4545
</ItemGroup>
4646
<ItemGroup>
4747
<Compile Include="ISymbolsValidatorMessage.cs" />
48+
<Compile Include="IZipArchiveService.cs" />
4849
<Compile Include="Properties\AssemblyInfo.cs" />
4950
<Compile Include="Properties\AssemblyInfo.*.cs" />
51+
<Compile Include="Settings.cs" />
5052
<Compile Include="SymbolsValidatorMessageSerializer.cs" />
5153
<Compile Include="SymbolsValidatorMessage.cs" />
54+
<Compile Include="ZipArchiveService.cs" />
5255
</ItemGroup>
5356
<ItemGroup>
5457
<PackageReference Include="NuGet.Services.ServiceBus">

0 commit comments

Comments
 (0)