dependabot-nuget 0.295.0 → 0.296.1

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.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/AnalyzeWorker.cs +2 -0
  3. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/CompatabilityChecker.cs +6 -7
  4. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/VersionFinder.cs +29 -4
  5. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/VersionResult.cs +7 -10
  6. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/DependencyDiscovery.props +2 -1
  7. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/ExperimentsManager.cs +6 -2
  8. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/ClosePullRequest.cs +12 -0
  9. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/PullRequestExistsForLatestVersion.cs +11 -0
  10. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/SecurityUpdateNotNeeded.cs +10 -0
  11. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/UpdatePullRequest.cs +28 -0
  12. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/HttpApiHandler.cs +5 -0
  13. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/IApiHandler.cs +1 -0
  14. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/RunWorker.cs +106 -64
  15. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/TargetFrameworkReporter.targets +1 -6
  16. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/DependencyConflictResolver.cs +5 -2
  17. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/MSBuildHelper.cs +54 -36
  18. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/PathComparer.cs +13 -6
  19. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Analyze/VersionFinderTests.cs +33 -0
  20. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.Project.cs +8 -4
  21. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/MiscellaneousTests.cs +175 -0
  22. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/RunWorkerTests.cs +21 -21
  23. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/SerializationTests.cs +99 -0
  24. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/TestApiHandler.cs +6 -0
  25. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/UpdatedDependencyListTests.cs +10 -10
  26. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs +107 -0
  27. metadata +9 -5
@@ -801,40 +801,51 @@ internal static partial class MSBuildHelper
801
801
  logger.Warn($"Error determining target frameworks.\nSTDOUT:\n{stdOut}\nSTDERR:\n{stdErr}");
802
802
  }
803
803
 
804
- // There are 3 return values, all uses slightly differently. Only one will be set, the others will be blank
805
- // ProjectData::TargetFrameworkVersion=.NETFramework,Version=v4.5 // non-SDK projects, commonly with `packages.config`
806
- // ProjectData::TargetFramework=net7.0 // SDK-style projects
807
- // ProjectData::TargetFrameworks=net7.0;net8.0
808
- var tfmPatterns = new Regex[]
804
+ // There are 2 possible return values:
805
+ // 1. For SDK-style projects with a single TFM and legacy projects the output will look like:
806
+ // ProjectData::TargetFrameworkMoniker=.NETCoreApp,Version=8.0;ProjectData::TargetPlatformMoniker=Windows,Version=7.0
807
+ // 2. For SDK-style projects with multiple TFMs the output will look like:
808
+ // ProjectData::TargetFrameworks=net8.0;net9.0
809
+ var listedTargetFrameworks = new List<ValueTuple<string, string>>();
810
+ var listedTfmMatch = Regex.Match(stdOut, "ProjectData::TargetFrameworks=(?<TargetFrameworks>.*)$", RegexOptions.Multiline);
811
+ if (listedTfmMatch.Success)
809
812
  {
810
- new Regex("ProjectData::TargetFrameworkVersion=(?<Value>.*)$", RegexOptions.Multiline),
811
- new Regex("ProjectData::TargetFramework=(?<Value>.*)$", RegexOptions.Multiline),
812
- new Regex("ProjectData::TargetFrameworks=(?<Value>.*)$", RegexOptions.Multiline),
813
- };
814
- var tfms = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
815
- foreach (var tfmPattern in tfmPatterns)
813
+ var value = listedTfmMatch.Groups["TargetFrameworks"].Value;
814
+ var foundTfms = value.Split(';', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries)
815
+ .Select(tfm => ValueTuple.Create(tfm, string.Empty))
816
+ .ToArray();
817
+ listedTargetFrameworks.AddRange(foundTfms);
818
+ }
819
+
820
+ var individualTfmMatch = Regex.Match(stdOut, "ProjectData::TargetFrameworkMoniker=(?<TargetFrameworkMoniker>[^;]*);ProjectData::TargetPlatformMoniker=(?<TargetPlatformMoniker>.*)$", RegexOptions.Multiline);
821
+ if (individualTfmMatch.Success)
816
822
  {
817
- var candidateTfms = tfmPattern.Matches(stdOut)
818
- .Select(m => m.Groups["Value"].Value)
819
- .SelectMany(v => v.Split(';', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries))
820
- .Where(v => !string.IsNullOrWhiteSpace(v))
821
- .Select(v =>
822
- {
823
- try
824
- {
825
- var framework = NuGetFramework.Parse(v);
826
- return framework.GetShortFolderName();
827
- }
828
- catch
829
- {
830
- return string.Empty;
831
- }
832
- })
833
- .Where(tfm => !string.IsNullOrEmpty(tfm));
834
- tfms.AddRange(candidateTfms);
823
+ var tfm = individualTfmMatch.Groups["TargetFrameworkMoniker"].Value;
824
+ var tpm = individualTfmMatch.Groups["TargetPlatformMoniker"].Value;
825
+ listedTargetFrameworks.Add(ValueTuple.Create(tfm, tpm));
835
826
  }
