dependabot-nuget 0.343.0 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0a5be5cf920a9c9314b1377a657101d176b366b50cc385a9271056c55302a59
4
- data.tar.gz: 35f2e1f95b349a6044a955c633a69bafa1a887859fe7324b77c6c5a94621dcf5
3
+ metadata.gz: 79344385eec91d92a3c7182eb639186693399069d4c3c761528fe5090633a7ca
4
+ data.tar.gz: 174ba03152133f0c03fe6da96cae0b110b6f7642482c325be3dfab2a397b261f
5
5
  SHA512:
6
- metadata.gz: 121232d229b12c58087f63704e5e3e3ccee8e3e1b60f13e62645043c7607499d1042bd60bb2a0b0298e981c3b3bd9c8a0c0c2f2bec2ed49287024d6404b905ad
7
- data.tar.gz: f619759742611bc9ea752fd5edbab1c647448ed0dfa7ef35ae37d7bf0d6e52548ad8f4fcc3c2489c3288c0833d03c3a871a68e3b500aad8ad11860a68b46f6fd
6
+ metadata.gz: 38b2c7817daaca765ff4f7736da12e50fc71d8a22d2e680ac740e26d106d79f2fea17b8f68ab35748dbb15dae2b966937b0120a2a8138958b85cf2652982b6c2
7
+ data.tar.gz: 30e4eebd3db7f09e8b9c6af6bbbfdee7a1456e0c1a001ef774ed71f9bfbba85bd9680623489a5e9893c942b7d2490051465d66b92932492eb8ec39f7d5a4b432
@@ -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
- if (job.DependencyGroups.Length > 0)
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)
@@ -270,7 +270,7 @@ public class GroupUpdateAllVersionsHandlerTests : UpdateHandlersTestsBase
270
270
  }
271
271
 
272
272
  [Fact]
273
- public async Task GeneratesCreatePullRequest_Grouped()
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[] { "Unrelated.*" },
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("Unrelated.Dependency", "5.0.0", DependencyType.PackageReference, TargetFrameworks: ["net9.0"]),
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("Unrelated.Dependency", "5.0.0", DependencyType.PackageReference, TargetFrameworks: ["net9.0"]),
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 = "Unrelated.Dependency",
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 = "Unrelated.Dependency",
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
  );
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.343.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.343.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.343.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.343.0
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