dependabot-nuget 0.268.0 → 0.271.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli.Test/EntryPointTests.Update.cs +1 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/AnalyzeWorker.cs +6 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/CompatabilityChecker.cs +16 -13
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/Requirement.cs +8 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/SdkPackageUpdater.cs +17 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/DependencyConflictResolver.cs +689 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/MSBuildHelper.cs +187 -9
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Analyze/AnalyzeWorkerTests.cs +84 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Analyze/RequirementTests.cs +14 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/TemporaryEnvironment.cs +23 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.PackagesConfig.cs +164 -55
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.Sdk.cs +65 -10
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs +785 -1
- data/lib/dependabot/nuget/file_updater.rb +29 -13
- data/lib/dependabot/nuget/native_helpers.rb +6 -1
- metadata +7 -5
@@ -52,10 +52,13 @@ public partial class UpdateWorkerTests
|
|
52
52
|
);
|
53
53
|
}
|
54
54
|
|
55
|
-
[
|
56
|
-
|
55
|
+
[Theory]
|
56
|
+
[InlineData("true")]
|
57
|
+
[InlineData(null)]
|
58
|
+
public async Task UpdateVersionChildElement_InProjectFile_ForPackageReferenceIncludeTheory(string variableValue)
|
57
59
|
{
|
58
60
|
// update Some.Package from 9.0.1 to 13.0.1
|
61
|
+
using var env = new TemporaryEnvironment([("UseNewNugetPackageResolver", variableValue)]);
|
59
62
|
await TestUpdateForProject("Some.Package", "9.0.1", "13.0.1",
|
60
63
|
packages:
|
61
64
|
[
|
@@ -91,6 +94,43 @@ public partial class UpdateWorkerTests
|
|
91
94
|
);
|
92
95
|
}
|
93
96
|
|
97
|
+
[Fact]
|
98
|
+
public async Task CallingResolveDependencyConflictsNew()
|
99
|
+
{
|
100
|
+
// update Microsoft.CodeAnalysis.Common from 4.9.2 to 4.10.0
|
101
|
+
using var env = new TemporaryEnvironment([("UseNewNugetPackageResolver", "true")]);
|
102
|
+
await TestUpdateForProject("Microsoft.CodeAnalysis.Common", "4.9.2", "4.10.0",
|
103
|
+
// initial
|
104
|
+
projectContents: $"""
|
105
|
+
<Project Sdk="Microsoft.NET.Sdk">
|
106
|
+
<PropertyGroup>
|
107
|
+
<TargetFramework>net8.0</TargetFramework>
|
108
|
+
</PropertyGroup>
|
109
|
+
<ItemGroup>
|
110
|
+
<PackageReference Include="Microsoft.CodeAnalysis.Compilers" Version="4.9.2" />
|
111
|
+
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.9.2" />
|
112
|
+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" />
|
113
|
+
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic" Version="4.9.2" />
|
114
|
+
</ItemGroup>
|
115
|
+
</Project>
|
116
|
+
""",
|
117
|
+
// expected
|
118
|
+
expectedProjectContents: $"""
|
119
|
+
<Project Sdk="Microsoft.NET.Sdk">
|
120
|
+
<PropertyGroup>
|
121
|
+
<TargetFramework>net8.0</TargetFramework>
|
122
|
+
</PropertyGroup>
|
123
|
+
<ItemGroup>
|
124
|
+
<PackageReference Include="Microsoft.CodeAnalysis.Compilers" Version="4.10.0" />
|
125
|
+
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.10.0" />
|
126
|
+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.10.0" />
|
127
|
+
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic" Version="4.10.0" />
|
128
|
+
</ItemGroup>
|
129
|
+
</Project>
|
130
|
+
"""
|
131
|
+
);
|
132
|
+
}
|
133
|
+
|
94
134
|
[Fact]
|
95
135
|
public async Task UpdateVersions_InProjectFile_ForDuplicatePackageReferenceInclude()
|
96
136
|
{
|
@@ -489,9 +529,12 @@ public partial class UpdateWorkerTests
|
|
489
529
|
);
|
490
530
|
}
|
491
531
|
|
492
|
-
[
|
493
|
-
|
532
|
+
[Theory]
|
533
|
+
[InlineData(null)]
|
534
|
+
[InlineData("true")]
|
535
|
+
public async Task AddPackageReference_InProjectFile_ForTransientDependency(string variableValue)
|
494
536
|
{
|
537
|
+
using var env = new TemporaryEnvironment([("UseNewNugetPackageResolver", variableValue)]);
|
495
538
|
// add transient package Some.Transient.Dependency from 5.0.1 to 5.0.2
|
496
539
|
await TestUpdateForProject("Some.Transient.Dependency", "5.0.1", "5.0.2", isTransitive: true,
|
497
540
|
packages:
|
@@ -2862,9 +2905,13 @@ public partial class UpdateWorkerTests
|
|
2862
2905
|
);
|
2863
2906
|
}
|
2864
2907
|
|
2865
|
-
[
|
2866
|
-
|
2908
|
+
[Theory]
|
2909
|
+
[InlineData("true")]
|
2910
|
+
[InlineData(null)]
|
2911
|
+
public async Task NoChange_IfThereAreIncoherentVersions(string variableValue)
|
2867
2912
|
{
|
2913
|
+
using var env = new TemporaryEnvironment([("UseNewNugetPackageResolver", variableValue)]);
|
2914
|
+
|
2868
2915
|
// trying to update `Transitive.Dependency` to 1.1.0 would normally pull `Some.Package` from 1.0.0 to 1.1.0,
|
2869
2916
|
// but the TFM doesn't allow it
|
2870
2917
|
await TestNoChangeforProject("Transitive.Dependency", "1.0.0", "1.1.0",
|
@@ -2948,9 +2995,13 @@ public partial class UpdateWorkerTests
|
|
2948
2995
|
);
|
2949
2996
|
}
|
2950
2997
|
|
2951
|
-
[
|
2952
|
-
|
2998
|
+
[Theory]
|
2999
|
+
[InlineData("true")]
|
3000
|
+
[InlineData(null)]
|
3001
|
+
public async Task UnresolvablePropertyDoesNotStopOtherUpdates(string variableValue)
|
2953
3002
|
{
|
3003
|
+
using var env = new TemporaryEnvironment([("UseNewNugetPackageResolver", variableValue)]);
|
3004
|
+
|
2954
3005
|
// the property `$(SomeUnresolvableProperty)` cannot be resolved
|
2955
3006
|
await TestUpdateForProject("Some.Package", "7.0.1", "13.0.1",
|
2956
3007
|
packages:
|
@@ -2984,9 +3035,13 @@ public partial class UpdateWorkerTests
|
|
2984
3035
|
);
|
2985
3036
|
}
|
2986
3037
|
|
2987
|
-
[
|
2988
|
-
|
3038
|
+
[Theory]
|
3039
|
+
[InlineData("true")]
|
3040
|
+
[InlineData(null)]
|
3041
|
+
public async Task UpdatingPackageAlsoUpdatesAnythingWithADependencyOnTheUpdatedPackage(string variableValue)
|
2989
3042
|
{
|
3043
|
+
using var env = new TemporaryEnvironment([("UseNewNugetPackageResolver", variableValue)]);
|
3044
|
+
|
2990
3045
|
// updating Some.Package from 3.3.30 requires that Some.Package.Extensions also be updated
|
2991
3046
|
await TestUpdateForProject("Some.Package", "3.3.30", "3.4.3",
|
2992
3047
|
packages:
|