dependabot-nuget 0.384.0 → 0.385.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b77dedc63031536f0a500698857e46afbc14f3f5ea80a0e8300a52e27d4d3d46
4
- data.tar.gz: 5794be271db14c64c9d3e72adb259bbd52e78fa79ed796943595598395fe3ed6
3
+ metadata.gz: a881b72688cc9a18a791c07aaa05ca3bc0b3d1e2da426553116cb90e9e8545ae
4
+ data.tar.gz: 69578367499f994702f926128e1297e8b3b38fcc43a3bb5236606a515be19de8
5
5
  SHA512:
6
- metadata.gz: bf66e0d54541539ac5fe228db99426b8f15b8a7e7253e2a62b61d25cee3ddf6a86c9ce1a51a2206f01b4ba3559ed69191bcf8ca7e81eb9b71950576c79002b5b
7
- data.tar.gz: 5227b2387092e94a359eff0c3a0f08608d6a559b007b59caeb6c9016ff760712c6ab684dbc455ced2211835000ed2d8a2fc3b4f53f4638828d1ee01b705c66a0
6
+ metadata.gz: bdb9aa2d2d6de546e097b37bdea0eaf16c077c30e370e491a0c6defbabf3d5d176a99de91309202daaca3714de09b41b1035f46757402acbba7a9c66d9233f24
7
+ data.tar.gz: d425d717e8d673a7b64a559c6e65a1ef9bacfee8c3de37719eac3406af8d869e0be7157a835b5b6078b71db0aa173518ec52ad86e35a95eddf942f803b449d1f
@@ -37,6 +37,7 @@ public sealed record Job
37
37
  public required JobSource Source { get; init; }
38
38
  public bool UpdateSubdependencies { get; init; } = false;
39
39
  public bool UpdatingAPullRequest { get; init; } = false;
40
+ public bool MultiEcosystemUpdate { get; init; } = false;
40
41
  public bool VendorDependencies { get; init; } = false;
41
42
  public bool RejectExternalCode { get; init; } = false;
42
43
  public bool RepoPrivate { get; init; } = false;
@@ -53,7 +54,7 @@ public sealed record Job
53
54
  builder.Add(Source.Directory);
54
55
  }
55
56
 
56
- builder.AddRange(Source.Directories ?? []);
57
+ builder.AddRange((Source.Directories ?? []).Where(d => d is not null));
57
58
  if (builder.Count == 0)
58
59
  {
59
60
  builder.Add("/");
@@ -20,7 +20,7 @@ internal class AzurePackageDetailFinder : IPackageDetailFinder
20
20
  return "commits";
21
21
  }
22
22
 
23
- public Task<Dictionary<NuGetVersion, (string TagName, string? Details)>> GetReleaseDataForVersionsAsync(string repoName, NuGetVersion oldVersion, NuGetVersion newVersion)
23
+ public Task<Dictionary<NuGetVersion, (string TagName, string? Details)>> GetReleaseDataForVersionsAsync(string repoName, string dependencyName, NuGetVersion oldVersion, NuGetVersion newVersion)
24
24
  {
25
25
  // azure devops doesn't support direct tag listing
26
26
  return Task.FromResult(new Dictionary<NuGetVersion, (string TagName, string? Details)>());
@@ -91,7 +91,7 @@ internal class DetailedPullRequestBodyGenerator : IPullRequestBodyGenerator, IDi
91
91
  updateOperation.OldVersion is not null)
92
92
  {
93
93
  var repoName = uri.LocalPath.TrimStart('/');
94
- var versionsAndDetails = await packageDetailFinder.GetReleaseDataForVersionsAsync(repoName, updateOperation.OldVersion, updateOperation.NewVersion);
94
+ var versionsAndDetails = await packageDetailFinder.GetReleaseDataForVersionsAsync(repoName, updateOperation.DependencyName, updateOperation.OldVersion, updateOperation.NewVersion);
95
95
  var ordered = versionsAndDetails
96
96
  .Where(kv => kv.Key != updateOperation.OldVersion)
97
97
  .OrderByDescending(kv => kv.Key)
@@ -28,25 +28,27 @@ internal class GitHubPackageDetailFinder : IPackageDetailFinder
28
28
  return "commits";
29
29
  }
