dependabot-nuget 0.245.0 → 0.247.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/PackagesConfigUpdater.cs +42 -7
  3. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/SdkPackageUpdater.cs +164 -90
  4. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/UpdaterWorker.cs +38 -2
  5. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/MSBuildHelper.cs +92 -18
  6. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/NuGetHelper.cs +1 -1
  7. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/PathHelper.cs +27 -0
  8. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTestBase.cs +115 -14
  9. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/{UpdateWorker.DirsProj.cs → UpdateWorkerTests.DirsProj.cs} +22 -24
  10. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.PackagesConfig.cs +66 -0
  11. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.Sdk.cs +373 -83
  12. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs +117 -4
  13. data/lib/dependabot/nuget/cache_manager.rb +9 -3
  14. data/lib/dependabot/nuget/file_fetcher/import_paths_finder.rb +15 -12
  15. data/lib/dependabot/nuget/file_fetcher/sln_project_paths_finder.rb +13 -3
  16. data/lib/dependabot/nuget/file_fetcher.rb +79 -31
  17. data/lib/dependabot/nuget/file_parser/dotnet_tools_json_parser.rb +10 -2
  18. data/lib/dependabot/nuget/file_parser/global_json_parser.rb +10 -2
  19. data/lib/dependabot/nuget/file_parser/packages_config_parser.rb +11 -2
  20. data/lib/dependabot/nuget/file_parser/project_file_parser.rb +140 -45
  21. data/lib/dependabot/nuget/file_parser/property_value_finder.rb +57 -5
  22. data/lib/dependabot/nuget/file_parser.rb +18 -4
  23. data/lib/dependabot/nuget/file_updater/property_value_updater.rb +25 -8
  24. data/lib/dependabot/nuget/file_updater.rb +74 -38
  25. data/lib/dependabot/nuget/http_response_helpers.rb +19 -0
  26. data/lib/dependabot/nuget/metadata_finder.rb +32 -4
  27. data/lib/dependabot/nuget/nuget_client.rb +31 -13
  28. data/lib/dependabot/nuget/requirement.rb +4 -1
  29. data/lib/dependabot/nuget/update_checker/compatibility_checker.rb +26 -15
  30. data/lib/dependabot/nuget/update_checker/dependency_finder.rb +23 -13
  31. data/lib/dependabot/nuget/update_checker/nupkg_fetcher.rb +83 -21
  32. data/lib/dependabot/nuget/update_checker/repository_finder.rb +29 -13
  33. data/lib/dependabot/nuget/update_checker/tfm_finder.rb +2 -2
  34. data/lib/dependabot/nuget/update_checker/version_finder.rb +15 -6
  35. data/lib/dependabot/nuget/update_checker.rb +6 -7
  36. data/lib/dependabot/nuget/version.rb +7 -2
  37. metadata +21 -7
  38. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/SdkPackageUpdaterTests.cs +0 -317
@@ -1072,6 +1072,72 @@ public partial class UpdateWorkerTests
1072
1072
  """);
1073
1073
  }
1074
1074
 
1075
+ [Fact]
1076
+ public async Task PackageCanBeUpdatedWhenAnotherInstalledPackageHasBeenDelisted()
1077
+ {
1078
+ // updating one package (Newtonsoft.Json) when another installed package (FSharp.Core/5.0.3-beta.21369.4) has been delisted
1079
+ await TestUpdateForProject("Newtonsoft.Json", "7.0.1", "13.0.1",
1080
+ // existing
1081
+ projectContents: """
1082
+ <Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1083
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
1084
+ <PropertyGroup>
1085
+ <TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
1086
+ </PropertyGroup>
1087
+ <ItemGroup>
1088
+ <None Include="packages.config" />
1089
+ </ItemGroup>
1090
+ <ItemGroup>
1091
+ <Reference Include="FSharp.Core, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
1092
+ <HintPath>packages\FSharp.Core.5.0.3-beta.21369.4\lib\netstandard2.0\FSharp.Core.dll</HintPath>
1093
+ <Private>True</Private>
1094
+ </Reference>
1095
+ <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
1096
+ <HintPath>packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
1097
+ <Private>True</Private>
1098
+ </Reference>
1099
+ </ItemGroup>
1100
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
1101
+ </Project>
1102
+ """,
1103
+ packagesConfigContents: """
1104
+ <packages>
1105
+ <package id="FSharp.Core" version="5.0.3-beta.21369.4" targetFramework="net462" />
1106
+ <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net462" />
1107
+ </packages>
1108
+ """,
1109
+ // expected
1110
+ expectedProjectContents: """
1111
+ <Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1112
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
1113
+ <PropertyGroup>
1114
+ <TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
1115
+ </PropertyGroup>
1116
+ <ItemGroup>
1117
+ <None Include="packages.config" />
1118
+ </ItemGroup>
1119
+ <ItemGroup>
1120
+ <Reference Include="FSharp.Core, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
1121
+ <HintPath>packages\FSharp.Core.5.0.3-beta.21369.4\lib\netstandard2.0\FSharp.Core.dll</HintPath>
1122
+ <Private>True</Private>
1123
+ </Reference>
1124
+ <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
1125
+ <HintPath>packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
1126
+ <Private>True</Private>
1127
+ </Reference>
1128
+ </ItemGroup>
1129
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
1130
+ </Project>
1131
+ """,
1132
+ expectedPackagesConfigContents: """
1133
+ <?xml version="1.0" encoding="utf-8"?>
1134
+ <packages>
1135
+ <package id="FSharp.Core" version="5.0.3-beta.21369.4" targetFramework="net462" />
1136
+ <package id="Newtonsoft.Json" version="13.0.1" targetFramework="net462" />
1137
+ </packages>
1138
+ """);
1139
+ }
1140
+
1075
1141
  protected static Task TestUpdateForProject(
1076
1142
  string dependencyName,
1077
1143
  string oldVersion,