dependabot-nuget 0.342.2 → 0.343.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/NuGetUpdater.Core/Run/ApiModel/JobErrorBase.cs +5 -5
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/PrivateSourceBadResponse.cs +16 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/PullRequest.cs +4 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/PullRequestConverter.cs +28 -8
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/UpdateHandlers/GroupUpdateAllVersionsHandler.cs +12 -9
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Analyze/VersionFinderTests.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.cs +2 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/HttpApiHandlerTests.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/JobErrorBaseTests.cs +13 -6
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/MessageReportTests.cs +2 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/SerializationTests.cs +37 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/UpdateHandlers/GroupUpdateAllVersionsHandlerTests.cs +179 -6
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs +4 -4
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 79344385eec91d92a3c7182eb639186693399069d4c3c761528fe5090633a7ca
|
|
4
|
+
data.tar.gz: 174ba03152133f0c03fe6da96cae0b110b6f7642482c325be3dfab2a397b261f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 38b2c7817daaca765ff4f7736da12e50fc71d8a22d2e680ac740e26d106d79f2fea17b8f68ab35748dbb15dae2b966937b0120a2a8138958b85cf2652982b6c2
|
|
7
|
+
data.tar.gz: 30e4eebd3db7f09e8b9c6af6bbbfdee7a1456e0c1a001ef774ed71f9bfbba85bd9680623489a5e9893c942b7d2490051465d66b92932492eb8ec39f7d5a4b432
|
|
@@ -38,7 +38,7 @@ public abstract record JobErrorBase : MessageBase
|
|
|
38
38
|
case BadRequirementException badRequirement:
|
|
39
39
|
return new BadRequirement(badRequirement.Message);
|
|
40
40
|
case BadResponseException badResponse:
|
|
41
|
-
return new PrivateSourceBadResponse([badResponse.Uri]);
|
|
41
|
+
return new PrivateSourceBadResponse([badResponse.Uri], badResponse.Message);
|
|
42
42
|
case DependencyNotFoundException dependencyNotFound:
|
|
43
43
|
return new DependencyNotFound(string.Join(", ", dependencyNotFound.Dependencies));
|
|
44
44
|
case HttpRequestException httpRequest:
|
|
@@ -48,7 +48,7 @@ public abstract record JobErrorBase : MessageBase
|
|
|
48
48
|
ioException.HttpRequestError == HttpRequestError.ResponseEnded)
|
|
49
49
|
{
|
|
50
50
|
// server hung up on us
|
|
51
|
-
return new PrivateSourceBadResponse(NuGetContext.GetPackageSourceUrls(currentDirectory));
|
|
51
|
+
return new PrivateSourceBadResponse(NuGetContext.GetPackageSourceUrls(currentDirectory), ioException.Message);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
return new UnknownError(ex, jobId);
|
|
@@ -61,17 +61,17 @@ public abstract record JobErrorBase : MessageBase
|
|
|
61
61
|
return new PrivateSourceAuthenticationFailure(NuGetContext.GetPackageSourceUrls(currentDirectory));
|
|
62
62
|
case HttpStatusCode.TooManyRequests:
|
|
63
63
|
case HttpStatusCode.ServiceUnavailable:
|
|
64
|
-
return new PrivateSourceBadResponse(NuGetContext.GetPackageSourceUrls(currentDirectory));
|
|
64
|
+
return new PrivateSourceBadResponse(NuGetContext.GetPackageSourceUrls(currentDirectory), httpRequest.Message);
|
|
65
65
|
default:
|
|
66
66
|
if ((int)httpRequest.StatusCode / 100 == 5)
|
|
67
67
|
{
|
|
68
|
-
return new PrivateSourceBadResponse(NuGetContext.GetPackageSourceUrls(currentDirectory));
|
|
68
|
+
return new PrivateSourceBadResponse(NuGetContext.GetPackageSourceUrls(currentDirectory), httpRequest.Message);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
return new UnknownError(ex, jobId);
|
|
72
72
|
}
|
|
73
73
|
case InvalidDataException invalidData when invalidData.Message == "Central Directory corrupt.":
|
|
74
|
-
return new PrivateSourceBadResponse(NuGetContext.GetPackageSourceUrls(currentDirectory));
|
|
74
|
+
return new PrivateSourceBadResponse(NuGetContext.GetPackageSourceUrls(currentDirectory), invalidData.Message);
|
|
75
75
|
case InvalidProjectFileException invalidProjectFile:
|
|
76
76
|
return new DependencyFileNotParseable(invalidProjectFile.ProjectFile);
|
|
77
77
|
case MissingFileException missingFile:
|
|
@@ -1,10 +1,25 @@
|
|
|
1
|
+
using System.Text.Json.Serialization;
|
|
2
|
+
|
|
1
3
|
namespace NuGetUpdater.Core.Run.ApiModel;
|
|
2
4
|
|
|
3
5
|
public record PrivateSourceBadResponse : JobErrorBase
|
|
4
6
|
{
|
|
5
|
-
|
|
7
|
+
[JsonIgnore]
|
|
8
|
+
public string Message { get; }
|
|
9
|
+
|
|
10
|
+
public PrivateSourceBadResponse(string[] urls, string message)
|
|
6
11
|
: base("private_source_bad_response")
|
|
7
12
|
{
|
|
8
13
|
Details["source"] = $"({string.Join("|", urls)})";
|
|
14
|
+
Message = message;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
public override string GetReport()
|
|
18
|
+
{
|
|
19
|
+
var report = base.GetReport();
|
|
20
|
+
|
|
21
|
+
// this extra info isn't part of the reported shape but is useful to have in the log
|
|
22
|
+
var fullReport = string.Concat(report, "\n", $"- message: {Message}");
|
|
23
|
+
return fullReport;
|
|
9
24
|
}
|
|
10
25
|
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
using System.Collections.Immutable;
|
|
2
|
+
using System.Text.Json.Serialization;
|
|
2
3
|
|
|
3
4
|
namespace NuGetUpdater.Core.Run.ApiModel;
|
|
4
5
|
|
|
5
6
|
public record PullRequest
|
|
6
7
|
{
|
|
8
|
+
[JsonPropertyName("pr-number")]
|
|
9
|
+
public int? PrNumber { get; init; } = null;
|
|
10
|
+
[JsonPropertyName("dependencies")]
|
|
7
11
|
public ImmutableArray<PullRequestDependency> Dependencies { get; init; } = [];
|
|
8
12
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
using System.Collections.Immutable;
|
|
2
2
|
using System.Text.Json;
|
|
3
3
|
using System.Text.Json.Serialization;
|
|
4
4
|
|
|
@@ -10,16 +10,36 @@ public class PullRequestConverter : JsonConverter<PullRequest>
|
|
|
10
10
|
{
|
|
11
11
|
public override PullRequest? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
|
12
12
|
{
|
|
13
|
-
|
|
13
|
+
PullRequest? result;
|
|
14
|
+
switch (reader.TokenType)
|
|
14
15
|
{
|
|
15
|
-
|
|
16
|
+
case JsonTokenType.StartArray:
|
|
17
|
+
// old format, array of arrays of dependencies
|
|
18
|
+
var dependencies = JsonSerializer.Deserialize<ImmutableArray<PullRequestDependency>>(ref reader, options);
|
|
19
|
+
result = new PullRequest()
|
|
20
|
+
{
|
|
21
|
+
Dependencies = dependencies
|
|
22
|
+
};
|
|
23
|
+
break;
|
|
24
|
+
case JsonTokenType.StartObject:
|
|
25
|
+
// new format, direct object
|
|
26
|
+
// use the same deserializer options but exclude this special converter
|
|
27
|
+
var optionsWithoutThisCustomConverter = new JsonSerializerOptions(options);
|
|
28
|
+
for (int i = optionsWithoutThisCustomConverter.Converters.Count - 1; i >= 0; i--)
|
|
29
|
+
{
|
|
30
|
+
if (optionsWithoutThisCustomConverter.Converters[i].GetType() == typeof(PullRequestConverter))
|
|
31
|
+
{
|
|
32
|
+
optionsWithoutThisCustomConverter.Converters.RemoveAt(i);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
result = JsonSerializer.Deserialize<PullRequest>(ref reader, optionsWithoutThisCustomConverter);
|
|
37
|
+
break;
|
|
38
|
+
default:
|
|
39
|
+
throw new JsonException("expected pull request object or array of pull request dependencies");
|
|
16
40
|
}
|
|
17
41
|
|
|
18
|
-
|
|
19
|
-
return new PullRequest()
|
|
20
|
-
{
|
|
21
|
-
Dependencies = dependencies
|
|
22
|
-
};
|
|
42
|
+
return result;
|
|
23
43
|
}
|
|
24
44
|
|
|
25
45
|
public override void Write(Utf8JsonWriter writer, PullRequest value, JsonSerializerOptions options)
|
data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/UpdateHandlers/GroupUpdateAllVersionsHandler.cs
CHANGED
|
@@ -42,14 +42,8 @@ internal class GroupUpdateAllVersionsHandler : IUpdateHandler
|
|
|
42
42
|
// group update, do all directories and merge
|
|
43
43
|
// ungrouped update, do each dir separate
|
|
44
44
|
await this.ReportUpdaterStarted(apiHandler);
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
await RunGroupedDependencyUpdates(job, originalRepoContentsPath, caseInsensitiveRepoContentsPath, baseCommitSha, discoveryWorker, analyzeWorker, updaterWorker, apiHandler, experimentsManager, logger);
|
|
48
|
-
}
|
|
49
|
-
else
|
|
50
|
-
{
|
|
51
|
-
await RunUngroupedDependencyUpdates(job, originalRepoContentsPath, caseInsensitiveRepoContentsPath, baseCommitSha, discoveryWorker, analyzeWorker, updaterWorker, apiHandler, experimentsManager, logger);
|
|
52
|
-
}
|
|
45
|
+
await RunGroupedDependencyUpdates(job, originalRepoContentsPath, caseInsensitiveRepoContentsPath, baseCommitSha, discoveryWorker, analyzeWorker, updaterWorker, apiHandler, experimentsManager, logger);
|
|
46
|
+
await RunUngroupedDependencyUpdates(job, originalRepoContentsPath, caseInsensitiveRepoContentsPath, baseCommitSha, discoveryWorker, analyzeWorker, updaterWorker, apiHandler, experimentsManager, logger);
|
|
53
47
|
}
|
|
54
48
|
|
|
55
49
|
private async Task RunGroupedDependencyUpdates(Job job, DirectoryInfo originalRepoContentsPath, DirectoryInfo? caseInsensitiveRepoContentsPath, string baseCommitSha, IDiscoveryWorker discoveryWorker, IAnalyzeWorker analyzeWorker, IUpdaterWorker updaterWorker, IApiHandler apiHandler, ExperimentsManager experimentsManager, ILogger logger)
|
|
@@ -146,7 +140,7 @@ internal class GroupUpdateAllVersionsHandler : IUpdateHandler
|
|
|
146
140
|
}
|
|
147
141
|
}
|
|
148
142
|
|
|
149
|
-
var updatedDependencyFiles = await tracker.StopTrackingAsync();
|
|
143
|
+
var updatedDependencyFiles = await tracker.StopTrackingAsync(restoreOriginalContents: true);
|
|
150
144
|
allUpdatedDependencyFiles = ModifiedFilesTracker.MergeUpdatedFileSet(allUpdatedDependencyFiles, updatedDependencyFiles);
|
|
151
145
|
}
|
|
152
146
|
|
|
@@ -207,6 +201,15 @@ internal class GroupUpdateAllVersionsHandler : IUpdateHandler
|
|
|
207
201
|
continue;
|
|
208
202
|
}
|
|
209
203
|
|
|
204
|
+
var matchingGroups = job.DependencyGroups
|
|
205
|
+
.Where(group => group.GetGroupMatcher().IsMatch(dependency.Name))
|
|
206
|
+
.ToImmutableArray();
|
|
207
|
+
if (matchingGroups.Length > 0)
|
|
208
|
+
{
|
|
209
|
+
logger.Info($"Dependency {dependency.Name} skipped for ungrouped updates because it's a member of the following groups: {string.Join(", ", matchingGroups.Select(group => group.Name))}");
|
|
210
|
+
continue;
|
|
211
|
+
}
|
|
212
|
+
|
|
210
213
|
var dependencyInfo = RunWorker.GetDependencyInfo(job, dependency, allowCooldown: true);
|
|
211
214
|
var analysisResult = await analyzeWorker.RunAsync(repoContentsPath.FullName, discoveryResult, dependencyInfo);
|
|
212
215
|
if (analysisResult.Error is not null)
|
|
@@ -293,7 +293,7 @@ public class VersionFinderTests : TestBase
|
|
|
293
293
|
var error = JobErrorBase.ErrorFromException(exception, "TEST-JOB-ID", tempDir.DirectoryPath);
|
|
294
294
|
|
|
295
295
|
// assert
|
|
296
|
-
var expected = new PrivateSourceBadResponse([feedUrl]);
|
|
296
|
+
var expected = new PrivateSourceBadResponse([feedUrl], "unused");
|
|
297
297
|
var expectedJson = JsonSerializer.Serialize(expected, RunWorker.SerializerOptions);
|
|
298
298
|
var actualJson = JsonSerializer.Serialize(error, RunWorker.SerializerOptions);
|
|
299
299
|
Assert.Equal(expectedJson, actualJson);
|
|
@@ -1124,7 +1124,7 @@ public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
|
|
|
1124
1124
|
],
|
|
1125
1125
|
expectedResult: new()
|
|
1126
1126
|
{
|
|
1127
|
-
Error = new PrivateSourceBadResponse([$"{http.BaseUrl.TrimEnd('/')}/index.json"]),
|
|
1127
|
+
Error = new PrivateSourceBadResponse([$"{http.BaseUrl.TrimEnd('/')}/index.json"], "unused"),
|
|
1128
1128
|
Path = "",
|
|
1129
1129
|
Projects = [],
|
|
1130
1130
|
}
|
|
@@ -1199,7 +1199,7 @@ public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
|
|
|
1199
1199
|
],
|
|
1200
1200
|
expectedResult: new()
|
|
1201
1201
|
{
|
|
1202
|
-
Error = new PrivateSourceBadResponse([$"{http.BaseUrl.TrimEnd('/')}/index.json"]),
|
|
1202
|
+
Error = new PrivateSourceBadResponse([$"{http.BaseUrl.TrimEnd('/')}/index.json"], "unused"),
|
|
1203
1203
|
Path = "",
|
|
1204
1204
|
Projects = [],
|
|
1205
1205
|
}
|
|
@@ -148,7 +148,7 @@ public class HttpApiHandlerTests
|
|
|
148
148
|
yield return [new DependencyNotFound("unused"), "record_update_job_error"];
|
|
149
149
|
yield return [new JobRepoNotFound("unused"), "record_update_job_error"];
|
|
150
150
|
yield return [new PrivateSourceAuthenticationFailure(["unused"]), "record_update_job_error"];
|
|
151
|
-
yield return [new PrivateSourceBadResponse(["unused"]), "record_update_job_error"];
|
|
151
|
+
yield return [new PrivateSourceBadResponse(["unused"], "unused"), "record_update_job_error"];
|
|
152
152
|
yield return [new PrivateSourceTimedOut("unused"), "record_update_job_error"];
|
|
153
153
|
yield return [new PullRequestExistsForLatestVersion("unused", "unused"), "record_update_job_error"];
|
|
154
154
|
yield return [new PullRequestExistsForSecurityUpdate([]), "record_update_job_error"];
|
|
@@ -40,32 +40,39 @@ public class JobErrorBaseTests : TestBase
|
|
|
40
40
|
|
|
41
41
|
public static IEnumerable<object[]> GenerateErrorFromExceptionTestData()
|
|
42
42
|
{
|
|
43
|
+
// something elevated to a bad response
|
|
44
|
+
yield return
|
|
45
|
+
[
|
|
46
|
+
new BadResponseException("nope", "http://nuget.example.com/v3/index.json"),
|
|
47
|
+
new PrivateSourceBadResponse(["http://nuget.example.com/v3/index.json"], "nope"),
|
|
48
|
+
];
|
|
49
|
+
|
|
43
50
|
// internal error from package feed
|
|
44
51
|
yield return
|
|
45
52
|
[
|
|
46
53
|
new HttpRequestException("nope", null, HttpStatusCode.InternalServerError),
|
|
47
|
-
new PrivateSourceBadResponse(["http://nuget.example.com/v3/index.json"]),
|
|
54
|
+
new PrivateSourceBadResponse(["http://nuget.example.com/v3/index.json"], "nope"),
|
|
48
55
|
];
|
|
49
56
|
|
|
50
57
|
// inner exception turns into private_source_bad_response; 500
|
|
51
58
|
yield return
|
|
52
59
|
[
|
|
53
|
-
new FatalProtocolException("nope", new HttpRequestException("nope", null, HttpStatusCode.InternalServerError)),
|
|
54
|
-
new PrivateSourceBadResponse(["http://nuget.example.com/v3/index.json"]),
|
|
60
|
+
new FatalProtocolException("nope", new HttpRequestException("inner nope", null, HttpStatusCode.InternalServerError)),
|
|
61
|
+
new PrivateSourceBadResponse(["http://nuget.example.com/v3/index.json"], "inner nope"),
|
|
55
62
|
];
|
|
56
63
|
|
|
57
64
|
// inner exception turns into private_source_bad_response; ResponseEnded
|
|
58
65
|
yield return
|
|
59
66
|
[
|
|
60
|
-
new FatalProtocolException("nope", new HttpRequestException("nope", new HttpIOException(HttpRequestError.ResponseEnded))),
|
|
61
|
-
new PrivateSourceBadResponse(["http://nuget.example.com/v3/index.json"]),
|
|
67
|
+
new FatalProtocolException("nope", new HttpRequestException("inner nope", new HttpIOException(HttpRequestError.ResponseEnded))),
|
|
68
|
+
new PrivateSourceBadResponse(["http://nuget.example.com/v3/index.json"], "inner nope"),
|
|
62
69
|
];
|
|
63
70
|
|
|
64
71
|
// service returned corrupt package
|
|
65
72
|
yield return
|
|
66
73
|
[
|
|
67
74
|
new InvalidDataException("Central Directory corrupt."),
|
|
68
|
-
new PrivateSourceBadResponse(["http://nuget.example.com/v3/index.json"]),
|
|
75
|
+
new PrivateSourceBadResponse(["http://nuget.example.com/v3/index.json"], "Central Directory corrupt."),
|
|
69
76
|
];
|
|
70
77
|
|
|
71
78
|
// top-level exception turns into private_source_authentication_failure
|
|
@@ -152,11 +152,12 @@ public class MessageReportTests
|
|
|
152
152
|
yield return
|
|
153
153
|
[
|
|
154
154
|
// message
|
|
155
|
-
new PrivateSourceBadResponse(["url1", "url2"]),
|
|
155
|
+
new PrivateSourceBadResponse(["url1", "url2"], "some extra info"),
|
|
156
156
|
// expected
|
|
157
157
|
"""
|
|
158
158
|
Error type: private_source_bad_response
|
|
159
159
|
- source: (url1|url2)
|
|
160
|
+
- message: some extra info
|
|
160
161
|
"""
|
|
161
162
|
];
|
|
162
163
|
|
|
@@ -407,7 +407,7 @@ public class SerializationTests : TestBase
|
|
|
407
407
|
}
|
|
408
408
|
|
|
409
409
|
[Fact]
|
|
410
|
-
public void
|
|
410
|
+
public void DeserializeExistingPullRequestsOldFormat()
|
|
411
411
|
{
|
|
412
412
|
var jsonWrapperJson = """
|
|
413
413
|
{
|
|
@@ -429,6 +429,41 @@ public class SerializationTests : TestBase
|
|
|
429
429
|
""";
|
|
430
430
|
var jobWrapper = RunWorker.Deserialize(jsonWrapperJson)!;
|
|
431
431
|
Assert.Single(jobWrapper.Job.ExistingPullRequests);
|
|
432
|
+
Assert.Null(jobWrapper.Job.ExistingPullRequests[0].PrNumber);
|
|
433
|
+
Assert.Single(jobWrapper.Job.ExistingPullRequests[0].Dependencies);
|
|
434
|
+
Assert.Equal("Some.Package", jobWrapper.Job.ExistingPullRequests[0].Dependencies[0].DependencyName);
|
|
435
|
+
Assert.Equal(NuGetVersion.Parse("1.2.3"), jobWrapper.Job.ExistingPullRequests[0].Dependencies[0].DependencyVersion);
|
|
436
|
+
Assert.False(jobWrapper.Job.ExistingPullRequests[0].Dependencies[0].DependencyRemoved);
|
|
437
|
+
Assert.Null(jobWrapper.Job.ExistingPullRequests[0].Dependencies[0].Directory);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
[Fact]
|
|
441
|
+
public void DeserializeExistingPullRequestsNewFormat()
|
|
442
|
+
{
|
|
443
|
+
var jsonWrapperJson = """
|
|
444
|
+
{
|
|
445
|
+
"job": {
|
|
446
|
+
"source": {
|
|
447
|
+
"provider": "github",
|
|
448
|
+
"repo": "some/repo"
|
|
449
|
+
},
|
|
450
|
+
"existing-pull-requests": [
|
|
451
|
+
{
|
|
452
|
+
"pr-number": 123,
|
|
453
|
+
"dependencies": [
|
|
454
|
+
{
|
|
455
|
+
"dependency-name": "Some.Package",
|
|
456
|
+
"dependency-version": "1.2.3"
|
|
457
|
+
}
|
|
458
|
+
]
|
|
459
|
+
}
|
|
460
|
+
]
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
""";
|
|
464
|
+
var jobWrapper = RunWorker.Deserialize(jsonWrapperJson)!;
|
|
465
|
+
Assert.Single(jobWrapper.Job.ExistingPullRequests);
|
|
466
|
+
Assert.Equal(123, jobWrapper.Job.ExistingPullRequests[0].PrNumber);
|
|
432
467
|
Assert.Single(jobWrapper.Job.ExistingPullRequests[0].Dependencies);
|
|
433
468
|
Assert.Equal("Some.Package", jobWrapper.Job.ExistingPullRequests[0].Dependencies[0].DependencyName);
|
|
434
469
|
Assert.Equal(NuGetVersion.Parse("1.2.3"), jobWrapper.Job.ExistingPullRequests[0].Dependencies[0].DependencyVersion);
|
|
@@ -766,7 +801,7 @@ public class SerializationTests : TestBase
|
|
|
766
801
|
|
|
767
802
|
yield return
|
|
768
803
|
[
|
|
769
|
-
new PrivateSourceBadResponse(["url1", "url2"]),
|
|
804
|
+
new PrivateSourceBadResponse(["url1", "url2"], "unused"),
|
|
770
805
|
"""
|
|
771
806
|
{"data":{"error-type":"private_source_bad_response","error-details":{"source":"(url1|url2)"}}}
|
|
772
807
|
"""
|
|
@@ -270,7 +270,7 @@ public class GroupUpdateAllVersionsHandlerTests : UpdateHandlersTestsBase
|
|
|
270
270
|
}
|
|
271
271
|
|
|
272
272
|
[Fact]
|
|
273
|
-
public async Task
|
|
273
|
+
public async Task GeneratesCreatePullRequest_GroupedAndUngrouped()
|
|
274
274
|
{
|
|
275
275
|
// single groups specified; creates 1 PR for both directories
|
|
276
276
|
await TestAsync(
|
|
@@ -284,7 +284,7 @@ public class GroupUpdateAllVersionsHandlerTests : UpdateHandlersTestsBase
|
|
|
284
284
|
Rules = new()
|
|
285
285
|
{
|
|
286
286
|
["patterns"] = new[] { "*" },
|
|
287
|
-
["exclude-patterns"] = new[] { "
|
|
287
|
+
["exclude-patterns"] = new[] { "Ungrouped.*" },
|
|
288
288
|
},
|
|
289
289
|
},
|
|
290
290
|
],
|
|
@@ -304,7 +304,7 @@ public class GroupUpdateAllVersionsHandlerTests : UpdateHandlersTestsBase
|
|
|
304
304
|
Dependencies = [
|
|
305
305
|
new("Some.Dependency", "1.0.0", DependencyType.PackageReference, TargetFrameworks: ["net9.0"]),
|
|
306
306
|
new("Some.Other.Dependency", "3.0.0", DependencyType.PackageReference, TargetFrameworks: ["net9.0"]),
|
|
307
|
-
new("
|
|
307
|
+
new("Ungrouped.Dependency", "5.0.0", DependencyType.PackageReference, TargetFrameworks: ["net9.0"]),
|
|
308
308
|
],
|
|
309
309
|
ImportedFiles = [],
|
|
310
310
|
AdditionalFiles = [],
|
|
@@ -321,7 +321,7 @@ public class GroupUpdateAllVersionsHandlerTests : UpdateHandlersTestsBase
|
|
|
321
321
|
Dependencies = [
|
|
322
322
|
new("Some.Dependency", "1.0.0", DependencyType.PackageReference, TargetFrameworks: ["net9.0"]),
|
|
323
323
|
new("Some.Other.Dependency", "3.0.0", DependencyType.PackageReference, TargetFrameworks: ["net9.0"]),
|
|
324
|
-
new("
|
|
324
|
+
new("Ungrouped.Dependency", "5.0.0", DependencyType.PackageReference, TargetFrameworks: ["net9.0"]),
|
|
325
325
|
],
|
|
326
326
|
ImportedFiles = [],
|
|
327
327
|
AdditionalFiles = [],
|
|
@@ -338,6 +338,7 @@ public class GroupUpdateAllVersionsHandlerTests : UpdateHandlersTestsBase
|
|
|
338
338
|
{
|
|
339
339
|
"Some.Dependency" => "2.0.0",
|
|
340
340
|
"Some.Other.Dependency" => "4.0.0",
|
|
341
|
+
"Ungrouped.Dependency" => "6.0.0",
|
|
341
342
|
_ => throw new NotImplementedException($"Test didn't expect to update dependency {dependencyInfo.Name}"),
|
|
342
343
|
};
|
|
343
344
|
return Task.FromResult(new AnalysisResult()
|
|
@@ -373,6 +374,7 @@ public class GroupUpdateAllVersionsHandlerTests : UpdateHandlersTestsBase
|
|
|
373
374
|
["operation"] = "group_update_all_versions",
|
|
374
375
|
}
|
|
375
376
|
},
|
|
377
|
+
// first the grouped updates
|
|
376
378
|
// for "/src"
|
|
377
379
|
new UpdatedDependencyList()
|
|
378
380
|
{
|
|
@@ -395,7 +397,7 @@ public class GroupUpdateAllVersionsHandlerTests : UpdateHandlersTestsBase
|
|
|
395
397
|
},
|
|
396
398
|
new()
|
|
397
399
|
{
|
|
398
|
-
Name = "
|
|
400
|
+
Name = "Ungrouped.Dependency",
|
|
399
401
|
Version = "5.0.0",
|
|
400
402
|
Requirements = [
|
|
401
403
|
new() { Requirement = "5.0.0", File = "/src/project.csproj", Groups = ["dependencies"] },
|
|
@@ -426,7 +428,7 @@ public class GroupUpdateAllVersionsHandlerTests : UpdateHandlersTestsBase
|
|
|
426
428
|
},
|
|
427
429
|
new()
|
|
428
430
|
{
|
|
429
|
-
Name = "
|
|
431
|
+
Name = "Ungrouped.Dependency",
|
|
430
432
|
Version = "5.0.0",
|
|
431
433
|
Requirements = [
|
|
432
434
|
new() { Requirement = "5.0.0", File = "/test/project.csproj", Groups = ["dependencies"] },
|
|
@@ -508,6 +510,129 @@ public class GroupUpdateAllVersionsHandlerTests : UpdateHandlersTestsBase
|
|
|
508
510
|
PrBody = EndToEndTests.TestPullRequestBody,
|
|
509
511
|
DependencyGroup = "test-group",
|
|
510
512
|
},
|
|
513
|
+
// now the ungrouped updates
|
|
514
|
+
// for "/src"
|
|
515
|
+
new UpdatedDependencyList()
|
|
516
|
+
{
|
|
517
|
+
Dependencies = [
|
|
518
|
+
new()
|
|
519
|
+
{
|
|
520
|
+
Name = "Some.Dependency",
|
|
521
|
+
Version = "1.0.0",
|
|
522
|
+
Requirements = [
|
|
523
|
+
new() { Requirement = "1.0.0", File = "/src/project.csproj", Groups = ["dependencies"] },
|
|
524
|
+
],
|
|
525
|
+
},
|
|
526
|
+
new()
|
|
527
|
+
{
|
|
528
|
+
Name = "Some.Other.Dependency",
|
|
529
|
+
Version = "3.0.0",
|
|
530
|
+
Requirements = [
|
|
531
|
+
new() { Requirement = "3.0.0", File = "/src/project.csproj", Groups = ["dependencies"] },
|
|
532
|
+
],
|
|
533
|
+
},
|
|
534
|
+
new()
|
|
535
|
+
{
|
|
536
|
+
Name = "Ungrouped.Dependency",
|
|
537
|
+
Version = "5.0.0",
|
|
538
|
+
Requirements = [
|
|
539
|
+
new() { Requirement = "5.0.0", File = "/src/project.csproj", Groups = ["dependencies"] },
|
|
540
|
+
],
|
|
541
|
+
},
|
|
542
|
+
],
|
|
543
|
+
DependencyFiles = ["/src/project.csproj"],
|
|
544
|
+
},
|
|
545
|
+
new CreatePullRequest()
|
|
546
|
+
{
|
|
547
|
+
Dependencies = [
|
|
548
|
+
new()
|
|
549
|
+
{
|
|
550
|
+
Name = "Ungrouped.Dependency",
|
|
551
|
+
Version = "6.0.0",
|
|
552
|
+
Requirements = [
|
|
553
|
+
new() { Requirement = "6.0.0", File = "/src/project.csproj", Groups = ["dependencies"], Source = new() { SourceUrl = null } },
|
|
554
|
+
],
|
|
555
|
+
PreviousVersion = "5.0.0",
|
|
556
|
+
PreviousRequirements = [
|
|
557
|
+
new() { Requirement = "5.0.0", File = "/src/project.csproj", Groups = ["dependencies"] },
|
|
558
|
+
],
|
|
559
|
+
},
|
|
560
|
+
],
|
|
561
|
+
UpdatedDependencyFiles = [
|
|
562
|
+
new()
|
|
563
|
+
{
|
|
564
|
+
Directory = "/src",
|
|
565
|
+
Name = "project.csproj",
|
|
566
|
+
Content = "updated contents",
|
|
567
|
+
},
|
|
568
|
+
],
|
|
569
|
+
BaseCommitSha = "TEST-COMMIT-SHA",
|
|
570
|
+
CommitMessage = EndToEndTests.TestPullRequestCommitMessage,
|
|
571
|
+
PrTitle = EndToEndTests.TestPullRequestTitle,
|
|
572
|
+
PrBody = EndToEndTests.TestPullRequestBody,
|
|
573
|
+
DependencyGroup = null,
|
|
574
|
+
},
|
|
575
|
+
// for "/test"
|
|
576
|
+
new UpdatedDependencyList()
|
|
577
|
+
{
|
|
578
|
+
Dependencies = [
|
|
579
|
+
new()
|
|
580
|
+
{
|
|
581
|
+
Name = "Some.Dependency",
|
|
582
|
+
Version = "1.0.0",
|
|
583
|
+
Requirements = [
|
|
584
|
+
new() { Requirement = "1.0.0", File = "/test/project.csproj", Groups = ["dependencies"] },
|
|
585
|
+
],
|
|
586
|
+
},
|
|
587
|
+
new()
|
|
588
|
+
{
|
|
589
|
+
Name = "Some.Other.Dependency",
|
|
590
|
+
Version = "3.0.0",
|
|
591
|
+
Requirements = [
|
|
592
|
+
new() { Requirement = "3.0.0", File = "/test/project.csproj", Groups = ["dependencies"] },
|
|
593
|
+
],
|
|
594
|
+
},
|
|
595
|
+
new()
|
|
596
|
+
{
|
|
597
|
+
Name = "Ungrouped.Dependency",
|
|
598
|
+
Version = "5.0.0",
|
|
599
|
+
Requirements = [
|
|
600
|
+
new() { Requirement = "5.0.0", File = "/test/project.csproj", Groups = ["dependencies"] },
|
|
601
|
+
],
|
|
602
|
+
},
|
|
603
|
+
],
|
|
604
|
+
DependencyFiles = ["/test/project.csproj"],
|
|
605
|
+
},
|
|
606
|
+
new CreatePullRequest()
|
|
607
|
+
{
|
|
608
|
+
Dependencies = [
|
|
609
|
+
new()
|
|
610
|
+
{
|
|
611
|
+
Name = "Ungrouped.Dependency",
|
|
612
|
+
Version = "6.0.0",
|
|
613
|
+
Requirements = [
|
|
614
|
+
new() { Requirement = "6.0.0", File = "/test/project.csproj", Groups = ["dependencies"], Source = new() { SourceUrl = null } },
|
|
615
|
+
],
|
|
616
|
+
PreviousVersion = "5.0.0",
|
|
617
|
+
PreviousRequirements = [
|
|
618
|
+
new() { Requirement = "5.0.0", File = "/test/project.csproj", Groups = ["dependencies"] },
|
|
619
|
+
],
|
|
620
|
+
},
|
|
621
|
+
],
|
|
622
|
+
UpdatedDependencyFiles = [
|
|
623
|
+
new()
|
|
624
|
+
{
|
|
625
|
+
Directory = "/test",
|
|
626
|
+
Name = "project.csproj",
|
|
627
|
+
Content = "updated contents",
|
|
628
|
+
},
|
|
629
|
+
],
|
|
630
|
+
BaseCommitSha = "TEST-COMMIT-SHA",
|
|
631
|
+
CommitMessage = EndToEndTests.TestPullRequestCommitMessage,
|
|
632
|
+
PrTitle = EndToEndTests.TestPullRequestTitle,
|
|
633
|
+
PrBody = EndToEndTests.TestPullRequestBody,
|
|
634
|
+
DependencyGroup = null,
|
|
635
|
+
},
|
|
511
636
|
new MarkAsProcessed("TEST-COMMIT-SHA"),
|
|
512
637
|
]
|
|
513
638
|
);
|
|
@@ -608,6 +733,7 @@ public class GroupUpdateAllVersionsHandlerTests : UpdateHandlersTestsBase
|
|
|
608
733
|
["operation"] = "group_update_all_versions",
|
|
609
734
|
}
|
|
610
735
|
},
|
|
736
|
+
// grouped check
|
|
611
737
|
new UpdatedDependencyList()
|
|
612
738
|
{
|
|
613
739
|
Dependencies = [
|
|
@@ -660,6 +786,29 @@ public class GroupUpdateAllVersionsHandlerTests : UpdateHandlersTestsBase
|
|
|
660
786
|
PrBody = EndToEndTests.TestPullRequestBody,
|
|
661
787
|
DependencyGroup = "test-group",
|
|
662
788
|
},
|
|
789
|
+
// ungrouped check
|
|
790
|
+
new UpdatedDependencyList()
|
|
791
|
+
{
|
|
792
|
+
Dependencies = [
|
|
793
|
+
new()
|
|
794
|
+
{
|
|
795
|
+
Name = "Some.Dependency",
|
|
796
|
+
Version = "1.0.0",
|
|
797
|
+
Requirements = [
|
|
798
|
+
new() { Requirement = "1.0.0", File = "/src/project.csproj", Groups = ["dependencies"] },
|
|
799
|
+
],
|
|
800
|
+
},
|
|
801
|
+
new()
|
|
802
|
+
{
|
|
803
|
+
Name = "Some.Other.Dependency",
|
|
804
|
+
Version = "3.0.0",
|
|
805
|
+
Requirements = [
|
|
806
|
+
new() { Requirement = "3.0.0", File = "/src/project.csproj", Groups = ["dependencies"] },
|
|
807
|
+
],
|
|
808
|
+
},
|
|
809
|
+
],
|
|
810
|
+
DependencyFiles = ["/src/project.csproj"],
|
|
811
|
+
},
|
|
663
812
|
new MarkAsProcessed("TEST-COMMIT-SHA"),
|
|
664
813
|
]
|
|
665
814
|
);
|
|
@@ -770,6 +919,7 @@ public class GroupUpdateAllVersionsHandlerTests : UpdateHandlersTestsBase
|
|
|
770
919
|
["operation"] = "group_update_all_versions",
|
|
771
920
|
}
|
|
772
921
|
},
|
|
922
|
+
// grouped check
|
|
773
923
|
new UpdatedDependencyList()
|
|
774
924
|
{
|
|
775
925
|
Dependencies = [
|
|
@@ -822,6 +972,29 @@ public class GroupUpdateAllVersionsHandlerTests : UpdateHandlersTestsBase
|
|
|
822
972
|
PrBody = EndToEndTests.TestPullRequestBody,
|
|
823
973
|
DependencyGroup = "test-group-1",
|
|
824
974
|
},
|
|
975
|
+
// ungrouped check
|
|
976
|
+
new UpdatedDependencyList()
|
|
977
|
+
{
|
|
978
|
+
Dependencies = [
|
|
979
|
+
new()
|
|
980
|
+
{
|
|
981
|
+
Name = "Package.For.Group.One",
|
|
982
|
+
Version = "1.0.0",
|
|
983
|
+
Requirements = [
|
|
984
|
+
new() { Requirement = "1.0.0", File = "/src/project.csproj", Groups = ["dependencies"] },
|
|
985
|
+
],
|
|
986
|
+
},
|
|
987
|
+
new()
|
|
988
|
+
{
|
|
989
|
+
Name = "Package.For.Group.Two",
|
|
990
|
+
Version = "2.0.0",
|
|
991
|
+
Requirements = [
|
|
992
|
+
new() { Requirement = "2.0.0", File = "/src/project.csproj", Groups = ["dependencies"] },
|
|
993
|
+
],
|
|
994
|
+
},
|
|
995
|
+
],
|
|
996
|
+
DependencyFiles = ["/src/project.csproj"],
|
|
997
|
+
},
|
|
825
998
|
new MarkAsProcessed("TEST-COMMIT-SHA"),
|
|
826
999
|
]
|
|
827
1000
|
);
|
|
@@ -452,7 +452,7 @@ public class MSBuildHelperTests : TestBase
|
|
|
452
452
|
// output
|
|
453
453
|
"Response status code does not indicate success: 500 (Internal Server Error).",
|
|
454
454
|
// expectedError
|
|
455
|
-
new PrivateSourceBadResponse(["http://localhost/test-feed"]),
|
|
455
|
+
new PrivateSourceBadResponse(["http://localhost/test-feed"], "unused"),
|
|
456
456
|
];
|
|
457
457
|
|
|
458
458
|
yield return
|
|
@@ -460,7 +460,7 @@ public class MSBuildHelperTests : TestBase
|
|
|
460
460
|
// output
|
|
461
461
|
"The response ended prematurely. (ResponseEnded)",
|
|
462
462
|
// expectedError
|
|
463
|
-
new PrivateSourceBadResponse(["http://localhost/test-feed"]),
|
|
463
|
+
new PrivateSourceBadResponse(["http://localhost/test-feed"], "unused"),
|
|
464
464
|
];
|
|
465
465
|
|
|
466
466
|
yield return
|
|
@@ -468,7 +468,7 @@ public class MSBuildHelperTests : TestBase
|
|
|
468
468
|
// output
|
|
469
469
|
"The file is not a valid nupkg.",
|
|
470
470
|
// expectedError
|
|
471
|
-
new PrivateSourceBadResponse(["http://localhost/test-feed"]),
|
|
471
|
+
new PrivateSourceBadResponse(["http://localhost/test-feed"], "unused"),
|
|
472
472
|
];
|
|
473
473
|
|
|
474
474
|
yield return
|
|
@@ -476,7 +476,7 @@ public class MSBuildHelperTests : TestBase
|
|
|
476
476
|
// output
|
|
477
477
|
"The content at 'http://localhost/test-feed/Packages(Id='Some.Package',Version='1.2.3')' is not valid XML.",
|
|
478
478
|
// expectedError
|
|
479
|
-
new PrivateSourceBadResponse(["http://localhost/test-feed"]),
|
|
479
|
+
new PrivateSourceBadResponse(["http://localhost/test-feed"], "unused"),
|
|
480
480
|
];
|
|
481
481
|
|
|
482
482
|
yield return
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dependabot-nuget
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.343.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dependabot
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - '='
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 0.
|
|
18
|
+
version: 0.343.1
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - '='
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 0.
|
|
25
|
+
version: 0.343.1
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: debug
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -551,7 +551,7 @@ licenses:
|
|
|
551
551
|
- MIT
|
|
552
552
|
metadata:
|
|
553
553
|
bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
|
|
554
|
-
changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.
|
|
554
|
+
changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.343.1
|
|
555
555
|
rdoc_options: []
|
|
556
556
|
require_paths:
|
|
557
557
|
- lib
|