836
827
 
837
- return tfms.ToImmutableArray();
828
+ var tfms = listedTargetFrameworks.Select(tfpm =>
829
+ {
830
+ try
831
+ {
832
+ // Item2 is an optional component that looks like: "Windows,Version=7.0"
833
+ var framework = string.IsNullOrWhiteSpace(tfpm.Item2)
834
+ ? NuGetFramework.Parse(tfpm.Item1)
835
+ : NuGetFramework.ParseComponents(tfpm.Item1, tfpm.Item2);
836
+ return framework;
837
+ }
838
+ catch
839
+ {
840
+ return null;
841
+ }
842
+ })
843
+ .Where(tfm => tfm is not null)
844
+ .Select(tfm => tfm!.GetShortFolderName())
845
+ .OrderBy(tfm => tfm)
846
+ .ToImmutableArray();
847
+
848
+ return tfms;
838
849
  }
839
850
 
840
851
  internal static async Task<Dependency[]> GetAllPackageDependenciesAsync(
@@ -924,7 +935,7 @@ internal static partial class MSBuildHelper
924
935
  ThrowOnUnauthenticatedFeed(output);
925
936
  ThrowOnMissingFile(output);
926
937
  ThrowOnMissingPackages(output);
927
- ThrowOnUnresolvableDependencies(output);
938
+ ThrowOnUpdateNotPossible(output);
928
939
  }
929
940
 
930
941
  private static void ThrowOnUnauthenticatedFeed(string stdout)
@@ -962,13 +973,20 @@ internal static partial class MSBuildHelper
962
973
  }
963
974
  }
964
975
 
965
- private static void ThrowOnUnresolvableDependencies(string output)
976
+ private static void ThrowOnUpdateNotPossible(string output)
966
977
  {
967
- var unresolvablePackagePattern = new Regex(@"Unable to resolve dependencies\. '(?<PackageName>[^ ]+) (?<PackageVersion>[^']+)'");
968
- var match = unresolvablePackagePattern.Match(output);
969
- if (match.Success)
978
+ var patterns = new[]
979
+ {
980
+ new Regex(@"Unable to resolve dependencies\. '(?<PackageName>[^ ]+) (?<PackageVersion>[^']+)'"),
981
+ new Regex(@"Could not install package '(?<PackageName>[^ ]+) (?<PackageVersion>[^']+)'. You are trying to install this package"),
982
+ new Regex(@"Unable to find a version of '[^']+' that is compatible with '[^ ]+ [^ ]+ constraint: (?<PackageName>[^ ]+) \([^ ]+ (?<PackageVersion>[^)]+)\)'"),
983
+ new Regex(@"the following error\(s\) may be blocking the current package operation: '(?<PackageName>[^ ]+) (?<PackageVersion>[^ ]+) constraint:"),
984
+ };
985
+ var matches = patterns.Select(p => p.Match(output)).Where(m => m.Success);
986
+ if (matches.Any())
970
987
  {
971
- throw new UpdateNotPossibleException([$"{match.Groups["PackageName"].Value}.{match.Groups["PackageVersion"].Value}"]);
988
+ var packages = matches.Select(m => $"{m.Groups["PackageName"].Value}.{m.Groups["PackageVersion"].Value}").Distinct().ToArray();
989
+ throw new UpdateNotPossibleException(packages);
972
990
  }
973
991
  }
974
992
 