30
30
 
31
- public async Task<Dictionary<NuGetVersion, (string TagName, string? Details)>> GetReleaseDataForVersionsAsync(string repoName, NuGetVersion oldVersion, NuGetVersion newVersion)
31
+ public async Task<Dictionary<NuGetVersion, (string TagName, string? Details)>> GetReleaseDataForVersionsAsync(string repoName, string dependencyName, NuGetVersion oldVersion, NuGetVersion newVersion)
32
32
  {
33
- var result = new Dictionary<NuGetVersion, (string TagName, string? Details)>();
33
+ var versionReleaseData = new Dictionary<NuGetVersion, (string TagName, string? Details)>();
34
+ var packageScopedVersionReleaseData = new Dictionary<NuGetVersion, (string TagName, string? Details)>();
35
+ var otherPackageScopedVersionReleaseData = new Dictionary<NuGetVersion, (string TagName, string? Details)>();
34
36
  var url = $"https://api.github.com/repos/{repoName}/releases?per_page=100";
35
37
  var jsonOption = await _httpFetcher.GetJsonElementAsync(url);
36
38
  if (jsonOption is null)
37
39
  {
38
- return result;
40
+ return versionReleaseData;
39
41
  }
40
42
 
41
43
  var json = jsonOption.Value;
42
44
  if (json.ValueKind != JsonValueKind.Array)
43
45
  {
44
- return result;
46
+ return versionReleaseData;
45
47
  }
46
48
 
47
49
  if (json.GetArrayLength() == 0)
48
50
  {
49
- return result;
51
+ return versionReleaseData;
50
52
  }
51
53
 
52
54
  foreach (var releaseObject in json.EnumerateArray())
@@ -75,7 +77,10 @@ internal class GitHubPackageDetailFinder : IPackageDetailFinder
75
77
  var tagName = tagNameElement.GetString()!;
76
78
 
77
79
  // find matching version
78
- var correspondingVersion = IPackageDetailFinder.GetVersionFromNames(releaseName, tagName);
80
+ var packageScopedVersion = IPackageDetailFinder.GetPackageScopedVersionFromNames(releaseName, tagName, dependencyName);
81
+ var correspondingVersion = packageScopedVersion ?? IPackageDetailFinder.GetVersionFromNames(releaseName, tagName);
82
+ var isOtherPackageScopedVersion = packageScopedVersion is null &&
83
+ IPackageDetailFinder.HasPackageScopedVersionForOtherDependency(releaseName, tagName, dependencyName);
79
84
  if (correspondingVersion is null)
80
85
  {
81
86
  continue;
@@ -90,11 +95,37 @@ internal class GitHubPackageDetailFinder : IPackageDetailFinder
90
95
  }
91
96
 
92
97
  var body = bodyElement.GetString()!;
93
- result[correspondingVersion] = (tagName, body);
98
+ if (packageScopedVersion is not null)
99
+ {
100
+ packageScopedVersionReleaseData[correspondingVersion] = (tagName, body);
101
+ }
102
+ else if (isOtherPackageScopedVersion)
103
+ {
104
+ otherPackageScopedVersionReleaseData[correspondingVersion] = (tagName, body);
105
+ }
106
+ else
107
+ {
108
+ versionReleaseData[correspondingVersion] = (tagName, body);
109
+ }
94
110
  }
95
111
  }
96
112
 
