dependabot-nuget 0.328.0 → 0.330.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: '09ae6dbe226d6d00025aa74b8f0613d268e90d953814035ea0ad29a3d2e52a5b'
4
- data.tar.gz: a2fd825757de0432ddd827369de7af738208c37af957bbb1538a2cce78ef4e6f
3
+ metadata.gz: f873f613d2174dfdf82367b571a8f389e332d02f2dfb0f3e37e7db656bcb0442
4
+ data.tar.gz: fa66bffbadf7e9e8d51dd2d7fabfa60562504315b2c03fe5722aad203e582982
5
5
  SHA512:
6
- metadata.gz: deebe462e36a97c7b8e8867f75f83fd10fc8c70e5eafcef53dfdb784cf6e29f20d0a89497de26262e4889add3653117fcf1f61c8716eb038387278a1639d8d52
7
- data.tar.gz: d0be5bc8f335e9e133f68c8560d318907a96909c0ff809786541a481b93076f31fd34ef358a83eb0c90a1a3088fe4a50d33e041cad843ac2c9c4d3cc94d16fd2
6
+ metadata.gz: b45f0eb1a0fc68119d181985244952bd0527d344ef54265bc3d8810e30083f3f6aff61225e4d813d195a723905b77e9fd76f18b0a7c99c06978a028d8d56b82c
7
+ data.tar.gz: 68f201f704f413c26db73bb7a6fa6235013761189153585adf6822cdc6cca93a0ce6bd88c89997b3f34a0502df1636a36f7e23be216b648273ec5caef692c919
@@ -482,6 +482,253 @@ public class EndToEndTests
482
482
  );
483
483
  }
484
484
 
