dependabot-nuget 0.327.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 +4 -4
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/PullRequestTextGenerator.cs +5 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/EndToEndTests.cs +247 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/PullRequestTextTests.cs +18 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/FileWriters/XmlFileWriterTests.cs +58 -0
- 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: f873f613d2174dfdf82367b571a8f389e332d02f2dfb0f3e37e7db656bcb0442
|
4
|
+
data.tar.gz: fa66bffbadf7e9e8d51dd2d7fabfa60562504315b2c03fe5722aad203e582982
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b45f0eb1a0fc68119d181985244952bd0527d344ef54265bc3d8810e30083f3f6aff61225e4d813d195a723905b77e9fd76f18b0a7c99c06978a028d8d56b82c
|
7
|
+
data.tar.gz: 68f201f704f413c26db73bb7a6fa6235013761189153585adf6822cdc6cca93a0ce6bd88c89997b3f34a0502df1636a36f7e23be216b648273ec5caef692c919
|
@@ -95,8 +95,11 @@ public class PullRequestTextGenerator
|
|
95
95
|
private static string GetDependencySetBumpText(DependencySet dependencySet, bool isCommitMessageDetail)
|
96
96
|
{
|
97
97
|
var bumpSuffix = isCommitMessageDetail ? "s" : string.Empty; // "Bumps" for commit message details, "Bump" otherwise
|
98
|
-
var
|
99
|
-
|
98
|
+
var versionSets = dependencySet.Versions
|
99
|
+
.DistinctBy(versionSet => $"{versionSet.OldVersion}/{versionSet.NewVersion}".ToLowerInvariant())
|
100
|
+
.ToArray();
|
101
|
+
var fromText = versionSets.Length == 1 && versionSets[0].OldVersion is not null
|
102
|
+
? $"from {versionSets[0].OldVersion} "
|
100
103
|
: string.Empty;
|
101
104
|
var newVersions = dependencySet.Versions
|
102
105
|
.Select(v => v.NewVersion)
|
@@ -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
|
{
|
@@ -32,6 +32,22 @@ public class PullRequestTextTests
|
|
32
32
|
Assert.Equal(expectedTitle, actualTitle);
|
33
33
|
}
|
34
34
|
|
35
|
+
[Fact]
|
36
|
+
public void FromClauseInTitleIsIncludedIfVersionUpdatesAreIdentical()
|
37
|
+
{
|
38
|
+
// this can happen if the same update was performed for multiple projects
|
39
|
+
var job = FromCommitOptions(null);
|
40
|
+
var updateOperations = new UpdateOperationBase[]
|
41
|
+
{
|
42
|
+
new DirectUpdate() { DependencyName = "Some.Dependency", OldVersion = NuGetVersion.Parse("1.0.0"), NewVersion = NuGetVersion.Parse("2.0.0"), UpdatedFiles = [] },
|
43
|
+
new DirectUpdate() { DependencyName = "Some.Dependency", OldVersion = NuGetVersion.Parse("1.0.0"), NewVersion = NuGetVersion.Parse("2.0.0"), UpdatedFiles = [] },
|
44
|
+
};
|
45
|
+
|
46
|
+
var actualTitle = PullRequestTextGenerator.GetPullRequestTitle(job, [.. updateOperations], dependencyGroupName: null);
|
47
|
+
var expectedTitle = "Bump Some.Dependency from 1.0.0 to 2.0.0";
|
48
|
+
Assert.Equal(expectedTitle, actualTitle);
|
49
|
+
}
|
50
|
+
|
35
51
|
[Theory]
|
36
52
|
[MemberData(nameof(GetPullRequestTextTestData))]
|
37
53
|
public async Task PullRequestText(
|
@@ -422,7 +438,7 @@ public class PullRequestTextTests
|
|
422
438
|
new DirectUpdate()
|
423
439
|
{
|
424
440
|
DependencyName = "Some.Package",
|
425
|
-
OldVersion = NuGetVersion.Parse("1.
|
441
|
+
OldVersion = NuGetVersion.Parse("1.1.0"),
|
426
442
|
NewVersion = NuGetVersion.Parse("1.2.3"),
|
427
443
|
UpdatedFiles = ["b.txt"]
|
428
444
|
}
|
@@ -439,6 +455,7 @@ public class PullRequestTextTests
|
|
439
455
|
"""
|
440
456
|
Performed the following updates:
|
441
457
|
- Updated Some.Package from 1.0.0 to 1.2.3
|
458
|
+
- Updated Some.Package from 1.1.0 to 1.2.3
|
442
459
|
"""
|
443
460
|
];
|
444
461
|
}
|
data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/FileWriters/XmlFileWriterTests.cs
CHANGED
@@ -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.
|
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.
|
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.
|
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.
|
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
|