97
- return result;
113
+ if (packageScopedVersionReleaseData.Count > 0)
114
+ {
115
+ foreach (var packageScopedDetails in packageScopedVersionReleaseData)
116
+ {
117
+ versionReleaseData[packageScopedDetails.Key] = packageScopedDetails.Value;
118
+ }
119
+
120
+ return versionReleaseData;
121
+ }
122
+
123
+ foreach (var otherPackageScopedDetails in otherPackageScopedVersionReleaseData)
124
+ {
125
+ versionReleaseData[otherPackageScopedDetails.Key] = otherPackageScopedDetails.Value;
126
+ }
127
+
128
+ return versionReleaseData;
98
129
  }
99
130
 
100
131
  public string GetReleasesUrlPath() => "releases";
@@ -28,25 +28,27 @@ internal class GitLabPackageDetailFinder : IPackageDetailFinder
28
28
  return "-/commits";
29
29
  }
30
30
 
31
- public async Task<Dictionary<NuGetVersion, (string TagName, string? Details)>> GetReleaseDataForVersionsAsync(string repoName, NuGetVersion oldVersion, NuGetVersion newVersion)
31
+ public async Task<Dictionary<NuGetVersion, (string TagName, string? Details)>> GetReleaseDataForVersionsAsync(string repoName, string dependencyName, NuGetVersion oldVersion, NuGetVersion newVersion)
32
32
  {
33
- var result = new Dictionary<NuGetVersion, (string TagName, string? Details)>();
33
+ var versionReleaseData = new Dictionary<NuGetVersion, (string TagName, string? Details)>();
34
+ var packageScopedVersionReleaseData = new Dictionary<NuGetVersion, (string TagName, string? Details)>();
35
+ var otherPackageScopedVersionReleaseData = new Dictionary<NuGetVersion, (string TagName, string? Details)>();
34
36
  var url = $"https://gitlab.com/api/v4/projects/{Uri.EscapeDataString(repoName)}/repository/tags";
35
37
  var jsonOption = await _httpFetcher.GetJsonElementAsync(url);
36
38
  if (jsonOption is null)
37
39
  {
38
- return result;
40
+ return versionReleaseData;
39
41
  }
40
42
 
41
43
  var json = jsonOption.Value;
42
44
  if (json.ValueKind != JsonValueKind.Array)
43
45
  {
44
- return result;
46
+ return versionReleaseData;
45
47
  }
46
48
 
47
49
  if (json.GetArrayLength() == 0)
48
50
  {
49
- return result;
51
+ return versionReleaseData;
50
52
  }
51
53
 
52
54
  foreach (var responseObject in json.EnumerateArray())
@@ -85,7 +87,10 @@ internal class GitLabPackageDetailFinder : IPackageDetailFinder
85
87
  }
86
88
 
87
89
  // find matching version
88
- var correspondingVersion = IPackageDetailFinder.GetVersionFromNames(releaseName, tagName);
90
+ var packageScopedVersion = IPackageDetailFinder.GetPackageScopedVersionFromNames(releaseName, tagName, dependencyName);
91
+ var correspondingVersion = packageScopedVersion ?? IPackageDetailFinder.GetVersionFromNames(releaseName, tagName);
92
+ var isOtherPackageScopedVersion = packageScopedVersion is null &&
93
+ IPackageDetailFinder.HasPackageScopedVersionForOtherDependency(releaseName, tagName, dependencyName);
89
94
  if (correspondingVersion is null)
90
95
  {
91
96
  continue;
@@ -96,11 +101,37 @@ internal class GitLabPackageDetailFinder : IPackageDetailFinder
96
101
  correspondingVersion >= oldVersion &&
97
102
  correspondingVersion <= newVersion)
98
103
  {
99
- result[correspondingVersion] = (resultTag, description);
104
+ if (packageScopedVersion is not null)
105
+ {
106
+ packageScopedVersionReleaseData[correspondingVersion] = (resultTag, description);
107
+ }
108
+ else if (isOtherPackageScopedVersion)
109
+ {
110
+ otherPackageScopedVersionReleaseData[correspondingVersion] = (resultTag, description);
111
+ }
112
+ else
113
+ {
114
+ versionReleaseData[correspondingVersion] = (resultTag, description);
115
+ }
100
116
  }