485
+ [Fact]
486
+ public async Task WithJsonFiles()
487
+ {
488
+ await RunAsync(
489
+ packages: [
490
+ // dotnet-tools.json packages
491
+ MockNuGetPackage.CreateDotNetToolPackage("Test.Tool", "1.0.0", "net9.0"),
492
+ MockNuGetPackage.CreateDotNetToolPackage("Test.Tool", "2.0.0", "net9.0"),
493
+ // global.json packages
494
+ MockNuGetPackage.CreateMSBuildSdkPackage("TestSdk", "3.10.1"),
495
+ MockNuGetPackage.CreateMSBuildSdkPackage("TestSdk", "3.10.3"),
496
+ // regular package is up to date
497
+ MockNuGetPackage.CreateSimplePackage("Some.Package", "1.0.0", "net9.0"),
498
+ ],
499
+ job: new()
500
+ {
501
+ Source = new()
502
+ {
503
+ Provider = "github",
504
+ Repo = "test/repo",
505
+ Directory = "/",
506
+ }
507
+ },
508
+ files: [
509
+ (".config/dotnet-tools.json", """
510
+ {
511
+ "version": 1,
512
+ "isRoot": true,
513
+ "tools": {
514
+ "Test.Tool": {
515
+ "version": "1.0.0",
516
+ "commands": [
517
+ "test-tool"
518
+ ],
519
+ "rollForward": false
520
+ }
521
+ }
522
+ }
523
+ """),
524
+ ("global.json", """
525
+ {
526
+ "msbuild-sdks": {
527
+ "TestSdk": "3.10.1"
528
+ }
529
+ }
530
+ """),
531
+ ("Directory.Build.props", "<Project />"),
532
+ ("Directory.Build.targets", "<Project />"),
533
+ ("Directory.Packages.props", """
534
+ <Project>
535
+ <PropertyGroup>
536
+ <ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
537
+ </PropertyGroup>
538
+ </Project>
539
+ """),
540
+ ("project.csproj", """
541
+ <Project Sdk="Microsoft.NET.Sdk">
542
+ <PropertyGroup>
543
+ <TargetFramework>net9.0</TargetFramework>
544
+ </PropertyGroup>
545
+ <ItemGroup>
546
+ <PackageReference Include="Some.Package" Version="1.0.0" />
547
+ </ItemGroup>
548
+ </Project>
549
+ """)
550
+ ],
551
+ discoveryWorker: null, // use real worker
552
+ analyzeWorker: null, // use real worker
553
+ updaterWorker: null, // use real worker
554
+ expectedApiMessages: [
555
+ new IncrementMetric()
556
+ {
557
+ Metric = "updater.started",
558
+ Tags = new()
559
+ {
560
+ ["operation"] = "group_update_all_versions"
561
+ }
562
+ },
563
+ new UpdatedDependencyList()
564
+ {
565
+ Dependencies = [
566
+ new()
567
+ {
568
+ Name = "Test.Tool",
569
+ Version = "1.0.0",
570
+ Requirements = [
571
+ new()
572
+ {
573
+ Requirement = "1.0.0",
574
+ File = "/.config/dotnet-tools.json",
575
+ Groups = ["dependencies"],
576
+ }
577
+ ]
578
+ },
579
+ new()
580
+ {
581
+ Name = "TestSdk",
582
+ Version = "3.10.1",
583
+ Requirements = [
584
+ new()
585
+ {
586
+ Requirement = "3.10.1",
587
+ File = "/global.json",
588
+ Groups = ["dependencies"],
589
+ }
590
+ ]
591
+ },
592
+ new()
593
+ {
594
+ Name = "Some.Package",
595
+ Version = "1.0.0",
596
+ Requirements = [
597
+ new()
598
+ {
599
+ Requirement = "1.0.0",
600
+ File = "/project.csproj",
601
+ Groups = ["dependencies"],
602
+ }
603
+ ]
604
+ },
605
+ ],
606
+ DependencyFiles = [
607
+ "/.config/dotnet-tools.json",
608
+ "/Directory.Build.props",
609
+ "/Directory.Build.targets",
610
+ "/Directory.Packages.props",
611
+ "/global.json",
612
+ "/project.csproj",
613
+ ],
614
+ },
615
+ // for dotnet-tools.json
616
+ new CreatePullRequest()
617
+ {
618
+ Dependencies = [
619
+ new()
620
+ {
621
+ Name = "Test.Tool",
622
+ Version = "2.0.0",
623
+ Requirements = [
624
+ new()
625
+ {
626
+ Requirement = "2.0.0",
627
+ File = "/.config/dotnet-tools.json",
628
+ Groups = ["dependencies"],
629
+ Source = new()
630
+ {
631
+ SourceUrl = null,
632
+ Type = "nuget_repo",
633
+ }
634
+ }
635
+ ],
636
+ PreviousVersion = "1.0.0",
637
+ PreviousRequirements = [
638
+ new()
639
+ {
640
+ Requirement = "1.0.0",
641
+ File = "/.config/dotnet-tools.json",
642
+ Groups = ["dependencies"],
643
+ }
644
+ ],
645
+ },
646
+ ],
647
+ UpdatedDependencyFiles = [
648
+ new()
649
+ {
650
+ Directory = "/.config",
651
+ Name = "dotnet-tools.json",
652
+ Content = """
653
+ {
654
+ "version": 1,
655
+ "isRoot": true,
656
+ "tools": {
657
+ "Test.Tool": {
658
+ "version": "2.0.0",
659
+ "commands": [
660
+ "test-tool"
661
+ ],
662
+ "rollForward": false
663
+ }
664
+ }
665
+ }
666
+ """
667
+ },
668
+ ],
669
+ BaseCommitSha = "TEST-COMMIT-SHA",
670
+ CommitMessage = TestPullRequestCommitMessage,
671
+ PrTitle = TestPullRequestTitle,
672
+ PrBody = TestPullRequestBody,
673
+ DependencyGroup = null,
674
+ },
675
+ // for global.json
676
+ new CreatePullRequest()
677
+ {
678
+ Dependencies = [
679
+ new()
680
+ {
681
+ Name = "TestSdk",
682
+ Version = "3.10.3",
683
+ Requirements = [
684
+ new()
685
+ {
686
+ Requirement = "3.10.3",
687
+ File = "/global.json",
688
+ Groups = ["dependencies"],
689
+ Source = new()
690
+ {
691
+ SourceUrl = null,
692
+ Type = "nuget_repo",
693
+ }
694
+ }
695
+ ],
696
+ PreviousVersion = "3.10.1",
697
+ PreviousRequirements = [
698
+ new()
699
+ {
700
+ Requirement = "3.10.1",
701
+ File = "/global.json",
702
+ Groups = ["dependencies"],
703
+ }
704
+ ],
705
+ },
706
+ ],
707
+ UpdatedDependencyFiles = [
708
+ new()
709
+ {
710
+ Directory = "/",
711
+ Name = "global.json",
712
+ Content = """
713
+ {
714
+ "msbuild-sdks": {
715
+ "TestSdk": "3.10.3"
716
+ }
717
+ }
718
+ """
719
+ },
720
+ ],
721
+ BaseCommitSha = "TEST-COMMIT-SHA",
722
+ CommitMessage = TestPullRequestCommitMessage,
723
+ PrTitle = TestPullRequestTitle,
724
+ PrBody = TestPullRequestBody,
725
+ DependencyGroup = null,
726
+ },
727
+ new MarkAsProcessed("TEST-COMMIT-SHA")
728
+ ]
729
+ );
730
+ }
731
+
485
732
  [Fact]
