dependabot-nuget 0.295.0 → 0.296.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.Core/ExperimentsManager.cs +6 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/MSBuildHelper.cs +13 -6
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/SerializationTests.cs +30 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs +24 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22109eb4de3c3d7317682ad493e6162a7af4328e07751a27c8dbb48978597ef3
|
4
|
+
data.tar.gz: 9a8afdc613b3313c7e08ac3967c4abd311a6eb66a662022677bed40229e52d3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe8805919ec14b5bf6385d4bb4ff3a1dc00137fc08c1e002d8c3db0600c4e5c2e8e86319d3e40fe4c608d29229834c3c741fa8a262b3e8d9f9c8e21755cf9029
|
7
|
+
data.tar.gz: d0b247df044695e253e08ed9cabbdea0341ff9234ca601c61fc48d2f13ac138ffce51683ebf45ed37478190750a791bacbc3308ab0a69e3cff70e61cffb8576a
|
@@ -62,9 +62,13 @@ public record ExperimentsManager
|
|
62
62
|
return false;
|
63
63
|
}
|
64
64
|
|
65
|
-
|
65
|
+
// prefer experiments named with underscores, but hyphens are also allowed as an alternate
|
66
|
+
object? experimentValue;
|
67
|
+
var experimentNameAlternate = experimentName.Replace("_", "-");
|
68
|
+
if (experiments.TryGetValue(experimentName, out experimentValue) ||
|
69
|
+
experiments.TryGetValue(experimentNameAlternate, out experimentValue))
|
66
70
|
{
|
67
|
-
if ((
|
71
|
+
if ((experimentValue?.ToString() ?? "").Equals("true", StringComparison.OrdinalIgnoreCase))
|
68
72
|
{
|
69
73
|
return true;
|
70
74
|
}
|
@@ -924,7 +924,7 @@ internal static partial class MSBuildHelper
|
|
924
924
|
ThrowOnUnauthenticatedFeed(output);
|
925
925
|
ThrowOnMissingFile(output);
|
926
926
|
ThrowOnMissingPackages(output);
|
927
|
-
|
927
|
+
ThrowOnUpdateNotPossible(output);
|
928
928
|
}
|
929
929
|
|
930
930
|
private static void ThrowOnUnauthenticatedFeed(string stdout)
|
@@ -962,13 +962,20 @@ internal static partial class MSBuildHelper
|
|
962
962
|
}
|
963
963
|
}
|
964
964
|
|
965
|
-
private static void
|
965
|
+
private static void ThrowOnUpdateNotPossible(string output)
|
966
966
|
{
|
967
|
-
var
|
968
|
-
var match = unresolvablePackagePattern.Match(output);
|
969
|
-
if (match.Success)
|
967
|
+
var patterns = new[]
|
970
968
|
{
|
971
|
-
|
969
|
+
new Regex(@"Unable to resolve dependencies\. '(?<PackageName>[^ ]+) (?<PackageVersion>[^']+)'"),
|
970
|
+
new Regex(@"Could not install package '(?<PackageName>[^ ]+) (?<PackageVersion>[^']+)'. You are trying to install this package"),
|
971
|
+
new Regex(@"Unable to find a version of '[^']+' that is compatible with '[^ ]+ [^ ]+ constraint: (?<PackageName>[^ ]+) \([^ ]+ (?<PackageVersion>[^)]+)\)'"),
|
972
|
+
new Regex(@"the following error\(s\) may be blocking the current package operation: '(?<PackageName>[^ ]+) (?<PackageVersion>[^ ]+) constraint:"),
|
973
|
+
};
|
974
|
+
var matches = patterns.Select(p => p.Match(output)).Where(m => m.Success);
|
975
|
+
if (matches.Any())
|
976
|
+
{
|
977
|
+
var packages = matches.Select(m => $"{m.Groups["PackageName"].Value}.{m.Groups["PackageVersion"].Value}").Distinct().ToArray();
|
978
|
+
throw new UpdateNotPossibleException(packages);
|
972
979
|
}
|
973
980
|
}
|
974
981
|
|
@@ -227,6 +227,36 @@ public class SerializationTests
|
|
227
227
|
Assert.False(experimentsManager.UseDirectDiscovery);
|
228
228
|
}
|
229
229
|
|
230
|
+
[Fact]
|
231
|
+
public void DeserializeExperimentsManager_AlternateNames()
|
232
|
+
{
|
233
|
+
// experiment names can be either snake case or kebab case
|
234
|
+
var jobWrapper = RunWorker.Deserialize("""
|
235
|
+
{
|
236
|
+
"job": {
|
237
|
+
"package-manager": "nuget",
|
238
|
+
"allowed-updates": [
|
239
|
+
{
|
240
|
+
"update-type": "all"
|
241
|
+
}
|
242
|
+
],
|
243
|
+
"source": {
|
244
|
+
"provider": "github",
|
245
|
+
"repo": "some-org/some-repo",
|
246
|
+
"directory": "some-dir"
|
247
|
+
},
|
248
|
+
"experiments": {
|
249
|
+
"nuget-legacy-dependency-solver": true,
|
250
|
+
"nuget-use-direct-discovery": true
|
251
|
+
}
|
252
|
+
}
|
253
|
+
}
|
254
|
+
""");
|
255
|
+
var experimentsManager = ExperimentsManager.GetExperimentsManager(jobWrapper.Job.Experiments);
|
256
|
+
Assert.True(experimentsManager.UseLegacyDependencySolver);
|
257
|
+
Assert.True(experimentsManager.UseDirectDiscovery);
|
258
|
+
}
|
259
|
+
|
230
260
|
[Theory]
|
231
261
|
[MemberData(nameof(DeserializeErrorTypesData))]
|
232
262
|
public void SerializeError(JobErrorBase error, string expectedSerialization)
|
@@ -1450,6 +1450,30 @@ public class MSBuildHelperTests : TestBase
|
|
1450
1450
|
// expectedError
|
1451
1451
|
new UpdateNotPossible(["Some.Package.1.2.3"]),
|
1452
1452
|
];
|
1453
|
+
|
1454
|
+
yield return
|
1455
|
+
[
|
1456
|
+
// output
|
1457
|
+
"Could not install package 'Some.Package 1.2.3'. You are trying to install this package into a project that targets 'SomeFramework'",
|
1458
|
+
// expectedError
|
1459
|
+
new UpdateNotPossible(["Some.Package.1.2.3"]),
|
1460
|
+
];
|
1461
|
+
|
1462
|
+
yield return
|
1463
|
+
[
|
1464
|
+
// output
|
1465
|
+
"Unable to find a version of 'Some.Package' that is compatible with 'Some.Other.Package 4.5.6 constraint: Some.Package (>= 1.2.3)'",
|
1466
|
+
// expectedError
|
1467
|
+
new UpdateNotPossible(["Some.Package.1.2.3"]),
|
1468
|
+
];
|
1469
|
+
|
1470
|
+
yield return
|
1471
|
+
[
|
1472
|
+
// output
|
1473
|
+
"the following error(s) may be blocking the current package operation: 'Some.Package 1.2.3 constraint: Some.Other.Package (>= 4.5.6)'",
|
1474
|
+
// expectedError
|
1475
|
+
new UpdateNotPossible(["Some.Package.1.2.3"]),
|
1476
|
+
];
|
1453
1477
|
}
|
1454
1478
|
|
1455
1479
|
public static IEnumerable<object[]> GetTopLevelPackageDependencyInfosTestData()
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dependabot-nuget
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.296.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dependabot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dependabot-common
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.296.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.296.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rubyzip
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -529,7 +529,7 @@ licenses:
|
|
529
529
|
- MIT
|
530
530
|
metadata:
|
531
531
|
bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
|
532
|
-
changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.
|
532
|
+
changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.296.0
|
533
533
|
post_install_message:
|
534
534
|
rdoc_options: []
|
535
535
|
require_paths:
|