101
117
  }
102
118
 
103
- return result;
119
+ if (packageScopedVersionReleaseData.Count > 0)
120
+ {
121
+ foreach (var packageScopedDetails in packageScopedVersionReleaseData)
122
+ {
123
+ versionReleaseData[packageScopedDetails.Key] = packageScopedDetails.Value;
124
+ }
125
+
126
+ return versionReleaseData;
127
+ }
128
+
129
+ foreach (var otherPackageScopedDetails in otherPackageScopedVersionReleaseData)
130
+ {
131
+ versionReleaseData[otherPackageScopedDetails.Key] = otherPackageScopedDetails.Value;
132
+ }
133
+
134
+ return versionReleaseData;
104
135
  }
105
136
 
106
137
  public string GetReleasesUrlPath() => "-/releases";
@@ -8,13 +8,85 @@ internal partial interface IPackageDetailFinder
8
8
  {
9
9
  string GetReleasesUrlPath();
10
10
  string GetCompareUrlPath(string? oldTag, string? newTag);
11
- Task<Dictionary<NuGetVersion, (string TagName, string? Details)>> GetReleaseDataForVersionsAsync(string repoName, NuGetVersion oldVersion, NuGetVersion newVersion);
11
+ Task<Dictionary<NuGetVersion, (string TagName, string? Details)>> GetReleaseDataForVersionsAsync(string repoName, string dependencyName, NuGetVersion oldVersion, NuGetVersion newVersion);
12
12
 
13
- internal static NuGetVersion? GetVersionFromNames(string? releaseName, string? tagName)
13
+ internal static NuGetVersion? GetVersionFromNames(string? releaseName, string? tagName, string? dependencyName = null)
14
+ {
15
+ if (dependencyName is not null)
16
+ {
17
+ var packageScopedVersion = GetPackageScopedVersionFromNames(releaseName, tagName, dependencyName);
18
+ if (packageScopedVersion is not null)
19
+ {
20
+ return packageScopedVersion;
21
+ }
22
+ }
23
+
24
+ return GetRepoScopedVersionFromNames(releaseName, tagName);
25
+ }
26
+
27
+ internal static NuGetVersion? GetPackageScopedVersionFromNames(string? releaseName, string? tagName, string dependencyName)
28
+ {
29
+ foreach (var candidateName in new[] { releaseName, tagName }.Where(n => n is not null).Cast<string>())
30
+ {
31
+ var match = GetPackageScopedNameMatch(candidateName, dependencyName);
32
+ if (match is null)
33
+ {
34
+ continue;
35
+ }
36
+
37
+ var version = match.Groups["version"].Value;
38
+ if (NuGetVersion.TryParse(version, out var versionFromPackageScopedName))
39
+ {
40
+ return versionFromPackageScopedName;
41
+ }
42
+ }
43
+
44
+ return null;
45
+ }
46
+
47
+ internal static bool HasPackageScopedVersionForOtherDependency(string? releaseName, string? tagName, string dependencyName)
14
48
  {
15
49
  foreach (var candidateName in new[] { releaseName, tagName }.Where(n => n is not null).Cast<string>())
16
50
  {
17
- var trimmedName = NamePrefixPattern.Replace(candidateName, string.Empty);
51
+ var trimmedCandidateName = candidateName.Trim();
52
+ var match = PackageScopedNamePattern.Match(trimmedCandidateName);
53
+ if (!match.Success)
54
+ {
55
+ continue;
56
+ }
57
+
58
+ var matchedDependencyName = match.Groups["dependency"].Value;
59
+ var version = match.Groups["version"].Value;
60
+ if (!matchedDependencyName.Contains('.') ||
61
+ matchedDependencyName.Equals(dependencyName, StringComparison.OrdinalIgnoreCase) ||
62
+ !NuGetVersion.TryParse(version, out _))
63
+ {
64
+ continue;
65
+ }
66
+
67
+ return true;
68
+ }
69
+
70
+ return false;
71
+ }
72
+
73
+ private static Match? GetPackageScopedNameMatch(string candidateName, string dependencyName)
74
+ {
75
+ var match = PackageScopedNamePattern.Match(candidateName.Trim());
76
+ if (!match.Success ||
77
+ !match.Groups["dependency"].Value.Equals(dependencyName, StringComparison.OrdinalIgnoreCase))
78
+ {
79
+ return null;
80
+ }
81
+
82
+ return match;
83
+ }
84
+
85
+ private static NuGetVersion? GetRepoScopedVersionFromNames(string? releaseName, string? tagName)
86
+ {
87
+ foreach (var candidateName in new[] { releaseName, tagName }.Where(n => n is not null).Cast<string>())
88
+ {
89
+ var trimmedName = NamePrefixPattern.Replace(candidateName.Trim(), string.Empty);
18
90
  if (NuGetVersion.TryParse(trimmedName, out var versionFromTrimmed))
19
91
  {
20
92
  return versionFromTrimmed;
@@ -27,5 +99,10 @@ internal partial interface IPackageDetailFinder
27
99
  [GeneratedRegex(@"^[^0-9]*")]
28
100
  private static partial Regex NamePrefixRemover();
29
101
 
102
+ [GeneratedRegex(@"(?:^|[\s/_-])(?<dependency>[A-Za-z0-9_.-]+)[\s/_-]+v?(?<version>[0-9][A-Za-z0-9.+-]*)$", RegexOptions.IgnoreCase)]
103
+ private static partial Regex PackageScopedNameMatcher();
104
+
30
105
  private static readonly Regex NamePrefixPattern = NamePrefixRemover();
106
+
107
+ private static readonly Regex PackageScopedNamePattern = PackageScopedNameMatcher();
31
108
  }
@@ -17,6 +17,11 @@ internal class GroupUpdateAllVersionsHandler : IUpdateHandler
17
17
 
18
18
  public bool CanHandle(Job job)
19
19
  {
20
+ if (job.MultiEcosystemUpdate)
21
+ {
22
+ return true;
23
+ }
24
+
20
25
  if (job.UpdatingAPullRequest)
21
26
  {
22
27
  return false;
@@ -420,6 +420,38 @@ public class JobTests
420
420
  AssertEx.Equal(expectedDirectories, actualDirectories);
421
421
  }
422
422
 
423
+ [Fact]
424
+ public void ExpandJobDirectoriesIgnoresNullEntries()
425
+ {
426
+ // arrange
427
+ using var tempDir = new TemporaryDirectory();
428
+ var json = """
429
+ {
430
+ "job": {
431
+ "package-manager": "nuget",
432
+ "source": {
433
+ "provider": "github",
434
+ "repo": "test/repo",
435
+ "directories": [
436
+ null
437
+ ]
438
+ }
439
+ }
440
+ }
441
+ """;
442
+ var job = RunWorker.Deserialize(json).Job;
443
+
444
+ // act - the null entry should be ignored, not cause a NullReferenceException
445
+ var actualDirectories = job.GetAllDirectories(tempDir.DirectoryPath);
446
+
447
+ // assert - null entry was filtered out, falling back to the repo root
448
+ var expectedDirectories = new[]
449
+ {
450
+ "/",
451
+ }.ToImmutableArray();
452
+ AssertEx.Equal(expectedDirectories, actualDirectories);
453
+ }
454
+
423
455
  [Theory]
424
456
  [InlineData("version", JobCommand.Version)]
425
457
  [InlineData("update", JobCommand.Update)]
@@ -170,6 +170,89 @@ public class DetailedPullRequestBodyGeneratorTests
170
170
  );
171
171
  }
172
172
 
173
+ [Fact]
174
+ public async Task GeneratePrBody_GitHub_PackageScopedReleases()
175
+ {
176
+ await TestAsync(
177
+ updateOperationsPerformed: [
178
+ new DirectUpdate() { DependencyName = "This.Package", OldVersion = NuGetVersion.Parse("1.1.2"), NewVersion = NuGetVersion.Parse("3.1.1"), UpdatedFiles = [] },
179
+ ],
180
+ updatedDependencies: [
181
+ new ReportedDependency()
182
+ {
183
+ Name = "This.Package",
184
+ PreviousVersion = "1.1.2",
185
+ Version = "3.1.1",
186
+ Requirements = [
187
+ new ReportedRequirement()
188
+ {
189
+ File = "",
190
+ Requirement = "3.1.1",
191
+ Source = new()
192
+ {
193
+ SourceUrl = "https://github.com/Some.Owner/Some.Repo",
194
+ },
195
+ }
196
+ ],
197
+ }
198
+ ],
199
+ httpResponses: [
200
+ ("https://api.github.com/repos/Some.Owner/Some.Repo/releases?per_page=100", """
201
+ [
202
+ {
203
+ "name": "This.Package v3.1.1",
204
+ "tag_name": "This.Package-v3.1.1",
205
+ "body": "* this package point 3"
206
+ },
207
+ {
208
+ "name": "Another.Package v2.1.1",
209
+ "tag_name": "Another.Package-v2.1.1",
210
+ "body": "* another package point"
211
+ },
212
+ {
213
+ "name": "v2.5.0",
214
+ "tag_name": "v2.5.0",
215
+ "body": "* repo point"
216
+ },
217
+ {
218
+ "name": "This.Package v2.0.0",
219
+ "tag_name": "This.Package-v2.0.0",
220
+ "body": "* this package point 2"
221
+ },
222
+ {
223
+ "name": "v1.1.2",
224
+ "tag_name": "v1.1.2",
225
+ "body": "* old repo point"
226
+ }
227
+ ]
228
+ """)
229
+ ],
230
+ expectedBody: """
231
+ Updated [This.Package](https://github.com/Some.Owner/Some.Repo) from 1.1.2 to 3.1.1.
232
+
233
+ <details>
234
+ <summary>Release notes</summary>
235
+
236
+ _Sourced from [This.Package's releases](https://github.com/Some.Owner/Some.Repo/releases)._
237
+
238
+ ## 3.1.1
239
+
240
+ * this package point 3
241
+
242
+ ## 2.5.0
243
+
244
+ * repo point
245
+
246
+ ## 2.0.0
247
+
248
+ * this package point 2
249
+
250
+ Commits viewable in [compare view](https://github.com/Some.Owner/Some.Repo/compare/v1.1.2...This.Package-v3.1.1).
251
+ </details>
252
+ """
253
+ );
254
+ }
255
+
173
256
  [Fact]
174
257
  public async Task GeneratePrBody_GitHub_EmptyApiResponses()
175
258
  {
@@ -328,6 +411,99 @@ public class DetailedPullRequestBodyGeneratorTests
328
411
  );
329
412
  }
330
413
 
414
+ [Fact]
415
+ public async Task GeneratePrBody_GitLab_PackageScopedReleases()
416
+ {
417
+ await TestAsync(
418
+ updateOperationsPerformed: [
419
+ new DirectUpdate() { DependencyName = "This.Package", OldVersion = NuGetVersion.Parse("1.1.2"), NewVersion = NuGetVersion.Parse("3.1.1"), UpdatedFiles = [] },
420
+ ],
421
+ updatedDependencies: [
422
+ new ReportedDependency()
423
+ {
424
+ Name = "This.Package",
425
+ PreviousVersion = "1.1.2",
426
+ Version = "3.1.1",
427
+ Requirements = [
428
+ new ReportedRequirement()
429
+ {
430
+ File = "",
431
+ Requirement = "3.1.1",
432
+ Source = new()
433
+ {
434
+ SourceUrl = "https://gitlab.com/Some.Owner/Some.Repo",
435
+ },
436
+ }
437
+ ],
438
+ }
439
+ ],
440
+ httpResponses: [
441
+ ("https://gitlab.com/api/v4/projects/Some.Owner%2FSome.Repo/repository/tags", """
442
+ [
443
+ {
444
+ "name": "This.Package v3.1.1",
445
+ "release": {
446
+ "tag_name": "This.Package-v3.1.1",
447
+ "description": "* this package point 3"
448
+ }
449
+ },
450
+ {
451
+ "name": "Another.Package v2.1.1",
452
+ "release": {
453
+ "tag_name": "Another.Package-v2.1.1",
454
+ "description": "* another package point"
455
+ }
456
+ },
457
+ {
458
+ "name": "v2.5.0",
459
+ "release": {
460
+ "tag_name": "v2.5.0",
461
+ "description": "* repo point"
462
+ }
463
+ },
464
+ {
465
+ "name": "This.Package v2.0.0",
466
+ "release": {
467
+ "tag_name": "This.Package-v2.0.0",
468
+ "description": "* this package point 2"
469
+ }
470
+ },
471
+ {
472
+ "name": "v1.1.2",
473
+ "release": {
474
+ "tag_name": "v1.1.2",
475
+ "description": "* old repo point"
476
+ }
477
+ }
478
+ ]
479
+ """)
480
+ ],
481
+ expectedBody: """
482
+ Updated [This.Package](https://gitlab.com/Some.Owner/Some.Repo) from 1.1.2 to 3.1.1.
483
+
484
+ <details>
485
+ <summary>Release notes</summary>
486
+
487
+ _Sourced from [This.Package's releases](https://gitlab.com/Some.Owner/Some.Repo/-/releases)._
488
+
489
+ ## 3.1.1
490
+
491
+ * this package point 3
492
+
493
+ ## 2.5.0
494
+
495
+ * repo point
496
+
497
+ ## 2.0.0
498
+
499
+ * this package point 2
500
+
501
+ Commits viewable in [compare view](https://gitlab.com/Some.Owner/Some.Repo/-/compare/v1.1.2...This.Package-v3.1.1).
502
+ </details>
503
+ """
504
+ );
505
+ }
506
+
331
507
  [Fact]
332
508
  public async Task GeneratePrBody_GitLab_EmptyApiResponses()
333
509
  {
@@ -12,6 +12,8 @@ public class IPackageDetailFinderTests
12
12
  [InlineData("version-one.zero.zero", "v1.0.0", "1.0.0")]
13
13
  [InlineData("v-one.zero.zero", "v-one.zero.zero", null)]
14
14
  [InlineData("Stable", "version-1.0.0", "1.0.0")]
15
+ [InlineData("NUnit version 4.6.1", "v4.6.1", "4.6.1")]
16
+ [InlineData("4.0.262.0", "4.0.262.0", "4.0.262.0")]
15
17
  [InlineData("some.package/1.0.0", "some.package/1.0.0", "1.0.0")]
16
18
  [InlineData("some.package 1.0.0", "some.package 1.0.0", "1.0.0")]
17
19
  public void GetVersionFromNames(string releaseName, string tagName, string? expectedVersion)
@@ -27,4 +29,36 @@ public class IPackageDetailFinderTests
27
29
  Assert.Equal(expectedVersion, actualVersion.ToString());
28
30
  }
29
31
  }