486
733
  public async Task UpdatePackageWithDifferentVersionsInDifferentDirectories()
487
734
  {
@@ -297,6 +297,37 @@ public class XmlFileWriterTests : FileWriterTestsBase
297
297
  );
298
298
  }
299
299
 
300
+ [Fact]
301
+ public async Task SingleDependency_SingleFile_AttributeDirectUpdate_VersionRangeFromWildCard()
302
+ {
303
+ await TestAsync(
304
+ files: [
305
+ ("project.csproj", """
306
+ <Project Sdk="Microsoft.NET.Sdk">
307
+ <ItemGroup>
308
+ <PackageReference Include="Ignored.Dependency" Version="7.0.0" />
309
+ <PackageReference Include="Some.Dependency" Version="1.*" />
310
+ <PackageReference Include="Some.Other.Dependency" Version="8.0.0" />
311
+ </ItemGroup>
312
+ </Project>
313
+ """)
314
+ ],
315
+ initialProjectDependencyStrings: ["Some.Dependency/1.1.0"],
316
+ requiredDependencyStrings: ["Some.Dependency/2.0.0"],
317
+ expectedFiles: [
318
+ ("project.csproj", """
319
+ <Project Sdk="Microsoft.NET.Sdk">
320
+ <ItemGroup>
321
+ <PackageReference Include="Ignored.Dependency" Version="7.0.0" />
322
+ <PackageReference Include="Some.Dependency" Version="2.0.0" />
323
+ <PackageReference Include="Some.Other.Dependency" Version="8.0.0" />
324
+ </ItemGroup>
325
+ </Project>
326
+ """)
327
+ ]
328
+ );
329
+ }
330
+
300
331
  [Fact]
301
332
  public async Task SingleDependency_SingleFile_UpdateVersionAttribute()
302
333
  {
@@ -590,6 +621,33 @@ public class XmlFileWriterTests : FileWriterTestsBase
590
621
  );
591
622
  }
592
623
 
624
+ [Fact]
625
+ public async Task SingleDependency_SingleFile_NoChangeForWildCard()
626
+ {
627
+ await TestAsync(
628
+ files: [
629
+ ("project.csproj", """
630
+ <Project Sdk="Microsoft.NET.Sdk">
631
+ <ItemGroup>
632
+ <PackageReference Include="Some.Dependency" Version="1.*" />
633
+ </ItemGroup>
634
+ </Project>
635
+ """)
636
+ ],
637
+ initialProjectDependencyStrings: ["Some.Dependency/1.0.0"],
638
+ requiredDependencyStrings: ["Some.Dependency/1.0.0"],
639
+ expectedFiles: [
640
+ ("project.csproj", """
641
+ <Project Sdk="Microsoft.NET.Sdk">
642
+ <ItemGroup>
643
+ <PackageReference Include="Some.Dependency" Version="1.*" />
644
+ </ItemGroup>
645
+ </Project>
646
+ """)
647
+ ]
648
+ );
649
+ }
650
+
593
651
  [Fact]
594
652
  public async Task MultiDependency_SingleFile_AttributeDirectUpdate()
595
653
  {
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.328.0
4
+ version: 0.330.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.328.0
18
+ version: 0.330.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.328.0
25
+ version: 0.330.0
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.328.0
554
+ changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.330.0
555
555
  rdoc_options: []
556
556
  require_paths:
557
557
  - lib