dependabot-nuget 0.321.3 → 0.322.1
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.Cli.Test/EntryPointTests.Analyze.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli.Test/EntryPointTests.Discover.cs +10 -23
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli.Test/EntryPointTests.Run.cs +9 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli.Test/EntryPointTests.Update.cs +15 -232
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/SdkProjectDiscovery.cs +1 -154
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/ExperimentsManager.cs +3 -12
- 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/PullRequestBodyGenerator/AzurePackageDetailFinder.cs +30 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/PullRequestBodyGenerator/DetailedPullRequestBodyGenerator.cs +237 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/PullRequestBodyGenerator/GitHubPackageDetailFinder.cs +101 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/PullRequestBodyGenerator/GitLabPackageDetailFinder.cs +107 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/PullRequestBodyGenerator/HttpFetcher.cs +32 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/PullRequestBodyGenerator/IHttpFetcher.cs +30 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/PullRequestBodyGenerator/IPackageDetailFinder.cs +47 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/PullRequestBodyGenerator/IPullRequestBodyGenerator.cs +11 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/PullRequestBodyGenerator/SimplePullRequestBodyGenerator.cs +15 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/PullRequestTextGenerator.cs +7 -3
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/RunWorker.cs +3 -525
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/UpdateHandlers/CreateSecurityUpdatePullRequestHandler.cs +2 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/UpdateHandlers/GroupUpdateAllVersionsHandler.cs +4 -4
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/UpdateHandlers/RefreshGroupUpdatePullRequestHandler.cs +2 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/UpdateHandlers/RefreshSecurityUpdatePullRequestHandler.cs +2 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/UpdateHandlers/RefreshVersionUpdatePullRequestHandler.cs +2 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/FileWriters/FileWriterWorker.cs +85 -35
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/FileWriters/XmlFileWriter.cs +27 -8
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/PackageReferenceUpdater.cs +1 -856
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/UpdateOperationBase.cs +18 -7
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/UpdaterWorker.cs +16 -200
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/MSBuildHelper.cs +21 -556
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Analyze/AnalyzeWorkerTests.cs +9 -73
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Clone/CloneWorkerTests.cs +2 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/DependencySolver/MSBuildDependencySolverTests.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTestBase.cs +1 -20
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.GlobalJson.cs +0 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.PackagesConfig.cs +3 -62
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.Project.cs +13 -563
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.cs +20 -269
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/SdkProjectDiscoveryTests.cs +2 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Files/GlobalJsonBuildFileTests.cs +0 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/EndToEndTests.cs +131 -131
- 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/MiscellaneousTests.cs +0 -203
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/PullRequestBodyGenerator/DetailedPullRequestBodyGeneratorTests.cs +871 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/PullRequestBodyGenerator/IPackageDetailFinderTests.cs +28 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/PullRequestBodyGenerator/TestHttpFetcher.cs +23 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/PullRequestTextTests.cs +24 -24
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/SerializationTests.cs +14 -12
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/UpdateHandlers/CreateSecurityUpdatePullRequestHandlerTests.cs +6 -6
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/UpdateHandlers/GroupUpdateAllVersionsHandlerTests.cs +18 -18
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/UpdateHandlers/RefreshGroupUpdatePullRequestHandlerTests.cs +15 -15
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/UpdateHandlers/RefreshSecurityUpdatePullRequestHandlerTests.cs +21 -21
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/UpdateHandlers/RefreshVersionUpdatePullRequestHandlerTests.cs +15 -15
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/UpdateHandlers/UpdateHandlersTestsBase.cs +1 -8
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/FileWriters/FileWriterWorkerTests.cs +2 -2
- 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 +111 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/PackageReferenceUpdaterTests.cs +1 -159
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs +26 -660
- data/helpers/lib/NuGetUpdater/global.json +1 -1
- metadata +18 -10
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/RunResult.cs +0 -13
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/PullRequestMessageTests.cs +0 -296
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/RunWorkerTests.cs +0 -3592
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/UpdatePermittedAndMessageTests.cs +0 -457
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.DirsProj.cs +0 -378
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/SdkPackageUpdaterHelperTests.cs +0 -175
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 608db6312847c8b17ba8d4487ad0959d2c600965ac9a6125d747c220b53b54b2
|
4
|
+
data.tar.gz: b60ee9bb959e0fd7f28cee03715ae92e44c95628ced1c0995031cc251cdf2248
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab0e8f7d5004717780eb170d7400c5cb5a8d3754bc5048f763c55a5c41e22883467c64a3b8ceae5d44141d9879abc83245e0af023f24d0720fa83f2d78ce5076
|
7
|
+
data.tar.gz: aaa8de59bd6a7741139c095f62527bdb64d76e23e64f1ab224ef8548d9847e72edf34e1dd6089ec7a0042798bcc1e51f63deb05b065267c96f4678aca6bdf8ab
|
@@ -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
|
@@ -135,7 +135,7 @@ public partial class EntryPointTests
|
|
135
135
|
VersionComesFromMultiDependencyProperty = false,
|
136
136
|
UpdatedDependencies =
|
137
137
|
[
|
138
|
-
new Dependency("Some.Package", "1.0.1", DependencyType.
|
138
|
+
new Dependency("Some.Package", "1.0.1", DependencyType.PackageReference, TargetFrameworks: ["net8.0"], IsDirect: true, InfoUrl: "https://nuget.example.com/some.package")
|
139
139
|
],
|
140
140
|
}
|
141
141
|
);
|
@@ -18,10 +18,8 @@ public partial class EntryPointTests
|
|
18
18
|
{
|
19
19
|
public class Discover : DiscoveryWorkerTestBase
|
20
20
|
{
|
21
|
-
[
|
22
|
-
|
23
|
-
[InlineData(false)]
|
24
|
-
public async Task PathWithSpaces(bool useDirectDiscovery)
|
21
|
+
[Fact]
|
22
|
+
public async Task PathWithSpaces()
|
25
23
|
{
|
26
24
|
await RunAsync(path =>
|
27
25
|
[
|
@@ -37,7 +35,6 @@ public partial class EntryPointTests
|
|
37
35
|
"--output",
|
38
36
|
Path.Combine(path, DiscoveryWorker.DiscoveryResultFileName),
|
39
37
|
],
|
40
|
-
experimentsManager: new ExperimentsManager() { UseDirectDiscovery = useDirectDiscovery },
|
41
38
|
packages:
|
42
39
|
[
|
43
40
|
MockNuGetPackage.CreateSimplePackage("Some.Package", "1.2.3", "net8.0"),
|
@@ -78,10 +75,8 @@ public partial class EntryPointTests
|
|
78
75
|
);
|
79
76
|
}
|
80
77
|
|
81
|
-
[
|
82
|
-
|
83
|
-
[InlineData(false)]
|
84
|
-
public async Task WithSolution(bool useDirectDiscovery)
|
78
|
+
[Fact]
|
79
|
+
public async Task WithSolution()
|
85
80
|
{
|
86
81
|
await RunAsync(path =>
|
87
82
|
[
|
@@ -97,7 +92,6 @@ public partial class EntryPointTests
|
|
97
92
|
"--output",
|
98
93
|
Path.Combine(path, DiscoveryWorker.DiscoveryResultFileName),
|
99
94
|
],
|
100
|
-
experimentsManager: new ExperimentsManager() { UseDirectDiscovery = useDirectDiscovery },
|
101
95
|
packages:
|
102
96
|
[
|
103
97
|
MockNuGetPackage.CreateSimplePackage("Some.Package", "7.0.1", "net45"),
|
@@ -175,10 +169,8 @@ public partial class EntryPointTests
|
|
175
169
|
);
|
176
170
|
}
|
177
171
|
|
178
|
-
[
|
179
|
-
|
180
|
-
[InlineData(false)]
|
181
|
-
public async Task WithProject(bool useDirectDiscovery)
|
172
|
+
[Fact]
|
173
|
+
public async Task WithProject()
|
182
174
|
{
|
183
175
|
await RunAsync(path =>
|
184
176
|
[
|
@@ -194,7 +186,6 @@ public partial class EntryPointTests
|
|
194
186
|
"--output",
|
195
187
|
Path.Combine(path, DiscoveryWorker.DiscoveryResultFileName),
|
196
188
|
],
|
197
|
-
experimentsManager: new ExperimentsManager() { UseDirectDiscovery = useDirectDiscovery },
|
198
189
|
packages:
|
199
190
|
[
|
200
191
|
MockNuGetPackage.CreateSimplePackage("Some.Package", "7.0.1", "net45"),
|
@@ -249,10 +240,8 @@ public partial class EntryPointTests
|
|
249
240
|
);
|
250
241
|
}
|
251
242
|
|
252
|
-
[
|
253
|
-
|
254
|
-
[InlineData(false)]
|
255
|
-
public async Task WithDirectory(bool useDirectDiscovery)
|
243
|
+
[Fact]
|
244
|
+
public async Task WithDirectory()
|
256
245
|
{
|
257
246
|
var workspacePath = "path/to/";
|
258
247
|
await RunAsync(path =>
|
@@ -269,7 +258,6 @@ public partial class EntryPointTests
|
|
269
258
|
"--output",
|
270
259
|
Path.Combine(path, DiscoveryWorker.DiscoveryResultFileName),
|
271
260
|
],
|
272
|
-
experimentsManager: new ExperimentsManager() { UseDirectDiscovery = useDirectDiscovery },
|
273
261
|
packages:
|
274
262
|
[
|
275
263
|
MockNuGetPackage.CreateSimplePackage("Some.Package", "7.0.1", "net45"),
|
@@ -365,7 +353,6 @@ public partial class EntryPointTests
|
|
365
353
|
</Project>
|
366
354
|
""")
|
367
355
|
},
|
368
|
-
experimentsManager: new ExperimentsManager() { UseDirectDiscovery = true },
|
369
356
|
packages:
|
370
357
|
[
|
371
358
|
MockNuGetPackage.CreateSimplePackage("Package.A", "1.2.3", "net8.0"),
|
@@ -405,7 +392,7 @@ public partial class EntryPointTests
|
|
405
392
|
using var testDirectory = new TemporaryDirectory();
|
406
393
|
var jobFilePath = Path.Combine(testDirectory.DirectoryPath, "job.json");
|
407
394
|
var resultFilePath = Path.Combine(testDirectory.DirectoryPath, DiscoveryWorker.DiscoveryResultFileName);
|
408
|
-
await File.WriteAllTextAsync(jobFilePath, "not json");
|
395
|
+
await File.WriteAllTextAsync(jobFilePath, "not json", TestContext.Current.CancellationToken);
|
409
396
|
await RunAsync(path =>
|
410
397
|
[
|
411
398
|
"discover",
|
@@ -453,7 +440,7 @@ public partial class EntryPointTests
|
|
453
440
|
]
|
454
441
|
}
|
455
442
|
}
|
456
|
-
""");
|
443
|
+
""", TestContext.Current.CancellationToken);
|
457
444
|
await RunAsync(path =>
|
458
445
|
[
|
459
446
|
"discover",
|
@@ -28,6 +28,15 @@ public partial class EntryPointTests
|
|
28
28
|
],
|
29
29
|
files:
|
30
30
|
[
|
31
|
+
("Directory.Build.props", "<Project />"),
|
32
|
+
("Directory.Build.targets", "<Project />"),
|
33
|
+
("Directory.Packages.props", """
|
34
|
+
<Project>
|
35
|
+
<PropertyGroup>
|
36
|
+
<ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
|
37
|
+
</PropertyGroup>
|
38
|
+
</Project>
|
39
|
+
"""),
|
31
40
|
("src/project.csproj", """
|
32
41
|
<Project Sdk="Microsoft.NET.Sdk">
|
33
42
|
<PropertyGroup>
|