@@ -2,28 +2,35 @@ using System.Diagnostics.CodeAnalysis;
2
2
 
3
3
  namespace NuGetUpdater.Core.Utilities;
4
4
 
5
- public class PathComparer : IEqualityComparer<string>
5
+ public class PathComparer : IComparer<string>, IEqualityComparer<string>
6
6
  {
7
7
  public static PathComparer Instance { get; } = new PathComparer();
8
8
 
9
- public bool Equals(string? x, string? y)
9
+ public int Compare(string? x, string? y)
10
10
  {
11
11
  x = x?.NormalizePathToUnix();
12
12
  y = y?.NormalizePathToUnix();
13
13
 
14
14
  if (x is null && y is null)
15
15
  {
16
- return true;
16
+ return 0;
17
17
  }
18
18
 
19
- if (x is null || y is null)
19
+ if (x is null)
20
20
  {
21
- return false;
21
+ return -1;
22
22
  }
23
23
 
24
- return x.Equals(y, StringComparison.OrdinalIgnoreCase);
24
+ if (y is null)
25
+ {
26
+ return 1;
27
+ }
28
+
29
+ return x.CompareTo(y);
25
30
  }
26
31
 
32
+ public bool Equals(string? x, string? y) => Compare(x, y) == 0;
33
+
27
34
  public int GetHashCode([DisallowNull] string obj)
28
35
  {
29
36
  return obj.NormalizePathToUnix().GetHashCode();
@@ -1,6 +1,11 @@
1
+ using System.Collections.Immutable;
2
+
3
+ using NuGet.Frameworks;
1
4
  using NuGet.Versioning;
2
5
 
3
6
  using NuGetUpdater.Core.Analyze;
7
+ using NuGetUpdater.Core.Test.Update;
8
+ using NuGetUpdater.Core.Test.Utilities;
4
9
 
5
10
  using Xunit;
6
11
 
@@ -190,4 +195,32 @@ public class VersionFinderTests
190
195
 
191
196
  Assert.True(result);
192
197
  }
198
+
199
+ [Fact]
200
+ public async Task TargetFrameworkIsConsideredForUpdatedVersions()
201
+ {
202
+ // arrange
203
+ using var tempDir = new TemporaryDirectory();
204
+ await UpdateWorkerTestBase.MockNuGetPackagesInDirectory(
205
+ [
206
+ MockNuGetPackage.CreateSimplePackage("Some.Package", "1.0.0", "net8.0"),
207
+ MockNuGetPackage.CreateSimplePackage("Some.Package", "2.0.0", "net8.0"), // can only update to this version because of the tfm
208
+ MockNuGetPackage.CreateSimplePackage("Some.Package", "3.0.0", "net9.0"),
209
+ ],
210
+ tempDir.DirectoryPath);
211
+
212
+ // act
213
+ var projectTfms = new[] { "net8.0" }.Select(NuGetFramework.Parse).ToImmutableArray();
214
+ var packageId = "Some.Package";
215
+ var currentVersion = NuGetVersion.Parse("1.0.0");
216
+ var logger = new TestLogger();
217
+ var nugetContext = new NuGetContext(tempDir.DirectoryPath);
218
+ var versionResult = await VersionFinder.GetVersionsAsync(projectTfms, packageId, currentVersion, nugetContext, logger, CancellationToken.None);
219
+ var versions = versionResult.GetVersions();
220
+
221
+ // assert
222
+ var actual = versions.Select(v => v.ToString()).ToArray();
223
+ var expected = new[] { "2.0.0" };
224
+ AssertEx.Equal(expected, actual);
225
+ }
193
226
  }