32
+
33
+ [Theory]
34
+ [InlineData("some.package", "some.package v1.0.0", "other.package v2.0.0", "1.0.0")]
35
+ [InlineData("some.package", "other.package v2.0.0", "some.package-v1.0.0", "1.0.0")]
36
+ [InlineData("some.package", "packages/some.package/1.0.0", "other.package v2.0.0", "1.0.0")]
37
+ [InlineData("some.package", "other.package v2.0.0", "v1.0.0", "2.0.0")]
38
+ [InlineData("Azure.AI.VoiceLive", "Azure.AI.VoiceLive_1.1.0", "Azure.AI.VoiceLive_1.1.0", "1.1.0")]
39
+ [InlineData("Microsoft.Azure.Functions.Worker.Extensions.CosmosDB", "Microsoft.Azure.Functions.Worker.Extensions.CosmosDB 4.16.1", "cosmosdb-extension-4.16.1", "4.16.1")]
40
+ [InlineData("Microsoft.NET.Sdk.Functions", "Microsoft.Net.Sdk.Functions 4.1.0", "4.1.0", "4.1.0")]
41
+ [InlineData("System.CommandLine", "System.CommandLine v2.0.2", "v2.0.2", "2.0.2")]
42
+ [InlineData("AWSSDK.S3", "4.0.262.0", "4.0.262.0", "4.0.262.0")]
43
+ public void GetVersionFromNames_WithDependencyName(string dependencyName, string releaseName, string tagName, string expectedVersion)
44
+ {
45
+ var actualVersion = IPackageDetailFinder.GetVersionFromNames(releaseName, tagName, dependencyName);
46
+
47
+ Assert.NotNull(actualVersion);
48
+ Assert.Equal(expectedVersion, actualVersion.ToString());
49
+ }
50
+
51
+ [Theory]
52
+ [InlineData("some.package", "other.package v1.0.0", "v1.0.0", true)]
53
+ [InlineData("some.package", "some.package v1.0.0", "v1.0.0", false)]
54
+ [InlineData("some.package", "Azure.AI.VoiceLive_1.1.0", "v1.1.0", true)]
55
+ [InlineData("some.package", "System.CommandLine v2.0.2", "v2.0.2", true)]
56
+ [InlineData("some.package", "BenchmarkDotNet v0.15.8", "v0.15.8", false)]
57
+ [InlineData("some.package", "release 1.0.0", "v1.0.0", false)]
58
+ public void HasPackageScopedVersionForOtherDependency(string dependencyName, string releaseName, string tagName, bool expectedResult)
59
+ {
60
+ var actualResult = IPackageDetailFinder.HasPackageScopedVersionForOtherDependency(releaseName, tagName, dependencyName);
61
+
62
+ Assert.Equal(expectedResult, actualResult);
63
+ }
30
64
  }
