dependabot-nuget 0.390.0 → 0.391.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/Discover/SdkProjectDiscovery.cs +3 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/PullRequestBodyGenerator/IHttpFetcher.cs +7 -7
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.Project.cs +99 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/PullRequestBodyGenerator/DetailedPullRequestBodyGeneratorTests.cs +51 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/PullRequestBodyGenerator/TestHttpFetcher.cs +4 -4
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/PullRequestBodyGenerator/TestStringResponseHttpFetcher.cs +22 -0
- metadata +5 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 77af432356459751ea1d2c6f1ed0d68a3d2f12b015a7dfd36de0c24d8254a888
|
|
4
|
+
data.tar.gz: de6b8f6ab06eb682d9e5618e526ef26f947c303594c4cc3f59e9459144929fc3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: de3e980ea5880e4573aba8d613be11890714dc97ad249f246dec1bf5faa6ec4cb583dcc67cdad1611592463c3ef5e90c2eaf45706c3a12b4edde00aedec72e48
|
|
7
|
+
data.tar.gz: 2ecabb1096fbe914e95e177bdca71e3deba40b71c15443de341c8a83ea6b0a683fcf1b21da2a6f376c0c1599047c6bbe0bbd40cecb2573f7ff0d99357f7d2611
|
|
@@ -178,6 +178,9 @@ internal static class SdkProjectDiscovery
|
|
|
178
178
|
args.Add($"/p:InnerTargets=\"{string.Join(";", requiredTargets)}\"");
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
+
// only execute the desired targets on transitive project references
|
|
182
|
+
args.Add($"/p:ProjectReferenceBuildTargets=\"{string.Join(";", requiredTargets)}\"");
|
|
183
|
+
|
|
181
184
|
// inject various props and targets to help with discovery
|
|
182
185
|
var dependencyDiscoveryTargetingPacksPropsPath = MSBuildHelper.GetFileFromRuntimeDirectory("DependencyDiscoveryTargetingPacks.props");
|
|
183
186
|
var dependencyDiscoveryTargetsPath = MSBuildHelper.GetFileFromRuntimeDirectory("DependencyDiscovery.targets");
|
data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/PullRequestBodyGenerator/IHttpFetcher.cs
CHANGED
|
@@ -11,18 +11,18 @@ internal static class IHttpFetcherExtensions
|
|
|
11
11
|
{
|
|
12
12
|
public static async Task<JsonElement?> GetJsonElementAsync(this IHttpFetcher fetcher, string url)
|
|
13
13
|
{
|
|
14
|
-
var jsonString = await fetcher.GetStringAsync(url);
|
|
15
|
-
if (jsonString is null)
|
|
16
|
-
{
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
14
|
try
|
|
21
15
|
{
|
|
16
|
+
var jsonString = await fetcher.GetStringAsync(url);
|
|
17
|
+
if (jsonString is null)
|
|
18
|
+
{
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
22
|
var json = JsonSerializer.Deserialize<JsonElement>(jsonString);
|
|
23
23
|
return json;
|
|
24
24
|
}
|
|
25
|
-
catch (
|
|
25
|
+
catch (Exception)
|
|
26
26
|
{
|
|
27
27
|
return null;
|
|
28
28
|
}
|
data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.Project.cs
CHANGED
|
@@ -955,5 +955,104 @@ public partial class DiscoveryWorkerTests
|
|
|
955
955
|
}
|
|
956
956
|
);
|
|
957
957
|
}
|
|
958
|
+
|
|
959
|
+
[Fact]
|
|
960
|
+
public async Task RestoreDoesNotCallBuildOnTransitiveProjectReference()
|
|
961
|
+
{
|
|
962
|
+
// Ensure the `Build` target isn't invoked in transitive project references.
|
|
963
|
+
|
|
964
|
+
// To test this a custom target is added with `BeforeTargets="Build"` which writes a sentinel file to disk
|
|
965
|
+
// so we have to ensure that file doesn't get created.
|
|
966
|
+
using var tempDir = new TemporaryDirectory();
|
|
967
|
+
var sentinelFile1 = Path.Combine(tempDir.DirectoryPath, "sentinel1.txt");
|
|
968
|
+
var sentinelFile2 = Path.Combine(tempDir.DirectoryPath, "sentinel2.txt");
|
|
969
|
+
|
|
970
|
+
await TestDiscoveryAsync(
|
|
971
|
+
packages:
|
|
972
|
+
[
|
|
973
|
+
MockNuGetPackage.CreateSimplePackage("Some.Package", "1.0.0", "net10.0"),
|
|
974
|
+
],
|
|
975
|
+
workspacePath: "src/client",
|
|
976
|
+
files: [
|
|
977
|
+
("Directory.Build.props", "<Project />"),
|
|
978
|
+
("Directory.Build.targets", "<Project />"),
|
|
979
|
+
("Directory.Packages.props", """
|
|
980
|
+
<Project>
|
|
981
|
+
<PropertyGroup>
|
|
982
|
+
<ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
|
|
983
|
+
</PropertyGroup>
|
|
984
|
+
</Project>
|
|
985
|
+
"""),
|
|
986
|
+
("src/client/client.csproj", $$"""
|
|
987
|
+
<Project Sdk="Microsoft.NET.Sdk">
|
|
988
|
+
<PropertyGroup>
|
|
989
|
+
<TargetFramework>net10.0</TargetFramework>
|
|
990
|
+
</PropertyGroup>
|
|
991
|
+
<ItemGroup>
|
|
992
|
+
<ProjectReference Include="..\common\common.csproj" />
|
|
993
|
+
</ItemGroup>
|
|
994
|
+
<Target Name="BuildSentinel" BeforeTargets="Build">
|
|
995
|
+
<WriteLinesToFile File="{{sentinelFile1}}" Lines="Build target was called" Overwrite="true" />
|
|
996
|
+
</Target>
|
|
997
|
+
</Project>
|
|
998
|
+
"""),
|
|
999
|
+
("src/common/common.csproj", $$"""
|
|
1000
|
+
<Project Sdk="Microsoft.NET.Sdk">
|
|
1001
|
+
<PropertyGroup>
|
|
1002
|
+
<TargetFramework>net10.0</TargetFramework>
|
|
1003
|
+
</PropertyGroup>
|
|
1004
|
+
<ItemGroup>
|
|
1005
|
+
<PackageReference Include="Some.Package" Version="1.0.0" />
|
|
1006
|
+
</ItemGroup>
|
|
1007
|
+
<Target Name="BuildSentinel" BeforeTargets="Build">
|
|
1008
|
+
<WriteLinesToFile File="{{sentinelFile2}}" Lines="Build target was called" Overwrite="true" />
|
|
1009
|
+
</Target>
|
|
1010
|
+
</Project>
|
|
1011
|
+
"""),
|
|
1012
|
+
],
|
|
1013
|
+
expectedResult: new()
|
|
1014
|
+
{
|
|
1015
|
+
Path = "src/client",
|
|
1016
|
+
Projects = [
|
|
1017
|
+
new()
|
|
1018
|
+
{
|
|
1019
|
+
FilePath = "client.csproj",
|
|
1020
|
+
TargetFrameworks = ["net10.0"],
|
|
1021
|
+
Dependencies = [
|
|
1022
|
+
new("Some.Package", "1.0.0", DependencyType.Unknown, TargetFrameworks: ["net10.0"], IsTopLevel: false),
|
|
1023
|
+
],
|
|
1024
|
+
ReferencedProjectPaths = [
|
|
1025
|
+
"../common/common.csproj"
|
|
1026
|
+
],
|
|
1027
|
+
ImportedFiles = [
|
|
1028
|
+
"../../Directory.Build.props",
|
|
1029
|
+
"../../Directory.Build.targets",
|
|
1030
|
+
"../../Directory.Packages.props"
|
|
1031
|
+
],
|
|
1032
|
+
AdditionalFiles = [],
|
|
1033
|
+
},
|
|
1034
|
+
new()
|
|
1035
|
+
{
|
|
1036
|
+
FilePath = "../common/common.csproj",
|
|
1037
|
+
TargetFrameworks = ["net10.0"],
|
|
1038
|
+
Dependencies = [
|
|
1039
|
+
new("Some.Package", "1.0.0", DependencyType.PackageReference, TargetFrameworks: ["net10.0"], IsTopLevel: true),
|
|
1040
|
+
],
|
|
1041
|
+
ReferencedProjectPaths = [],
|
|
1042
|
+
ImportedFiles = [
|
|
1043
|
+
"../../Directory.Build.props",
|
|
1044
|
+
"../../Directory.Build.targets",
|
|
1045
|
+
"../../Directory.Packages.props"
|
|
1046
|
+
],
|
|
1047
|
+
AdditionalFiles = [],
|
|
1048
|
+
}
|
|
1049
|
+
],
|
|
1050
|
+
}
|
|
1051
|
+
);
|
|
1052
|
+
|
|
1053
|
+
// Verify that the Build target was not called (and BeforeTargets="Build") by checking that the sentinel file was not created
|
|
1054
|
+
Assert.False(File.Exists(sentinelFile1), "Build target should not have been called on primary project");
|
|
1055
|
+
Assert.False(File.Exists(sentinelFile2), "Build target should not have been called on referenced project");
|
|
1056
|
+
}
|
|
958
1057
|
}
|
|
959
1058
|
}
|
|
@@ -1088,6 +1088,56 @@ public class DetailedPullRequestBodyGeneratorTests
|
|
|
1088
1088
|
);
|
|
1089
1089
|
}
|
|
1090
1090
|
|
|
1091
|
+
[Fact]
|
|
1092
|
+
public async Task ExceptionDuringDetailFetchDoesNotAbortDetailsBuilding()
|
|
1093
|
+
{
|
|
1094
|
+
// arrange
|
|
1095
|
+
var throwingHttpFetcher = new TestHttpFetcher(_ => throw new HttpRequestException("this endpoint cannot be queried"));
|
|
1096
|
+
var prGenerator = new DetailedPullRequestBodyGenerator(throwingHttpFetcher);
|
|
1097
|
+
var job = new Job()
|
|
1098
|
+
{
|
|
1099
|
+
Source = new()
|
|
1100
|
+
{
|
|
1101
|
+
Provider = "github",
|
|
1102
|
+
Repo = "test/repo"
|
|
1103
|
+
},
|
|
1104
|
+
};
|
|
1105
|
+
var updateOperationsPerformed = ImmutableArray.Create<UpdateOperationBase>(
|
|
1106
|
+
new DirectUpdate()
|
|
1107
|
+
{
|
|
1108
|
+
DependencyName = "Some.Dependency",
|
|
1109
|
+
OldVersion = NuGetVersion.Parse("1.0.0"),
|
|
1110
|
+
NewVersion = NuGetVersion.Parse("2.0.0"),
|
|
1111
|
+
UpdatedFiles = []
|
|
1112
|
+
}
|
|
1113
|
+
);
|
|
1114
|
+
var updatedDependencies = ImmutableArray.Create(
|
|
1115
|
+
new ReportedDependency()
|
|
1116
|
+
{
|
|
1117
|
+
Name = "Some.Dependency",
|
|
1118
|
+
PreviousVersion = "1.0.0",
|
|
1119
|
+
Version = "2.0.0",
|
|
1120
|
+
Requirements = [
|
|
1121
|
+
new ReportedRequirement()
|
|
1122
|
+
{
|
|
1123
|
+
File = "",
|
|
1124
|
+
Requirement = "2.0.0",
|
|
1125
|
+
Source = new()
|
|
1126
|
+
{
|
|
1127
|
+
SourceUrl = "https://github.com/Some.Owner/Some.Dependency",
|
|
1128
|
+
},
|
|
1129
|
+
}
|
|
1130
|
+
]
|
|
1131
|
+
}
|
|
1132
|
+
);
|
|
1133
|
+
|
|
1134
|
+
// act
|
|
1135
|
+
var prBody = await prGenerator.GeneratePullRequestBodyTextAsync(job, updateOperationsPerformed, updatedDependencies);
|
|
1136
|
+
|
|
1137
|
+
// assert
|
|
1138
|
+
Assert.Contains("No release notes found for this version range.", prBody);
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1091
1141
|
private static async Task TestAsync(
|
|
1092
1142
|
ImmutableArray<UpdateOperationBase> updateOperationsPerformed,
|
|
1093
1143
|
ImmutableArray<ReportedDependency> updatedDependencies,
|
|
@@ -1108,7 +1158,7 @@ public class DetailedPullRequestBodyGeneratorTests
|
|
|
1108
1158
|
|
|
1109
1159
|
// act
|
|
1110
1160
|
var responses = httpResponses.ToDictionary(x => x.Url, x => x.Body);
|
|
1111
|
-
var httpFetcher = new
|
|
1161
|
+
var httpFetcher = new TestStringResponseHttpFetcher(responses);
|
|
1112
1162
|
var generator = new DetailedPullRequestBodyGenerator(httpFetcher);
|
|
1113
1163
|
var actualBody = await generator.GeneratePullRequestBodyTextAsync(job, updateOperationsPerformed, updatedDependencies);
|
|
1114
1164
|
|
data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/PullRequestBodyGenerator/TestHttpFetcher.cs
CHANGED
|
@@ -4,11 +4,11 @@ namespace NuGetUpdater.Core.Test.Run.PullRequestBodyGenerator;
|
|
|
4
4
|
|
|
5
5
|
internal class TestHttpFetcher : IHttpFetcher
|
|
6
6
|
{
|
|
7
|
-
private readonly
|
|
7
|
+
private readonly Func<string, string?> _responseHandler;
|
|
8
8
|
|
|
9
|
-
public TestHttpFetcher(
|
|
9
|
+
public TestHttpFetcher(Func<string, string?> responseHandler)
|
|
10
10
|
{
|
|
11
|
-
|
|
11
|
+
_responseHandler = responseHandler;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
public void Dispose()
|
|
@@ -17,7 +17,7 @@ internal class TestHttpFetcher : IHttpFetcher
|
|
|
17
17
|
|
|
18
18
|
public Task<string?> GetStringAsync(string url)
|
|
19
19
|
{
|
|
20
|
-
|
|
20
|
+
var response = _responseHandler(url);
|
|
21
21
|
return Task.FromResult(response);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
namespace NuGetUpdater.Core.Test.Run.PullRequestBodyGenerator;
|
|
2
|
+
|
|
3
|
+
internal class TestStringResponseHttpFetcher : TestHttpFetcher
|
|
4
|
+
{
|
|
5
|
+
public TestStringResponseHttpFetcher(Dictionary<string, string> responses)
|
|
6
|
+
: base(BuildResponseGenerator(responses))
|
|
7
|
+
{
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
private static Func<string, string?> BuildResponseGenerator(Dictionary<string, string> responses)
|
|
11
|
+
{
|
|
12
|
+
return new Func<string, string?>(url =>
|
|
13
|
+
{
|
|
14
|
+
if (responses.TryGetValue(url, out var response))
|
|
15
|
+
{
|
|
16
|
+
return response;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return null;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
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.391.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.391.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.391.0
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: debug
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -343,6 +343,7 @@ files:
|
|
|
343
343
|
- helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/PullRequestBodyGenerator/DetailedPullRequestBodyGeneratorTests.cs
|
|
344
344
|
- helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/PullRequestBodyGenerator/IPackageDetailFinderTests.cs
|
|
345
345
|
- helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/PullRequestBodyGenerator/TestHttpFetcher.cs
|
|
346
|
+
- helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/PullRequestBodyGenerator/TestStringResponseHttpFetcher.cs
|
|
346
347
|
- helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/PullRequestTextTests.cs
|
|
347
348
|
- helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/RunWorkerTests.cs
|
|
348
349
|
- helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/SerializationTests.cs
|
|
@@ -581,7 +582,7 @@ licenses:
|
|
|
581
582
|
- MIT
|
|
582
583
|
metadata:
|
|
583
584
|
bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
|
|
584
|
-
changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.
|
|
585
|
+
changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.391.0
|
|
585
586
|
rdoc_options: []
|
|
586
587
|
require_paths:
|
|
587
588
|
- lib
|