@@ -1131,7 +1131,7 @@ public partial class DiscoveryWorkerTests
1131
1131
  ("src/project.csproj", """
1132
1132
  <Project Sdk="Microsoft.NET.Sdk">
1133
1133
  <PropertyGroup>
1134
- <TargetFrameworks>net8.0-ios;net8.0-android;net8.0-macos;net8.0-maccatalyst</TargetFrameworks>
1134
+ <TargetFrameworks>net8.0-ios;net8.0-android;net8.0-macos;net8.0-maccatalyst;net8.0-windows</TargetFrameworks>
1135
1135
  </PropertyGroup>
1136
1136
  <ItemGroup>
1137
1137
  <PackageReference Include="Some.Package" Version="1.2.3" />
@@ -1151,11 +1151,12 @@ public partial class DiscoveryWorkerTests
1151
1151
  new("Some.Package", "1.2.3", DependencyType.PackageReference, TargetFrameworks: ["net8.0-ios"], IsDirect: true),
1152
1152
  new("Some.Package", "1.2.3", DependencyType.PackageReference, TargetFrameworks: ["net8.0-maccatalyst"], IsDirect: true),
1153
1153
  new("Some.Package", "1.2.3", DependencyType.PackageReference, TargetFrameworks: ["net8.0-macos"], IsDirect: true),
1154
+ new("Some.Package", "1.2.3", DependencyType.PackageReference, TargetFrameworks: ["net8.0-windows"], IsDirect: true),
1154
1155
  ],
1155
1156
  Properties = [
1156
- new("TargetFrameworks", "net8.0-ios;net8.0-android;net8.0-macos;net8.0-maccatalyst", @"src/project.csproj"),
1157
+ new("TargetFrameworks", "net8.0-ios;net8.0-android;net8.0-macos;net8.0-maccatalyst;net8.0-windows", @"src/project.csproj"),
1157
1158
  ],
1158
- TargetFrameworks = ["net8.0-android", "net8.0-ios", "net8.0-maccatalyst", "net8.0-macos"],
1159
+ TargetFrameworks = ["net8.0-android", "net8.0-ios", "net8.0-maccatalyst", "net8.0-macos", "net8.0-windows"],
1159
1160
  ReferencedProjectPaths = [],
1160
1161
  ImportedFiles = [],
1161
1162
  AdditionalFiles = [],
@@ -1310,6 +1311,8 @@ public partial class DiscoveryWorkerTests
1310
1311
 
1311
1312
  <PropertyGroup>
1312
1313
  <TargetFramework>net8.0</TargetFramework>
1314
+ <!-- the SDK turns `<TargetFramework>net8.0</TargetFramework>` into the following -->
1315
+ <TargetFrameworkMoniker>.NETCoreApp,Version=8.0</TargetFrameworkMoniker>
1313
1316
  </PropertyGroup>
1314
1317
 
1315
1318
  <ItemGroup>
@@ -1360,7 +1363,8 @@ public partial class DiscoveryWorkerTests
1360
1363
  new("Test.Only.Package", "1.0.99", DependencyType.Unknown, TargetFrameworks: ["net8.0"], IsTransitive: true)
1361
1364
  ],
1362
1365
  Properties = [
1363
- new("TargetFramework", "net8.0", "project.csproj")
1366
+ new("TargetFramework", "net8.0", "project.csproj"),
1367
+ new("TargetFrameworkMoniker", ".NETCoreApp,Version=8.0", "project.csproj"),
1364
1368
  ],
1365
1369
  TargetFrameworks = ["net8.0"],
1366
1370
  ReferencedProjectPaths = [],
@@ -1,8 +1,10 @@
1
+ using System.Collections.Immutable;
1
2
  using System.Text.Json;
2
3
 
3
4
  using NuGet.Versioning;
4
5
 
5
6
  using NuGetUpdater.Core.Analyze;
7
+ using NuGetUpdater.Core.Discover;
6
8
  using NuGetUpdater.Core.Run;
7
9
  using NuGetUpdater.Core.Run.ApiModel;
8
10
 
@@ -41,6 +43,59 @@ public class MiscellaneousTests
41
43
  Assert.Equal(expectedString, actualString);
42
44
  }
43
45
 
46
+ [Theory]
47
+ [MemberData(nameof(GetIncrementMetricData))]
48
+ public void GetIncrementMetric(Job job, IncrementMetric expected)
49
+ {
50
+ var actual = RunWorker.GetIncrementMetric(job);
51
+ var actualJson = HttpApiHandler.Serialize(actual);
52
+ var expectedJson = HttpApiHandler.Serialize(expected);
53
+ Assert.Equal(expectedJson, actualJson);
54
+ }
55
+
56
+ [Theory]
57
+ [MemberData(nameof(GetUpdateOperationsData))]
58
+ public void GetUpdateOperations(WorkspaceDiscoveryResult discovery, (string ProjectPath, string DependencyName)[] expectedUpdateOperations)
59
+ {
60
+ var updateOperations = RunWorker.GetUpdateOperations(discovery).ToArray();
61
+ var actualUpdateOperations = updateOperations.Select(uo => (uo.ProjectPath, uo.Dependency.Name)).ToArray();
62
+ Assert.Equal(expectedUpdateOperations, actualUpdateOperations);
63
+ }
64
+
65
+ public static IEnumerable<object[]> GetUpdateOperationsData()
66
+ {
67
+ static ProjectDiscoveryResult GetProjectDiscovery(string filePath, params string[] dependencyNames)
68
+ {
69
+ return new()
70
+ {
71
+ FilePath = filePath,
72
+ Dependencies = dependencyNames.Select(d => new Dependency(d, "1.0.0", DependencyType.PackageReference)).ToImmutableArray(),
73
+ ImportedFiles = [],
74
+ AdditionalFiles = [],
75
+ };
76
+ }
77
+
78
+ yield return
79
+ [
80
+ new WorkspaceDiscoveryResult()
81
+ {
82
+ Path = "",
83
+ Projects = [
84
+ GetProjectDiscovery("src/Library.csproj", "Package.B", "Package.C"),
85
+ GetProjectDiscovery("src/Common.csproj", "Package.A", "Package.C", "Package.D"),
86
+ ]
87
+ },
88
+ new (string, string)[]
89
+ {
90
+ ("/src/Common.csproj", "Package.A"),
91
+ ("/src/Library.csproj", "Package.B"),
92
+ ("/src/Common.csproj", "Package.C"),
93
+ ("/src/Library.csproj", "Package.C"),
94
+ ("/src/Common.csproj", "Package.D"),
95
+ },
96
+ ];
97
+ }
98
+
44
99
  public static IEnumerable<object?[]> RequirementsFromIgnoredVersionsData()
45
100
  {
46
101
  yield return
@@ -143,4 +198,124 @@ public class MiscellaneousTests
143
198
  }
144
199
  ];
145
200
  }
201
+
202
+ public static IEnumerable<object?[]> GetIncrementMetricData()
203
+ {
204
+ static Job GetJob(AllowedUpdate[] allowed, bool securityUpdatesOnly, bool updatingAPullRequest)
205
+ {
206
+ return new Job()
207
+ {
208
+ AllowedUpdates = allowed.ToImmutableArray(),
209
+ Source = new()
210
+ {
211
+ Provider = "github",
212
+ Repo = "some/repo"
213
+ },
214
+ SecurityUpdatesOnly = securityUpdatesOnly,
215
+ UpdatingAPullRequest = updatingAPullRequest,
216
+ };
217
+ }
218
+
219
+ // version update
220
+ yield return
221
+ [
222
+ GetJob(
223
+ allowed: [new AllowedUpdate() { UpdateType = UpdateType.All }],
224
+ securityUpdatesOnly: false,
225
+ updatingAPullRequest: false),
226
+ new IncrementMetric()
227
+ {
228
+ Metric = "updater.started",
229
+ Tags =
230
+ {
231
+ ["operation"] = "group_update_all_versions"
232
+ }
233
+ }
234
+ ];
235
+
236
+ // version update - existing pr
237
+ yield return
238
+ [
239
+ GetJob(
240
+ allowed: [new AllowedUpdate() { UpdateType = UpdateType.All }],
241
+ securityUpdatesOnly: false,
242
+ updatingAPullRequest: true),
243
+ new IncrementMetric()
244
+ {
245
+ Metric = "updater.started",
246
+ Tags =
247
+ {
248
+ ["operation"] = "update_version_pr"
249
+ }
250
+ }
251
+ ];
252
+
253
+ // create security pr - allowed security update
254
+ yield return
255
+ [
256
+ GetJob(
257
+ allowed: [new AllowedUpdate() { UpdateType = UpdateType.All }, new AllowedUpdate() { UpdateType = UpdateType.Security }],
258
+ securityUpdatesOnly: false,
259
+ updatingAPullRequest: false),
260
+ new IncrementMetric()
261
+ {
262
+ Metric = "updater.started",
263
+ Tags =
264
+ {
265
+ ["operation"] = "create_security_pr"
266
+ }
267
+ }
268
+ ];
269
+
270
+ // create security pr - security only
271
+ yield return
272
+ [
273
+ GetJob(
274
+ allowed: [new AllowedUpdate() { UpdateType = UpdateType.All } ],
275
+ securityUpdatesOnly: true,
276
+ updatingAPullRequest: false),
277
+ new IncrementMetric()
278
+ {
279
+ Metric = "updater.started",
280
+ Tags =
281
+ {
282
+ ["operation"] = "create_security_pr"
283
+ }
284
+ }
285
+ ];
286
+
287
+ // update security pr - allowed security update
288
+ yield return
289
+ [
290
+ GetJob(
291
+ allowed: [new AllowedUpdate() { UpdateType = UpdateType.All }, new AllowedUpdate() { UpdateType = UpdateType.Security } ],
292
+ securityUpdatesOnly: false,
293
+ updatingAPullRequest: true),
294
+ new IncrementMetric()
295
+ {
296
+ Metric = "updater.started",
297
+ Tags =
298
+ {
299
+ ["operation"] = "update_security_pr"
300
+ }
301
+ }
302
+ ];
303
+
304
+ // update security pr - security only
305
+ yield return
306
+ [
307
+ GetJob(
308
+ allowed: [new AllowedUpdate() { UpdateType = UpdateType.All } ],
309
+ securityUpdatesOnly: true,
310
+ updatingAPullRequest: true),
311
+ new IncrementMetric()
312
+ {
313
+ Metric = "updater.started",
314
+ Tags =
315
+ {
316
+ ["operation"] = "update_security_pr"
317
+ }
318
+ }
319
+ ];
320
+ }
146
321
  }
@@ -1147,7 +1147,7 @@ public class RunWorkerTests
1147
1147
  new ReportedRequirement()
1148
1148
  {
1149
1149
  Requirement = "1.0.0",
1150
- File = "/some-dir/ProjectB/ProjectB.csproj",
1150
+ File = "/some-dir/ProjectA/ProjectA.csproj",
1151
1151
  Groups = ["dependencies"],
1152
1152
  }
1153
1153
  ]
@@ -1161,7 +1161,7 @@ public class RunWorkerTests
1161
1161
  new ReportedRequirement()
1162
1162
  {
1163
1163
  Requirement = "2.0.0",
1164
- File = "/some-dir/ProjectB/ProjectB.csproj",
1164
+ File = "/some-dir/ProjectA/ProjectA.csproj",
1165
1165
  Groups = ["dependencies"],
1166
1166
  }
1167
1167
  ]
@@ -1175,7 +1175,7 @@ public class RunWorkerTests
1175
1175
  new ReportedRequirement()
1176
1176
  {
1177
1177
  Requirement = "1.0.0",
1178
- File = "/some-dir/ProjectA/ProjectA.csproj",
1178
+ File = "/some-dir/ProjectB/ProjectB.csproj",
1179
1179
  Groups = ["dependencies"],
1180
1180
  }
1181
1181
  ]
@@ -1189,7 +1189,7 @@ public class RunWorkerTests
1189
1189
  new ReportedRequirement()
1190
1190
  {
1191
1191
  Requirement = "2.0.0",
1192
- File = "/some-dir/ProjectA/ProjectA.csproj",
1192
+ File = "/some-dir/ProjectB/ProjectB.csproj",
1193
1193
  Groups = ["dependencies"],
1194
1194
  }
1195
1195
  ]
@@ -1218,7 +1218,7 @@ public class RunWorkerTests
1218
1218
  new ReportedRequirement()
1219
1219
  {
1220
1220
  Requirement = "1.0.1",
1221
- File = "/some-dir/ProjectB/ProjectB.csproj",
1221
+ File = "/some-dir/ProjectA/ProjectA.csproj",
1222
1222
  Groups = ["dependencies"],
1223
1223
  Source = new()
1224
1224
  {
@@ -1233,35 +1233,35 @@ public class RunWorkerTests
1233
1233
  new ReportedRequirement()
1234
1234
  {
1235
1235
  Requirement = "1.0.0",
1236
- File = "/some-dir/ProjectB/ProjectB.csproj",
1236
+ File = "/some-dir/ProjectA/ProjectA.csproj",
1237
1237
  Groups = ["dependencies"],
1238
1238
  }
1239
1239
  ],
1240
1240
  },
1241
1241
  new ReportedDependency()
1242
1242
  {
1243
- Name = "Some.Package2",
1244
- Version = "2.0.1",
1243
+ Name = "Some.Package",
1244
+ Version = "1.0.1",
1245
1245
  Requirements =
1246
1246
  [
1247
1247
  new ReportedRequirement()
1248
1248
  {
1249
- Requirement = "2.0.1",
1249
+ Requirement = "1.0.1",
1250
1250
  File = "/some-dir/ProjectB/ProjectB.csproj",
1251
1251
  Groups = ["dependencies"],
1252
1252
  Source = new()
1253
1253
  {
1254
- SourceUrl = "https://nuget.example.com/some-package2",
1254
+ SourceUrl = "https://nuget.example.com/some-package",
1255
1255
  Type = "nuget_repo",
1256
1256
  }
1257
1257
  }
1258
1258
  ],
1259
- PreviousVersion = "2.0.0",
1259
+ PreviousVersion = "1.0.0",
1260
1260
  PreviousRequirements =
1261
1261
  [
1262
1262
  new ReportedRequirement()
1263
1263
  {
1264
- Requirement = "2.0.0",
1264
+ Requirement = "1.0.0",
1265
1265
  File = "/some-dir/ProjectB/ProjectB.csproj",
1266
1266
  Groups = ["dependencies"],
1267
1267
  }
@@ -1269,28 +1269,28 @@ public class RunWorkerTests
1269
1269
  },
1270
1270
  new ReportedDependency()
1271
1271
  {
1272
- Name = "Some.Package",
1273
- Version = "1.0.1",
1272
+ Name = "Some.Package2",
1273
+ Version = "2.0.1",
1274
1274
  Requirements =
1275
1275
  [
1276
1276
  new ReportedRequirement()
1277
1277
  {
1278
- Requirement = "1.0.1",
1278
+ Requirement = "2.0.1",
1279
1279
  File = "/some-dir/ProjectA/ProjectA.csproj",
1280
1280
  Groups = ["dependencies"],
1281
1281
  Source = new()
1282
1282
  {
1283
- SourceUrl = "https://nuget.example.com/some-package",
1283
+ SourceUrl = "https://nuget.example.com/some-package2",
1284
1284
  Type = "nuget_repo",
1285
1285
  }
1286
1286
  }
1287
1287
  ],
1288
- PreviousVersion = "1.0.0",
1288
+ PreviousVersion = "2.0.0",
1289
1289
  PreviousRequirements =
1290
1290
  [
1291
1291
  new ReportedRequirement()
1292
1292
  {
1293
- Requirement = "1.0.0",
1293
+ Requirement = "2.0.0",
1294
1294
  File = "/some-dir/ProjectA/ProjectA.csproj",
1295
1295
  Groups = ["dependencies"],
1296
1296
  }
@@ -1305,7 +1305,7 @@ public class RunWorkerTests
1305
1305
  new ReportedRequirement()
1306
1306
  {
1307
1307
  Requirement = "2.0.1",
1308
- File = "/some-dir/ProjectA/ProjectA.csproj",
1308
+ File = "/some-dir/ProjectB/ProjectB.csproj",
1309
1309
  Groups = ["dependencies"],
1310
1310
  Source = new()
1311
1311
  {
@@ -1320,7 +1320,7 @@ public class RunWorkerTests
1320
1320
  new ReportedRequirement()
1321
1321
  {
1322
1322
  Requirement = "2.0.0",
1323
- File = "/some-dir/ProjectA/ProjectA.csproj",
1323
+ File = "/some-dir/ProjectB/ProjectB.csproj",
1324
1324
  Groups = ["dependencies"],
1325
1325
  }
1326
1326
  ],
@@ -1945,7 +1945,7 @@ public class RunWorkerTests
1945
1945
  Metric = "updater.started",
1946
1946
  Tags = new()
1947
1947
  {
1948
- ["operation"] = "group_update_all_versions"
1948
+ ["operation"] = "create_security_pr"
1949
1949
  }
1950
1950
  },
1951
1951
  new CreatePullRequest()