dependabot-nuget 0.321.3 → 0.322.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/helpers/lib/NuGetUpdater/Directory.Packages.props +22 -22
- data/helpers/lib/NuGetUpdater/DotNetPackageCorrelation.Cli/Program.cs +21 -7
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli/Commands/AnalyzeCommand.cs +19 -11
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli/Commands/CloneCommand.cs +19 -9
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli/Commands/DiscoverCommand.cs +21 -14
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli/Commands/FrameworkCheckCommand.cs +8 -5
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli/Commands/RunCommand.cs +29 -16
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli/Commands/UpdateCommand.cs +20 -19
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli/Program.cs +2 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Files/GlobalJsonBuildFile.cs +5 -13
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/PrivateSourceTimedOutException.cs +12 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/JobErrorBase.cs +4 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/PrivateSourceTimedOut.cs +10 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/PullRequestTextGenerator.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/UpdateHandlers/CreateSecurityUpdatePullRequestHandler.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/UpdateHandlers/GroupUpdateAllVersionsHandler.cs +2 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/UpdateHandlers/RefreshGroupUpdatePullRequestHandler.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/UpdateHandlers/RefreshSecurityUpdatePullRequestHandler.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/UpdateHandlers/RefreshVersionUpdatePullRequestHandler.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/FileWriters/FileWriterWorker.cs +84 -34
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/FileWriters/XmlFileWriter.cs +17 -5
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/UpdateOperationBase.cs +18 -7
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/MSBuildHelper.cs +15 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.GlobalJson.cs +0 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.cs +0 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Files/GlobalJsonBuildFileTests.cs +0 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/HttpApiHandlerTests.cs +1 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/JobErrorBaseTests.cs +7 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/MessageReportTests.cs +11 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/PullRequestTextTests.cs +21 -22
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/RunWorkerTests.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/SerializationTests.cs +8 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/FileWriters/FileWriterWorkerTests.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/FileWriters/FileWriterWorkerTests_MiscellaneousTests.cs +45 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/FileWriters/XmlFileWriterTests.cs +26 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs +16 -0
- data/helpers/lib/NuGetUpdater/global.json +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3960b8e460b0caef38e1a302c8245e51708c19e3070be3dcd6de9ac708174c48
|
4
|
+
data.tar.gz: 9de84a12311aa75b8f838e1413052d4c37a06e74887c3e9d16d050e7e463f096
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 390a5e049399bf2d135915b3aa37c9c3977139193f3a46c41b09ea20568a7b417a96235fd32751f9d0b14efa8ad56c54187a0096d760676a728d8c61166225a3
|
7
|
+
data.tar.gz: bc2cabf452264a3df4f02e8531bfc8905c379072982f8ff31048d1fb3dbb4ededd221112eb3914bc0a6b56e87c0eff739ef5cebad1d12e7564264714463f94ec
|
@@ -3,42 +3,42 @@
|
|
3
3
|
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
4
4
|
</PropertyGroup>
|
5
5
|
<PropertyGroup>
|
6
|
-
<MSBuildPackageVersion>17.
|
6
|
+
<MSBuildPackageVersion>17.14.8</MSBuildPackageVersion>
|
7
7
|
</PropertyGroup>
|
8
8
|
<ItemGroup>
|
9
|
-
<PackageVersion Include="DiffPlex" Version="1.
|
9
|
+
<PackageVersion Include="DiffPlex" Version="1.8.0" />
|
10
10
|
<PackageVersion Include="GuiLabs.Language.Xml" Version="1.2.93" />
|
11
|
-
<PackageVersion Include="Microsoft.Build.Locator" Version="1.
|
11
|
+
<PackageVersion Include="Microsoft.Build.Locator" Version="1.9.1" />
|
12
12
|
<PackageVersion Include="Microsoft.Build" Version="$(MSBuildPackageVersion)" />
|
13
13
|
<PackageVersion Include="Microsoft.Build.Framework" Version="$(MSBuildPackageVersion)" />
|
14
14
|
<PackageVersion Include="Microsoft.Build.Tasks.Core" Version="$(MSBuildPackageVersion)" />
|
15
15
|
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="$(MSBuildPackageVersion)" />
|
16
|
-
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.
|
16
|
+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" />
|
17
17
|
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" />
|
18
|
-
<PackageVersion Include="Microsoft.Extensions.FileProviders.Abstractions" Version="9.0.
|
19
|
-
<PackageVersion Include="Microsoft.Extensions.FileSystemGlobbing" Version="9.0.
|
20
|
-
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.
|
21
|
-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.
|
22
|
-
<PackageVersion Include="Microsoft.VisualStudio.Setup.Configuration.Interop" Version="3.
|
18
|
+
<PackageVersion Include="Microsoft.Extensions.FileProviders.Abstractions" Version="9.0.7" />
|
19
|
+
<PackageVersion Include="Microsoft.Extensions.FileSystemGlobbing" Version="9.0.7" />
|
20
|
+
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.7" />
|
21
|
+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
|
22
|
+
<PackageVersion Include="Microsoft.VisualStudio.Setup.Configuration.Interop" Version="3.14.2075" />
|
23
23
|
<PackageVersion Include="Microsoft.VisualStudio.SolutionPersistence" Version="1.0.52" />
|
24
|
-
<PackageVersion Include="Microsoft.Web.Xdt" Version="3.
|
25
|
-
<PackageVersion Include="MSBuild.StructuredLogger" Version="2.
|
24
|
+
<PackageVersion Include="Microsoft.Web.Xdt" Version="3.2.0" />
|
25
|
+
<PackageVersion Include="MSBuild.StructuredLogger" Version="2.3.17" />
|
26
26
|
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
|
27
27
|
<PackageVersion Include="NuGet.Core" Version="2.14.0" Aliases="CoreV2" />
|
28
|
-
<PackageVersion Include="OpenTelemetry" Version="1.
|
29
|
-
<PackageVersion Include="OpenTelemetry.Exporter.Console" Version="1.
|
30
|
-
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.
|
28
|
+
<PackageVersion Include="OpenTelemetry" Version="1.12.0" />
|
29
|
+
<PackageVersion Include="OpenTelemetry.Exporter.Console" Version="1.12.0" />
|
30
|
+
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.12.0" />
|
31
31
|
<PackageVersion Include="Semver" Version="3.0.0" />
|
32
|
-
<PackageVersion Include="System.CommandLine" Version="2.0.0-
|
33
|
-
<PackageVersion Include="System.ComponentModel.Composition" Version="9.0.
|
32
|
+
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta6.25358.103" />
|
33
|
+
<PackageVersion Include="System.ComponentModel.Composition" Version="9.0.7" />
|
34
34
|
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
|
35
35
|
<PackageVersion Include="System.Formats.Asn1" Version="8.0.1" />
|
36
|
-
<PackageVersion Include="System.Security.Cryptography.Pkcs" Version="9.0.
|
37
|
-
<PackageVersion Include="System.Security.Cryptography.ProtectedData" Version="9.0.
|
38
|
-
<PackageVersion Include="System.Text.Json" Version="9.0.
|
36
|
+
<PackageVersion Include="System.Security.Cryptography.Pkcs" Version="9.0.7" />
|
37
|
+
<PackageVersion Include="System.Security.Cryptography.ProtectedData" Version="9.0.7" />
|
38
|
+
<PackageVersion Include="System.Text.Json" Version="9.0.7" />
|
39
39
|
<PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
|
40
|
-
<PackageVersion Include="System.Threading.Tasks.Dataflow" Version="9.0.
|
41
|
-
<PackageVersion Include="xunit.v3" Version="
|
42
|
-
<PackageVersion Include="xunit.runner.visualstudio" Version="3.
|
40
|
+
<PackageVersion Include="System.Threading.Tasks.Dataflow" Version="9.0.7" />
|
41
|
+
<PackageVersion Include="xunit.v3" Version="3.0.0" />
|
42
|
+
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.2" />
|
43
43
|
</ItemGroup>
|
44
44
|
</Project>
|
@@ -9,24 +9,38 @@ public class Program
|
|
9
9
|
{
|
10
10
|
public static async Task<int> Main(string[] args)
|
11
11
|
{
|
12
|
-
var coreLocationOption = new Option<DirectoryInfo>("--core-location"
|
13
|
-
|
12
|
+
var coreLocationOption = new Option<DirectoryInfo>("--core-location")
|
13
|
+
{
|
14
|
+
Description = "The location of the .NET Core source code.",
|
15
|
+
Required = true
|
16
|
+
};
|
17
|
+
var outputOption = new Option<FileInfo>("--output")
|
18
|
+
{
|
19
|
+
Description = "The location to write the result.",
|
20
|
+
Required = true
|
21
|
+
};
|
14
22
|
var command = new Command("build")
|
15
23
|
{
|
16
24
|
coreLocationOption,
|
17
25
|
outputOption,
|
18
26
|
};
|
19
27
|
command.TreatUnmatchedTokensAsErrors = true;
|
20
|
-
command.
|
28
|
+
command.SetAction(async (parseResult, cancellationToken) =>
|
21
29
|
{
|
30
|
+
var coreLocationDirectory = parseResult.GetValue(coreLocationOption);
|
31
|
+
var output = parseResult.GetValue(outputOption);
|
32
|
+
|
22
33
|
// the tool is expected to be given the path to the .NET Core repository, but the correlator only needs a specific subdirectory
|
23
|
-
var releaseNotesDirectory = new DirectoryInfo(Path.Combine(coreLocationDirectory
|
34
|
+
var releaseNotesDirectory = new DirectoryInfo(Path.Combine(coreLocationDirectory!.FullName, "release-notes"));
|
24
35
|
var correlator = new Correlator(releaseNotesDirectory);
|
25
36
|
var (sdkPackages, _warnings) = await correlator.RunAsync();
|
26
37
|
var json = JsonSerializer.Serialize(sdkPackages, Correlator.SerializerOptions);
|
27
|
-
await File.WriteAllTextAsync(output
|
28
|
-
|
29
|
-
|
38
|
+
await File.WriteAllTextAsync(output!.FullName, json, cancellationToken);
|
39
|
+
|
40
|
+
return 0;
|
41
|
+
});
|
42
|
+
var parseResult = command.Parse(args);
|
43
|
+
var exitCode = await parseResult.InvokeAsync();
|
30
44
|
return exitCode;
|
31
45
|
}
|
32
46
|
}
|
@@ -7,12 +7,12 @@ namespace NuGetUpdater.Cli.Commands;
|
|
7
7
|
|
8
8
|
internal static class AnalyzeCommand
|
9
9
|
{
|
10
|
-
internal static readonly Option<string> JobIdOption = new("--job-id") {
|
11
|
-
internal static readonly Option<FileInfo> JobPathOption = new("--job-path") {
|
12
|
-
internal static readonly Option<DirectoryInfo> RepoRootOption = new("--repo-root") {
|
13
|
-
internal static readonly Option<FileInfo> DependencyFilePathOption = new("--dependency-file-path") {
|
14
|
-
internal static readonly Option<FileInfo> DiscoveryFilePathOption = new("--discovery-file-path") {
|
15
|
-
internal static readonly Option<DirectoryInfo> AnalysisFolderOption = new("--analysis-folder-path") {
|
10
|
+
internal static readonly Option<string> JobIdOption = new("--job-id") { Required = true };
|
11
|
+
internal static readonly Option<FileInfo> JobPathOption = new("--job-path") { Required = true };
|
12
|
+
internal static readonly Option<DirectoryInfo> RepoRootOption = new("--repo-root") { Required = true };
|
13
|
+
internal static readonly Option<FileInfo> DependencyFilePathOption = new("--dependency-file-path") { Required = true };
|
14
|
+
internal static readonly Option<FileInfo> DiscoveryFilePathOption = new("--discovery-file-path") { Required = true };
|
15
|
+
internal static readonly Option<DirectoryInfo> AnalysisFolderOption = new("--analysis-folder-path") { Required = true };
|
16
16
|
|
17
17
|
internal static Command GetCommand(Action<int> setExitCode)
|
18
18
|
{
|
@@ -28,13 +28,21 @@ internal static class AnalyzeCommand
|
|
28
28
|
|
29
29
|
command.TreatUnmatchedTokensAsErrors = true;
|
30
30
|
|
31
|
-
command.
|
31
|
+
command.SetAction(async (parseResult, cancellationToken) =>
|
32
32
|
{
|
33
|
+
var jobId = parseResult.GetValue(JobIdOption);
|
34
|
+
var jobPath = parseResult.GetValue(JobPathOption);
|
35
|
+
var repoRoot = parseResult.GetValue(RepoRootOption);
|
36
|
+
var discoveryPath = parseResult.GetValue(DiscoveryFilePathOption);
|
37
|
+
var dependencyPath = parseResult.GetValue(DependencyFilePathOption);
|
38
|
+
var analysisDirectory = parseResult.GetValue(AnalysisFolderOption);
|
39
|
+
|
33
40
|
var logger = new OpenTelemetryLogger();
|
34
|
-
var (experimentsManager, _errorResult) = await ExperimentsManager.FromJobFileAsync(jobId
|
35
|
-
var worker = new AnalyzeWorker(jobId
|
36
|
-
await worker.RunAsync(repoRoot
|
37
|
-
|
41
|
+
var (experimentsManager, _errorResult) = await ExperimentsManager.FromJobFileAsync(jobId!, jobPath!.FullName);
|
42
|
+
var worker = new AnalyzeWorker(jobId!, experimentsManager, logger);
|
43
|
+
await worker.RunAsync(repoRoot!.FullName, discoveryPath!.FullName, dependencyPath!.FullName, analysisDirectory!.FullName);
|
44
|
+
return 0;
|
45
|
+
});
|
38
46
|
|
39
47
|
return command;
|
40
48
|
}
|
@@ -8,10 +8,14 @@ namespace NuGetUpdater.Cli.Commands;
|
|
8
8
|
|
9
9
|
internal static class CloneCommand
|
10
10
|
{
|
11
|
-
internal static readonly Option<FileInfo> JobPathOption = new("--job-path") {
|
12
|
-
internal static readonly Option<DirectoryInfo> RepoContentsPathOption = new("--repo-contents-path") {
|
13
|
-
internal static readonly Option<Uri> ApiUrlOption = new("--api-url")
|
14
|
-
|
11
|
+
internal static readonly Option<FileInfo> JobPathOption = new("--job-path") { Required = true };
|
12
|
+
internal static readonly Option<DirectoryInfo> RepoContentsPathOption = new("--repo-contents-path") { Required = true };
|
13
|
+
internal static readonly Option<Uri> ApiUrlOption = new("--api-url")
|
14
|
+
{
|
15
|
+
Required = true,
|
16
|
+
CustomParser = (argumentResult) => Uri.TryCreate(argumentResult.Tokens.Single().Value, UriKind.Absolute, out var uri) ? uri : throw new ArgumentException("Invalid API URL format.")
|
17
|
+
};
|
18
|
+
internal static readonly Option<string> JobIdOption = new("--job-id") { Required = true };
|
15
19
|
|
16
20
|
internal static Command GetCommand(Action<int> setExitCode)
|
17
21
|
{
|
@@ -25,15 +29,21 @@ internal static class CloneCommand
|
|
25
29
|
|
26
30
|
command.TreatUnmatchedTokensAsErrors = true;
|
27
31
|
|
28
|
-
command.
|
32
|
+
command.SetAction(async (parseResult, cancellationToken) =>
|
29
33
|
{
|
30
|
-
var
|
34
|
+
var jobPath = parseResult.GetValue(JobPathOption);
|
35
|
+
var repoContentsPath = parseResult.GetValue(RepoContentsPathOption);
|
36
|
+
var apiUrl = parseResult.GetValue(ApiUrlOption);
|
37
|
+
var jobId = parseResult.GetValue(JobIdOption);
|
38
|
+
|
39
|
+
var apiHandler = new HttpApiHandler(apiUrl!.ToString(), jobId!);
|
31
40
|
var logger = new OpenTelemetryLogger();
|
32
41
|
var gitCommandHandler = new ShellGitCommandHandler(logger);
|
33
|
-
var worker = new CloneWorker(jobId
|
34
|
-
var exitCode = await worker.RunAsync(jobPath
|
42
|
+
var worker = new CloneWorker(jobId!, apiHandler, gitCommandHandler, logger);
|
43
|
+
var exitCode = await worker.RunAsync(jobPath!, repoContentsPath!);
|
35
44
|
setExitCode(exitCode);
|
36
|
-
|
45
|
+
return exitCode;
|
46
|
+
});
|
37
47
|
|
38
48
|
return command;
|
39
49
|
}
|
@@ -7,11 +7,11 @@ namespace NuGetUpdater.Cli.Commands;
|
|
7
7
|
|
8
8
|
internal static class DiscoverCommand
|
9
9
|
{
|
10
|
-
internal static readonly Option<string> JobIdOption = new("--job-id") {
|
11
|
-
internal static readonly Option<FileInfo> JobPathOption = new("--job-path") {
|
12
|
-
internal static readonly Option<DirectoryInfo> RepoRootOption = new("--repo-root") {
|
13
|
-
internal static readonly Option<string> WorkspaceOption = new("--workspace") {
|
14
|
-
internal static readonly Option<FileInfo> OutputOption = new("--output") {
|
10
|
+
internal static readonly Option<string> JobIdOption = new("--job-id") { Required = true };
|
11
|
+
internal static readonly Option<FileInfo> JobPathOption = new("--job-path") { Required = true };
|
12
|
+
internal static readonly Option<DirectoryInfo> RepoRootOption = new("--repo-root") { Required = true };
|
13
|
+
internal static readonly Option<string> WorkspaceOption = new("--workspace") { Required = true };
|
14
|
+
internal static readonly Option<FileInfo> OutputOption = new("--output") { Required = true };
|
15
15
|
|
16
16
|
internal static Command GetCommand(Action<int> setExitCode)
|
17
17
|
{
|
@@ -26,27 +26,34 @@ internal static class DiscoverCommand
|
|
26
26
|
|
27
27
|
command.TreatUnmatchedTokensAsErrors = true;
|
28
28
|
|
29
|
-
command.
|
29
|
+
command.SetAction(async (parseResult, cancellationToken) =>
|
30
30
|
{
|
31
|
+
var jobId = parseResult.GetValue(JobIdOption);
|
32
|
+
var jobPath = parseResult.GetValue(JobPathOption);
|
33
|
+
var repoRoot = parseResult.GetValue(RepoRootOption);
|
34
|
+
var workspace = parseResult.GetValue(WorkspaceOption);
|
35
|
+
var outputPath = parseResult.GetValue(OutputOption);
|
36
|
+
|
31
37
|
var logger = new OpenTelemetryLogger();
|
32
|
-
MSBuildHelper.RegisterMSBuild(repoRoot
|
33
|
-
var (experimentsManager, error) = await ExperimentsManager.FromJobFileAsync(jobId
|
38
|
+
MSBuildHelper.RegisterMSBuild(repoRoot!.FullName, repoRoot.FullName, logger);
|
39
|
+
var (experimentsManager, error) = await ExperimentsManager.FromJobFileAsync(jobId!, jobPath!.FullName);
|
34
40
|
if (error is not null)
|
35
41
|
{
|
36
42
|
// to make testing easier, this should be a `WorkspaceDiscoveryResult` object
|
37
43
|
var discoveryErrorResult = new WorkspaceDiscoveryResult
|
38
44
|
{
|
39
45
|
Error = error,
|
40
|
-
Path = workspace
|
46
|
+
Path = workspace!,
|
41
47
|
Projects = [],
|
42
48
|
};
|
43
|
-
await DiscoveryWorker.WriteResultsAsync(repoRoot.FullName, outputPath
|
44
|
-
return;
|
49
|
+
await DiscoveryWorker.WriteResultsAsync(repoRoot.FullName, outputPath!.FullName, discoveryErrorResult);
|
50
|
+
return 0;
|
45
51
|
}
|
46
52
|
|
47
|
-
var worker = new DiscoveryWorker(jobId
|
48
|
-
await worker.RunAsync(repoRoot.FullName, workspace
|
49
|
-
|
53
|
+
var worker = new DiscoveryWorker(jobId!, experimentsManager, logger);
|
54
|
+
await worker.RunAsync(repoRoot.FullName, workspace!, outputPath!.FullName);
|
55
|
+
return 0;
|
56
|
+
});
|
50
57
|
|
51
58
|
return command;
|
52
59
|
}
|
@@ -7,8 +7,8 @@ namespace NuGetUpdater.Cli.Commands;
|
|
7
7
|
|
8
8
|
internal static class FrameworkCheckCommand
|
9
9
|
{
|
10
|
-
internal static readonly Option<string[]> ProjectTfmsOption = new("--project-tfms") {
|
11
|
-
internal static readonly Option<string[]> PackageTfmsOption = new("--package-tfms") {
|
10
|
+
internal static readonly Option<string[]> ProjectTfmsOption = new("--project-tfms") { Required = true, AllowMultipleArgumentsPerToken = true };
|
11
|
+
internal static readonly Option<string[]> PackageTfmsOption = new("--package-tfms") { Required = true, AllowMultipleArgumentsPerToken = true };
|
12
12
|
|
13
13
|
internal static Command GetCommand(Action<int> setExitCode)
|
14
14
|
{
|
@@ -20,12 +20,15 @@ internal static class FrameworkCheckCommand
|
|
20
20
|
|
21
21
|
command.TreatUnmatchedTokensAsErrors = true;
|
22
22
|
|
23
|
-
command.
|
23
|
+
command.SetAction((parseResult) =>
|
24
24
|
{
|
25
|
-
|
25
|
+
var projectTfms = parseResult.GetValue(ProjectTfmsOption);
|
26
|
+
var packageTfms = parseResult.GetValue(PackageTfmsOption);
|
27
|
+
|
28
|
+
setExitCode(CompatibilityChecker.IsCompatible(projectTfms!, packageTfms!, new ConsoleLogger())
|
26
29
|
? 0
|
27
30
|
: 1);
|
28
|
-
}
|
31
|
+
});
|
29
32
|
|
30
33
|
return command;
|
31
34
|
}
|
@@ -9,13 +9,17 @@ namespace NuGetUpdater.Cli.Commands;
|
|
9
9
|
|
10
10
|
internal static class RunCommand
|
11
11
|
{
|
12
|
-
internal static readonly Option<FileInfo> JobPathOption = new("--job-path") {
|
13
|
-
internal static readonly Option<DirectoryInfo> RepoContentsPathOption = new("--repo-contents-path") {
|
14
|
-
internal static readonly Option<DirectoryInfo?> CaseInsensitiveRepoContentsPathOption = new("--case-insensitive-repo-contents-path") {
|
15
|
-
internal static readonly Option<Uri> ApiUrlOption = new("--api-url")
|
16
|
-
|
17
|
-
|
18
|
-
|
12
|
+
internal static readonly Option<FileInfo> JobPathOption = new("--job-path") { Required = true };
|
13
|
+
internal static readonly Option<DirectoryInfo> RepoContentsPathOption = new("--repo-contents-path") { Required = true };
|
14
|
+
internal static readonly Option<DirectoryInfo?> CaseInsensitiveRepoContentsPathOption = new("--case-insensitive-repo-contents-path") { Required = false };
|
15
|
+
internal static readonly Option<Uri> ApiUrlOption = new("--api-url")
|
16
|
+
{
|
17
|
+
Required = true,
|
18
|
+
CustomParser = (argumentResult) => Uri.TryCreate(argumentResult.Tokens.Single().Value, UriKind.Absolute, out var uri) ? uri : throw new ArgumentException("Invalid API URL format.")
|
19
|
+
};
|
20
|
+
internal static readonly Option<string> JobIdOption = new("--job-id") { Required = true };
|
21
|
+
internal static readonly Option<FileInfo> OutputPathOption = new("--output-path") { Required = true };
|
22
|
+
internal static readonly Option<string> BaseCommitShaOption = new("--base-commit-sha") { Required = true };
|
19
23
|
|
20
24
|
internal static Command GetCommand(Action<int> setExitCode)
|
21
25
|
{
|
@@ -32,17 +36,26 @@ internal static class RunCommand
|
|
32
36
|
|
33
37
|
command.TreatUnmatchedTokensAsErrors = true;
|
34
38
|
|
35
|
-
command.
|
39
|
+
command.SetAction(async (parseResult, cancellationToken) =>
|
36
40
|
{
|
37
|
-
var
|
38
|
-
var
|
41
|
+
var jobPath = parseResult.GetValue(JobPathOption);
|
42
|
+
var repoContentsPath = parseResult.GetValue(RepoContentsPathOption);
|
43
|
+
var caseInsensitiveRepoContentsPath = parseResult.GetValue(CaseInsensitiveRepoContentsPathOption);
|
44
|
+
var apiUrl = parseResult.GetValue(ApiUrlOption);
|
45
|
+
var jobId = parseResult.GetValue(JobIdOption);
|
46
|
+
var outputPath = parseResult.GetValue(OutputPathOption);
|
47
|
+
var baseCommitSha = parseResult.GetValue(BaseCommitShaOption);
|
48
|
+
|
49
|
+
var apiHandler = new HttpApiHandler(apiUrl!.ToString(), jobId!);
|
50
|
+
var (experimentsManager, _errorResult) = await ExperimentsManager.FromJobFileAsync(jobId!, jobPath!.FullName);
|
39
51
|
var logger = new OpenTelemetryLogger();
|
40
|
-
var discoverWorker = new DiscoveryWorker(jobId
|
41
|
-
var analyzeWorker = new AnalyzeWorker(jobId
|
42
|
-
var updateWorker = new UpdaterWorker(jobId
|
43
|
-
var worker = new RunWorker(jobId
|
44
|
-
await worker.RunAsync(jobPath
|
45
|
-
|
52
|
+
var discoverWorker = new DiscoveryWorker(jobId!, experimentsManager, logger);
|
53
|
+
var analyzeWorker = new AnalyzeWorker(jobId!, experimentsManager, logger);
|
54
|
+
var updateWorker = new UpdaterWorker(jobId!, experimentsManager, logger);
|
55
|
+
var worker = new RunWorker(jobId!, apiHandler, discoverWorker, analyzeWorker, updateWorker, logger);
|
56
|
+
await worker.RunAsync(jobPath!, repoContentsPath!, caseInsensitiveRepoContentsPath, baseCommitSha!, outputPath!);
|
57
|
+
return 0;
|
58
|
+
});
|
46
59
|
|
47
60
|
return command;
|
48
61
|
}
|
@@ -6,15 +6,15 @@ namespace NuGetUpdater.Cli.Commands;
|
|
6
6
|
|
7
7
|
internal static class UpdateCommand
|
8
8
|
{
|
9
|
-
internal static readonly Option<string> JobIdOption = new("--job-id") {
|
10
|
-
internal static readonly Option<FileInfo> JobPathOption = new("--job-path") {
|
11
|
-
internal static readonly Option<DirectoryInfo> RepoRootOption = new("--repo-root"
|
12
|
-
internal static readonly Option<FileInfo> SolutionOrProjectFileOption = new("--solution-or-project") {
|
13
|
-
internal static readonly Option<string> DependencyNameOption = new("--dependency") {
|
14
|
-
internal static readonly Option<string> NewVersionOption = new("--new-version") {
|
15
|
-
internal static readonly Option<string> PreviousVersionOption = new("--previous-version") {
|
16
|
-
internal static readonly Option<bool> IsTransitiveOption = new("--transitive"
|
17
|
-
internal static readonly Option<string?> ResultOutputPathOption = new("--result-output-path"
|
9
|
+
internal static readonly Option<string> JobIdOption = new("--job-id") { Required = true };
|
10
|
+
internal static readonly Option<FileInfo> JobPathOption = new("--job-path") { Required = true };
|
11
|
+
internal static readonly Option<DirectoryInfo> RepoRootOption = new("--repo-root") { DefaultValueFactory = _ => new DirectoryInfo(Environment.CurrentDirectory), Required = false };
|
12
|
+
internal static readonly Option<FileInfo> SolutionOrProjectFileOption = new("--solution-or-project") { Required = true };
|
13
|
+
internal static readonly Option<string> DependencyNameOption = new("--dependency") { Required = true };
|
14
|
+
internal static readonly Option<string> NewVersionOption = new("--new-version") { Required = true };
|
15
|
+
internal static readonly Option<string> PreviousVersionOption = new("--previous-version") { Required = true };
|
16
|
+
internal static readonly Option<bool> IsTransitiveOption = new("--transitive") { DefaultValueFactory = _ => false };
|
17
|
+
internal static readonly Option<string?> ResultOutputPathOption = new("--result-output-path") { DefaultValueFactory = _ => null };
|
18
18
|
|
19
19
|
internal static Command GetCommand(Action<int> setExitCode)
|
20
20
|
{
|
@@ -32,24 +32,25 @@ internal static class UpdateCommand
|
|
32
32
|
};
|
33
33
|
|
34
34
|
command.TreatUnmatchedTokensAsErrors = true;
|
35
|
-
command.
|
35
|
+
command.SetAction(async (parseResult, cancellationToken) =>
|
36
36
|
{
|
37
37
|
// since we have more than 8 arguments, we have to pull them out manually
|
38
|
-
var jobId =
|
39
|
-
var jobPath =
|
40
|
-
var repoRoot =
|
41
|
-
var solutionOrProjectFile =
|
42
|
-
var dependencyName =
|
43
|
-
var newVersion =
|
44
|
-
var previousVersion =
|
45
|
-
var isTransitive =
|
46
|
-
var resultOutputPath =
|
38
|
+
var jobId = parseResult.GetValue(JobIdOption)!;
|
39
|
+
var jobPath = parseResult.GetValue(JobPathOption)!;
|
40
|
+
var repoRoot = parseResult.GetValue(RepoRootOption)!;
|
41
|
+
var solutionOrProjectFile = parseResult.GetValue(SolutionOrProjectFileOption)!;
|
42
|
+
var dependencyName = parseResult.GetValue(DependencyNameOption)!;
|
43
|
+
var newVersion = parseResult.GetValue(NewVersionOption)!;
|
44
|
+
var previousVersion = parseResult.GetValue(PreviousVersionOption)!;
|
45
|
+
var isTransitive = parseResult.GetValue(IsTransitiveOption);
|
46
|
+
var resultOutputPath = parseResult.GetValue(ResultOutputPathOption);
|
47
47
|
|
48
48
|
var (experimentsManager, _error) = await ExperimentsManager.FromJobFileAsync(jobId, jobPath.FullName);
|
49
49
|
var logger = new OpenTelemetryLogger();
|
50
50
|
var worker = new UpdaterWorker(jobId, experimentsManager, logger);
|
51
51
|
await worker.RunAsync(repoRoot.FullName, solutionOrProjectFile.FullName, dependencyName, previousVersion, newVersion, isTransitive, resultOutputPath);
|
52
52
|
setExitCode(0);
|
53
|
+
return 0;
|
53
54
|
});
|
54
55
|
|
55
56
|
return command;
|
@@ -27,7 +27,8 @@ internal sealed class Program
|
|
27
27
|
};
|
28
28
|
command.TreatUnmatchedTokensAsErrors = true;
|
29
29
|
|
30
|
-
var
|
30
|
+
var parseResult = command.Parse(args);
|
31
|
+
var result = await parseResult.InvokeAsync();
|
31
32
|
|
32
33
|
return result == 0
|
33
34
|
? exitCode
|
@@ -1,3 +1,4 @@
|
|
1
|
+
using System.Collections.Immutable;
|
1
2
|
using System.Text.Json.Nodes;
|
2
3
|
|
3
4
|
namespace NuGetUpdater.Core;
|
@@ -12,28 +13,19 @@ internal sealed class GlobalJsonBuildFile : JsonBuildFile
|
|
12
13
|
{
|
13
14
|
}
|
14
15
|
|
15
|
-
public JsonObject? Sdk => Node.Value is JsonObject root ? root["sdk"]?.AsObject() : null;
|
16
|
-
|
17
16
|
public JsonObject? MSBuildSdks => Node.Value is JsonObject root ? root["msbuild-sdks"]?.AsObject() : null;
|
18
17
|
|
19
18
|
public IEnumerable<Dependency> GetDependencies()
|
20
19
|
{
|
21
|
-
List<Dependency> dependencies = [];
|
22
|
-
if (Sdk is not null
|
23
|
-
&& Sdk.TryGetPropertyValue("version", out var version))
|
24
|
-
{
|
25
|
-
dependencies.Add(GetSdkDependency("Microsoft.NET.Sdk", version));
|
26
|
-
}
|
27
|
-
|
28
20
|
if (MSBuildSdks is null)
|
29
21
|
{
|
30
|
-
return
|
22
|
+
return [];
|
31
23
|
}
|
32
24
|
|
33
25
|
var msBuildDependencies = MSBuildSdks
|
34
|
-
.Select(t => GetSdkDependency(t.Key, t.Value))
|
35
|
-
|
36
|
-
return
|
26
|
+
.Select(t => GetSdkDependency(t.Key, t.Value))
|
27
|
+
.ToImmutableArray();
|
28
|
+
return msBuildDependencies;
|
37
29
|
}
|
38
30
|
|
39
31
|
private Dependency GetSdkDependency(string name, JsonNode? version)
|
@@ -0,0 +1,12 @@
|
|
1
|
+
namespace NuGetUpdater.Core;
|
2
|
+
|
3
|
+
internal class PrivateSourceTimedOutException : Exception
|
4
|
+
{
|
5
|
+
public string Url { get; }
|
6
|
+
|
7
|
+
public PrivateSourceTimedOutException(string url)
|
8
|
+
: base($"The request to source {url} has timed out.")
|
9
|
+
{
|
10
|
+
Url = url;
|
11
|
+
}
|
12
|
+
}
|
@@ -70,10 +70,14 @@ public abstract record JobErrorBase : MessageBase
|
|
70
70
|
|
71
71
|
return new UnknownError(ex, jobId);
|
72
72
|
}
|
73
|
+
case InvalidDataException invalidData when invalidData.Message == "Central Directory corrupt.":
|
74
|
+
return new PrivateSourceBadResponse(NuGetContext.GetPackageSourceUrls(currentDirectory));
|
73
75
|
case InvalidProjectFileException invalidProjectFile:
|
74
76
|
return new DependencyFileNotParseable(invalidProjectFile.ProjectFile);
|
75
77
|
case MissingFileException missingFile:
|
76
78
|
return new DependencyFileNotFound(missingFile.FilePath, missingFile.Message);
|
79
|
+
case PrivateSourceTimedOutException timeout:
|
80
|
+
return new PrivateSourceTimedOut(timeout.Url);
|
77
81
|
case UnparseableFileException unparseableFile:
|
78
82
|
return new DependencyFileNotParseable(unparseableFile.FilePath, unparseableFile.Message);
|
79
83
|
case UpdateNotPossibleException updateNotPossible:
|
@@ -126,7 +126,7 @@ public class PullRequestTextGenerator
|
|
126
126
|
|
127
127
|
public static string GetPullRequestBody(Job job, ImmutableArray<UpdateOperationBase> updateOperationsPerformed, string? dependencyGroupName)
|
128
128
|
{
|
129
|
-
var report = UpdateOperationBase.GenerateUpdateOperationReport(updateOperationsPerformed);
|
129
|
+
var report = UpdateOperationBase.GenerateUpdateOperationReport(updateOperationsPerformed, includeFileNames: false);
|
130
130
|
return report;
|
131
131
|
}
|
132
132
|
}
|
@@ -140,7 +140,7 @@ internal class CreateSecurityUpdatePullRequestHandler : IUpdateHandler
|
|
140
140
|
updateOperationsPerformed.AddRange(patchedUpdateOperations);
|
141
141
|
foreach (var o in patchedUpdateOperations)
|
142
142
|
{
|
143
|
-
logger.Info($"Update operation performed: {o.GetReport()}");
|
143
|
+
logger.Info($"Update operation performed: {o.GetReport(includeFileNames: true)}");
|
144
144
|
}
|
145
145
|
}
|
146
146
|
}
|
data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/UpdateHandlers/GroupUpdateAllVersionsHandler.cs
CHANGED
@@ -143,7 +143,7 @@ internal class GroupUpdateAllVersionsHandler : IUpdateHandler
|
|
143
143
|
updateOperationsPerformed.AddRange(patchedUpdateOperations);
|
144
144
|
foreach (var o in patchedUpdateOperations)
|
145
145
|
{
|
146
|
-
logger.Info($"Update operation performed: {o.GetReport()}");
|
146
|
+
logger.Info($"Update operation performed: {o.GetReport(includeFileNames: true)}");
|
147
147
|
}
|
148
148
|
}
|
149
149
|
|
@@ -242,7 +242,7 @@ internal class GroupUpdateAllVersionsHandler : IUpdateHandler
|
|
242
242
|
updateOperationsPerformed.AddRange(patchedUpdateOperations);
|
243
243
|
foreach (var o in patchedUpdateOperations)
|
244
244
|
{
|
245
|
-
logger.Info($"Update operation performed: {o.GetReport()}");
|
245
|
+
logger.Info($"Update operation performed: {o.GetReport(includeFileNames: true)}");
|
246
246
|
}
|
247
247
|
}
|
248
248
|
|
@@ -137,7 +137,7 @@ internal class RefreshGroupUpdatePullRequestHandler : IUpdateHandler
|
|
137
137
|
updateOperationsPerformed.AddRange(patchedUpdateOperations);
|
138
138
|
foreach (var o in patchedUpdateOperations)
|
139
139
|
{
|
140
|
-
logger.Info($"Update operation performed: {o.GetReport()}");
|
140
|
+
logger.Info($"Update operation performed: {o.GetReport(includeFileNames: true)}");
|
141
141
|
}
|
142
142
|
}
|
143
143
|
}
|
@@ -135,7 +135,7 @@ internal class RefreshSecurityUpdatePullRequestHandler : IUpdateHandler
|
|
135
135
|
updateOperationsPerformed.AddRange(patchedUpdateOperations);
|
136
136
|
foreach (var o in patchedUpdateOperations)
|
137
137
|
{
|
138
|
-
logger.Info($"Update operation performed: {o.GetReport()}");
|
138
|
+
logger.Info($"Update operation performed: {o.GetReport(includeFileNames: true)}");
|
139
139
|
}
|
140
140
|
}
|
141
141
|
}
|
@@ -125,7 +125,7 @@ internal class RefreshVersionUpdatePullRequestHandler : IUpdateHandler
|
|
125
125
|
updateOperationsPerformed.AddRange(patchedUpdateOperations);
|
126
126
|
foreach (var o in patchedUpdateOperations)
|
127
127
|
{
|
128
|
-
logger.Info($"Update operation performed: {o.GetReport()}");
|
128
|
+
logger.Info($"Update operation performed: {o.GetReport(includeFileNames: true)}");
|
129
129
|
}
|
130
130
|
}
|
131
131
|
}
|