@@ -71,6 +71,24 @@ public class UpdateHandlerSelectionTests : UpdateHandlersTestsBase
71
71
  GroupUpdateAllVersionsHandler.Instance,
72
72
  ];
73
73
 
74
+ // multi-ecosystem update; this short-circuits to `group_update_all_versions` even when
75
+ // `UpdatingAPullRequest` is true, no top-level dependencies are listed, and a group is
76
+ // being refreshed (regression test for "Unable to find appropriate update handler.")
77
+ yield return
78
+ [
79
+ new Job()
80
+ {
81
+ Source = CreateJobSource("/"),
82
+ Dependencies = [],
83
+ DependencyGroups = [new() { Name = "some-group" }],
84
+ DependencyGroupToRefresh = "some-group",
85
+ SecurityUpdatesOnly = false,
86
+ UpdatingAPullRequest = true,
87
+ MultiEcosystemUpdate = true,
88
+ },
89
+ GroupUpdateAllVersionsHandler.Instance,
90
+ ];
91
+
74
92
  //
75
93
  // update_version_group_pr
76
94
  //
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.384.0
4
+ version: 0.385.0
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.384.0
18
+ version: 0.385.0
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.384.0
25
+ version: 0.385.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: debug
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -581,7 +581,7 @@ licenses:
581
581
  - MIT
582
582
  metadata:
583
583
  bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
584
- changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.384.0
584
+ changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.385.0
585
585
  rdoc_options: []
586
586
  require_paths:
587
587
  - lib