dependabot-nuget 0.315.0 → 0.316.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.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli.Test/EntryPointTests.Run.cs +1 -1
  3. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/WorkspaceDiscoveryResult.cs +6 -0
  4. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/ExperimentsManager.cs +3 -0
  5. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/ClosePullRequest.cs +15 -0
  6. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/CreatePullRequest.cs +47 -0
  7. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/DependencyGroup.cs +60 -0
  8. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/Job.cs +151 -23
  9. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/JobErrorBase.cs +4 -18
  10. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/PullRequestExistsForSecurityUpdate.cs +15 -0
  11. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/SecurityUpdateDependencyNotFound.cs +9 -0
  12. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/SecurityUpdateIgnored.cs +10 -0
  13. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/SecurityUpdateNotFound.cs +11 -0
  14. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/SecurityUpdateNotPossible.cs +13 -0
  15. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ApiModel/UpdatePullRequest.cs +6 -0
  16. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/ModifiedFilesTracker.cs +151 -0
  17. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/PullRequestTextGenerator.cs +78 -32
  18. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/RunWorker.cs +99 -111
  19. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/UpdateHandlers/CreateSecurityUpdatePullRequestHandler.cs +169 -0
  20. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/UpdateHandlers/GroupUpdateAllVersionsHandler.cs +271 -0
  21. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/UpdateHandlers/IUpdateHandler.cs +22 -0
  22. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/UpdateHandlers/RefreshGroupUpdatePullRequestHandler.cs +192 -0
  23. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/UpdateHandlers/RefreshSecurityUpdatePullRequestHandler.cs +187 -0
  24. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/UpdateHandlers/RefreshVersionUpdatePullRequestHandler.cs +175 -0
  25. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/UpdateOperationBase.cs +43 -2
  26. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/ILogger.cs +17 -0
  27. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/MSBuildHelper.cs +15 -9
  28. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/MarkdownListBuilder.cs +65 -0
  29. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/ApiModel/JobTests.cs +405 -0
  30. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/EndToEndTests.cs +92 -82
  31. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/HttpApiHandlerTests.cs +5 -0
  32. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/MessageReportTests.cs +67 -1
  33. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/MiscellaneousTests.cs +445 -0
  34. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/PullRequestMessageTests.cs +1 -0
  35. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/PullRequestTextTests.cs +260 -20
  36. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/RunWorkerTests.cs +30 -2
  37. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/SerializationTests.cs +69 -10
  38. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/UpdateHandlers/CreateSecurityUpdatePullRequestHandlerTests.cs +766 -0
  39. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/UpdateHandlers/GroupUpdateAllVersionsHandlerTests.cs +636 -0
  40. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/UpdateHandlers/RefreshGroupUpdatePullRequestHandlerTests.cs +513 -0
  41. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/UpdateHandlers/RefreshSecurityUpdatePullRequestHandlerTests.cs +806 -0
  42. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/UpdateHandlers/RefreshVersionUpdatePullRequestHandlerTests.cs +589 -0
  43. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/UpdateHandlers/UpdateHandlerSelectionTests.cs +183 -0
  44. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/UpdateHandlers/UpdateHandlersTestsBase.cs +43 -0
  45. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/UpdatedDependencyListTests.cs +2 -2
  46. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateOperationBaseTests.cs +121 -7
  47. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.Mixed.cs +6 -0
  48. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.PackagesConfig.cs +2 -2
  49. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs +51 -0
  50. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MarkdownListBuilderTests.cs +42 -0
  51. metadata +26 -4
@@ -28,7 +28,7 @@ public class PullRequestTextTests
28
28
  }
29
29
 
30
30
  var actualTitle = PullRequestTextGenerator.GetPullRequestTitle(job, [.. updateOperations], dependencyGroupName: null);
31
- var expectedTitle = "Update Package1 and 9 other dependencies";
31
+ var expectedTitle = "Bump Package1 and 9 others";
32
32
  Assert.Equal(expectedTitle, actualTitle);
33
33
  }
34
34
 
@@ -45,10 +45,10 @@ public class PullRequestTextTests
45
45
  {
46
46
  var updateOperationsPerformedImmutable = updateOperationsPerformed.ToImmutableArray();
47
47
  var actualTitle = PullRequestTextGenerator.GetPullRequestTitle(job, updateOperationsPerformedImmutable, dependencyGroupName);
48
- var actualCommitMessage = PullRequestTextGenerator.GetPullRequestCommitMessage(job, updateOperationsPerformedImmutable, dependencyGroupName);
49
- var actualBody = PullRequestTextGenerator.GetPullRequestBody(job, updateOperationsPerformedImmutable, dependencyGroupName);
48
+ var actualCommitMessage = PullRequestTextGenerator.GetPullRequestCommitMessage(job, updateOperationsPerformedImmutable, dependencyGroupName).Replace("\r", "");
49
+ var actualBody = PullRequestTextGenerator.GetPullRequestBody(job, updateOperationsPerformedImmutable, dependencyGroupName).Replace("\r", "");
50
50
  Assert.Equal(expectedTitle, actualTitle);
51
- Assert.Equal(expectedCommitMessage, actualCommitMessage);
51
+ Assert.Equal(expectedCommitMessage.Replace("\r", ""), actualCommitMessage);
52
52
  Assert.Equal(expectedBody.Replace("\r", ""), actualBody);
53
53
  }
54
54
 
@@ -65,6 +65,7 @@ public class PullRequestTextTests
65
65
  new DirectUpdate()
66
66
  {
67
67
  DependencyName = "Some.Package",
68
+ OldVersion = NuGetVersion.Parse("1.0.0"),
68
69
  NewVersion = NuGetVersion.Parse("1.2.3"),
69
70
  UpdatedFiles = ["a.txt"]
70
71
  }
@@ -72,17 +73,17 @@ public class PullRequestTextTests
72
73
  // dependencyGroupName
73
74
  null,
74
75
  // expectedTitle
75
- "Update Some.Package to 1.2.3",
76
+ "Bump Some.Package from 1.0.0 to 1.2.3",
76
77
  // expectedCommitMessage
77
- "Update Some.Package to 1.2.3",
78
+ "Bump Some.Package from 1.0.0 to 1.2.3",
78
79
  // expectedBody
79
80
  """
80
81
  Performed the following updates:
81
- - Updated Some.Package to 1.2.3 in a.txt
82
+ - Updated Some.Package from 1.0.0 to 1.2.3 in a.txt
82
83
  """
83
84
  ];
84
85
 
85
- // single dependency, prefix given
86
+ // single dependency, prefix given, ends with space
86
87
  yield return
87
88
  [
88
89
  // job
@@ -93,6 +94,7 @@ public class PullRequestTextTests
93
94
  new DirectUpdate()
94
95
  {
95
96
  DependencyName = "Some.Package",
97
+ OldVersion = NuGetVersion.Parse("1.0.0"),
96
98
  NewVersion = NuGetVersion.Parse("1.2.3"),
97
99
  UpdatedFiles = ["a.txt"]
98
100
  }
@@ -100,17 +102,141 @@ public class PullRequestTextTests
100
102
  // dependencyGroupName
101
103
  null,
102
104
  // expectedTitle
103
- "[SECURITY] Update Some.Package to 1.2.3",
105
+ "[SECURITY] Bump Some.Package from 1.0.0 to 1.2.3",
104
106
  // expectedCommitMessage
105
- "Update Some.Package to 1.2.3",
107
+ "[SECURITY] Bump Some.Package from 1.0.0 to 1.2.3",
106
108
  // expectedBody
107
109
  """
108
110
  Performed the following updates:
109
- - Updated Some.Package to 1.2.3 in a.txt
111
+ - Updated Some.Package from 1.0.0 to 1.2.3 in a.txt
110
112
  """
111
113
  ];
112
114
 
113
- // multiple dependencies, multiple versions
115
+ // single dependency, prefix given, ends with character or bracket
116
+ yield return
117
+ [
118
+ // job
119
+ FromCommitOptions(new(){ Prefix = "chore(deps)" }),
120
+ // updateOperationsPerformed
121
+ new UpdateOperationBase[]
122
+ {
123
+ new DirectUpdate()
124
+ {
125
+ DependencyName = "Some.Package",
126
+ OldVersion = NuGetVersion.Parse("1.0.0"),
127
+ NewVersion = NuGetVersion.Parse("1.2.3"),
128
+ UpdatedFiles = ["a.txt"]
129
+ }
130
+ },
131
+ // dependencyGroupName
132
+ null,
133
+ // expectedTitle
134
+ "chore(deps): Bump Some.Package from 1.0.0 to 1.2.3",
135
+ // expectedCommitMessage
136
+ "chore(deps): Bump Some.Package from 1.0.0 to 1.2.3",
137
+ // expectedBody
138
+ """
139
+ Performed the following updates:
140
+ - Updated Some.Package from 1.0.0 to 1.2.3 in a.txt
141
+ """
142
+ ];
143
+
144
+ // single dependency, multiple versions
145
+ yield return
146
+ [
147
+ // job
148
+ FromCommitOptions(null),
149
+ // updateOperationsPerformed
150
+ new UpdateOperationBase[]
151
+ {
152
+ new DirectUpdate()
153
+ {
154
+ DependencyName = "Some.Package",
155
+ OldVersion = NuGetVersion.Parse("1.0.0"),
156
+ NewVersion = NuGetVersion.Parse("1.2.3"),
157
+ UpdatedFiles = ["a.txt"]
158
+ },
159
+ new DirectUpdate()
160
+ {
161
+ DependencyName = "Some.Package",
162
+ OldVersion = NuGetVersion.Parse("4.0.0"),
163
+ NewVersion = NuGetVersion.Parse("4.5.6"),
164
+ UpdatedFiles = ["b.txt"]
165
+ },
166
+ },
167
+ // dependencyGroupName
168
+ null,
169
+ // expectedTitle
170
+ "Bump Some.Package to 1.2.3, 4.5.6",
171
+ // expectedCommitMessage
172
+ "Bump Some.Package to 1.2.3, 4.5.6",
173
+ // expectedBody
174
+ """
175
+ Performed the following updates:
176
+ - Updated Some.Package from 1.0.0 to 1.2.3 in a.txt
177
+ - Updated Some.Package from 4.0.0 to 4.5.6 in b.txt
178
+ """
179
+ ];
180
+
181
+ // two dependencies, two versions each
182
+ yield return
183
+ [
184
+ // job
185
+ FromCommitOptions(null),
186
+ // updateOperationsPerformed
187
+ new UpdateOperationBase[]
188
+ {
189
+ new DirectUpdate()
190
+ {
191
+ DependencyName = "Package.A",
192
+ OldVersion = NuGetVersion.Parse("0.1.0"),
193
+ NewVersion = NuGetVersion.Parse("1.0.0"),
194
+ UpdatedFiles = ["a1.txt"]
195
+ },
196
+ new DirectUpdate()
197
+ {
198
+ DependencyName = "Package.A",
199
+ OldVersion = NuGetVersion.Parse("0.2.0"),
200
+ NewVersion = NuGetVersion.Parse("2.0.0"),
201
+ UpdatedFiles = ["a2.txt"]
202
+ },
203
+ new DirectUpdate()
204
+ {
205
+ DependencyName = "Package.B",
206
+ OldVersion = NuGetVersion.Parse("0.3.0"),
207
+ NewVersion = NuGetVersion.Parse("3.0.0"),
208
+ UpdatedFiles = ["b1.txt"]
209
+ },
210
+ new DirectUpdate()
211
+ {
212
+ DependencyName = "Package.B",
213
+ OldVersion = NuGetVersion.Parse("0.4.0"),
214
+ NewVersion = NuGetVersion.Parse("4.0.0"),
215
+ UpdatedFiles = ["b2.txt"]
216
+ },
217
+ },
218
+ // dependencyGroupName
219
+ null,
220
+ // expectedTitle
221
+ "Bump Package.A and Package.B",
222
+ // expectedCommitMessage
223
+ """
224
+ Bump Package.A and Package.B
225
+
226
+ Bumps Package.A to 1.0.0, 2.0.0
227
+ Bumps Package.B to 3.0.0, 4.0.0
228
+ """,
229
+ // expectedBody
230
+ """
231
+ Performed the following updates:
232
+ - Updated Package.A from 0.1.0 to 1.0.0 in a1.txt
233
+ - Updated Package.A from 0.2.0 to 2.0.0 in a2.txt
234
+ - Updated Package.B from 0.3.0 to 3.0.0 in b1.txt
235
+ - Updated Package.B from 0.4.0 to 4.0.0 in b2.txt
236
+ """
237
+ ];
238
+
239
+ // four dependencies, two versions each
114
240
  yield return
115
241
  [
116
242
  // job
@@ -121,45 +247,159 @@ public class PullRequestTextTests
121
247
  new DirectUpdate()
122
248
  {
123
249
  DependencyName = "Package.A",
250
+ OldVersion = NuGetVersion.Parse("0.1.0"),
124
251
  NewVersion = NuGetVersion.Parse("1.0.0"),
125
252
  UpdatedFiles = ["a1.txt"]
126
253
  },
127
254
  new DirectUpdate()
128
255
  {
129
256
  DependencyName = "Package.A",
257
+ OldVersion = NuGetVersion.Parse("0.2.0"),
130
258
  NewVersion = NuGetVersion.Parse("2.0.0"),
131
259
  UpdatedFiles = ["a2.txt"]
132
260
  },
133
261
  new DirectUpdate()
134
262
  {
135
263
  DependencyName = "Package.B",
264
+ OldVersion = NuGetVersion.Parse("0.3.0"),
136
265
  NewVersion = NuGetVersion.Parse("3.0.0"),
137
266
  UpdatedFiles = ["b1.txt"]
138
267
  },
139
268
  new DirectUpdate()
140
269
  {
141
270
  DependencyName = "Package.B",
271
+ OldVersion = NuGetVersion.Parse("0.4.0"),
142
272
  NewVersion = NuGetVersion.Parse("4.0.0"),
143
273
  UpdatedFiles = ["b2.txt"]
144
274
  },
275
+ new DirectUpdate()
276
+ {
277
+ DependencyName = "Package.C",
278
+ OldVersion = NuGetVersion.Parse("0.5.0"),
279
+ NewVersion = NuGetVersion.Parse("5.0.0"),
280
+ UpdatedFiles = ["c1.txt"]
281
+ },
282
+ new DirectUpdate()
283
+ {
284
+ DependencyName = "Package.C",
285
+ OldVersion = NuGetVersion.Parse("0.6.0"),
286
+ NewVersion = NuGetVersion.Parse("6.0.0"),
287
+ UpdatedFiles = ["c2.txt"]
288
+ },
289
+ new DirectUpdate()
290
+ {
291
+ DependencyName = "Package.D",
292
+ OldVersion = NuGetVersion.Parse("0.7.0"),
293
+ NewVersion = NuGetVersion.Parse("7.0.0"),
294
+ UpdatedFiles = ["d1.txt"]
295
+ },
296
+ new DirectUpdate()
297
+ {
298
+ DependencyName = "Package.D",
299
+ OldVersion = NuGetVersion.Parse("0.8.0"),
300
+ NewVersion = NuGetVersion.Parse("8.0.0"),
301
+ UpdatedFiles = ["d2.txt"]
302
+ },
145
303
  },
146
304
  // dependencyGroupName
147
305
  null,
148
306
  // expectedTitle
149
- "Update Package.A to 1.0.0, 2.0.0; Package.B to 3.0.0, 4.0.0",
307
+ "Bump Package.A, Package.B, Package.C and Package.D",
150
308
  // expectedCommitMessage
151
309
  """
152
- Update:
153
- - Package.A to 1.0.0, 2.0.0
154
- - Package.B to 3.0.0, 4.0.0
310
+ Bump Package.A, Package.B, Package.C and Package.D
311
+
312
+ Bumps Package.A to 1.0.0, 2.0.0
313
+ Bumps Package.B to 3.0.0, 4.0.0
314
+ Bumps Package.C to 5.0.0, 6.0.0
315
+ Bumps Package.D to 7.0.0, 8.0.0
316
+ """,
317
+ // expectedBody
318
+ """
319
+ Performed the following updates:
320
+ - Updated Package.A from 0.1.0 to 1.0.0 in a1.txt
321
+ - Updated Package.A from 0.2.0 to 2.0.0 in a2.txt
322
+ - Updated Package.B from 0.3.0 to 3.0.0 in b1.txt
323
+ - Updated Package.B from 0.4.0 to 4.0.0 in b2.txt
324
+ - Updated Package.C from 0.5.0 to 5.0.0 in c1.txt
325
+ - Updated Package.C from 0.6.0 to 6.0.0 in c2.txt
326
+ - Updated Package.D from 0.7.0 to 7.0.0 in d1.txt
327
+ - Updated Package.D from 0.8.0 to 8.0.0 in d2.txt
328
+ """
329
+ ];
330
+
331
+ // group with one update
332
+ yield return
333
+ [
334
+ // job
335
+ FromCommitOptions(null),
336
+ // updateOperationsPerformed
337
+ new UpdateOperationBase[]
338
+ {
339
+ new DirectUpdate()
340
+ {
341
+ DependencyName = "Some.Package",
342
+ OldVersion = NuGetVersion.Parse("1.0.0"),
343
+ NewVersion = NuGetVersion.Parse("1.2.3"),
344
+ UpdatedFiles = ["a.txt"]
345
+ }
346
+ },
347
+ // dependencyGroupName
348
+ "test-group",
349
+ // expectedTitle
350
+ "Bump the test-group group with 1 update",
351
+ // expectedCommitMessage
352
+ """
353
+ Bump the test-group group with 1 update
354
+
355
+ Bumps Some.Package from 1.0.0 to 1.2.3
356
+ """,
357
+ // expectedBody
358
+ """
359
+ Performed the following updates:
360
+ - Updated Some.Package from 1.0.0 to 1.2.3 in a.txt
361
+ """
362
+ ];
363
+
364
+ // group with multiple updates
365
+ yield return
366
+ [
367
+ // job
368
+ FromCommitOptions(null),
369
+ // updateOperationsPerformed
370
+ new UpdateOperationBase[]
371
+ {
372
+ new DirectUpdate()
373
+ {
374
+ DependencyName = "Package.A",
375
+ OldVersion = NuGetVersion.Parse("1.0.0"),
376
+ NewVersion = NuGetVersion.Parse("1.2.3"),
377
+ UpdatedFiles = ["a.txt"]
378
+ },
379
+ new DirectUpdate()
380
+ {
381
+ DependencyName = "Package.B",
382
+ OldVersion = NuGetVersion.Parse("4.0.0"),
383
+ NewVersion = NuGetVersion.Parse("4.5.6"),
384
+ UpdatedFiles = ["a.txt"]
385
+ }
386
+ },
387
+ // dependencyGroupName
388
+ "test-group",
389
+ // expectedTitle
390
+ "Bump the test-group group with 2 updates",
391
+ // expectedCommitMessage
392
+ """
393
+ Bump the test-group group with 2 updates
394
+
395
+ Bumps Package.A from 1.0.0 to 1.2.3
396
+ Bumps Package.B from 4.0.0 to 4.5.6
155
397
  """,
156
398
  // expectedBody
157
399
  """
158
400
  Performed the following updates:
159
- - Updated Package.A to 1.0.0 in a1.txt
160
- - Updated Package.A to 2.0.0 in a2.txt
161
- - Updated Package.B to 3.0.0 in b1.txt
162
- - Updated Package.B to 4.0.0 in b2.txt
401
+ - Updated Package.A from 1.0.0 to 1.2.3 in a.txt
402
+ - Updated Package.B from 4.0.0 to 4.5.6 in a.txt
163
403
  """
164
404
  ];
165
405
  }
@@ -29,6 +29,7 @@ public class RunWorkerTests
29
29
  public async Task UpdateSinglePackageProducedExpectedAPIMessages()
30
30
  {
31
31
  await RunAsync(
32
+ experimentsManager: new ExperimentsManager() { UseLegacyUpdateHandler = true },
32
33
  packages: [],
33
34
  job: new Job()
34
35
  {
@@ -224,6 +225,7 @@ public class RunWorkerTests
224
225
  CommitMessage = TestPullRequestCommitMessage,
225
226
  PrTitle = TestPullRequestTitle,
226
227
  PrBody = TestPullRequestBody,
228
+ DependencyGroup = null,
227
229
  },
228
230
  new MarkAsProcessed("TEST-COMMIT-SHA")
229
231
  ]
@@ -236,6 +238,7 @@ public class RunWorkerTests
236
238
  var repoMetadata = XElement.Parse("""<repository type="git" url="https://nuget.example.com/some-package" />""");
237
239
  var repoMetadata2 = XElement.Parse("""<repository type="git" url="https://nuget.example.com/some-package2" />""");
238
240
  await RunAsync(
241
+ experimentsManager: new ExperimentsManager() { UseLegacyUpdateHandler = true },
239
242
  packages:
240
243
  [
241
244
  MockNuGetPackage.CreateSimplePackage("Some.Package", "1.0.0", "net8.0", additionalMetadata: [repoMetadata]),
@@ -490,6 +493,7 @@ public class RunWorkerTests
490
493
  CommitMessage = TestPullRequestCommitMessage,
491
494
  PrTitle = TestPullRequestTitle,
492
495
  PrBody = TestPullRequestBody,
496
+ DependencyGroup = null,
493
497
  },
494
498
  new MarkAsProcessed("TEST-COMMIT-SHA")
495
499
  ]
@@ -500,6 +504,7 @@ public class RunWorkerTests
500
504
  public async Task ErrorsThrownFromDiscoveryWorkerAreForwaredToApiHandler()
501
505
  {
502
506
  await RunAsync(
507
+ experimentsManager: new ExperimentsManager() { UseLegacyUpdateHandler = true },
503
508
  packages:
504
509
  [
505
510
  ],
@@ -556,6 +561,7 @@ public class RunWorkerTests
556
561
  public async Task ErrorsReturnedFromDiscoveryWorkerAreForwaredToApiHandler()
557
562
  {
558
563
  await RunAsync(
564
+ experimentsManager: new ExperimentsManager() { UseLegacyUpdateHandler = true },
559
565
  packages: [],
560
566
  job: new Job()
561
567
  {
@@ -596,6 +602,7 @@ public class RunWorkerTests
596
602
  public async Task ErrorsThrownFromAnalyzeWorkerAreForwaredToApiHandler()
597
603
  {
598
604
  await RunAsync(
605
+ experimentsManager: new ExperimentsManager() { UseLegacyUpdateHandler = true },
599
606
  packages: [],
600
607
  job: new Job()
601
608
  {
@@ -694,6 +701,7 @@ public class RunWorkerTests
694
701
  public async Task ErrorsReturnedFromAnalyzeWorkerAreForwaredToApiHandler()
695
702
  {
696
703
  await RunAsync(
704
+ experimentsManager: new ExperimentsManager() { UseLegacyUpdateHandler = true },
697
705
  packages: [],
698
706
  job: new Job()
699
707
  {
@@ -807,6 +815,7 @@ public class RunWorkerTests
807
815
  public async Task ErrorsThrownFromUpdaterWorkerAreForwaredToApiHandler()
808
816
  {
809
817
  await RunAsync(
818
+ experimentsManager: new ExperimentsManager() { UseLegacyUpdateHandler = true },
810
819
  packages: [],
811
820
  job: new Job()
812
821
  {
@@ -916,6 +925,7 @@ public class RunWorkerTests
916
925
  public async Task ErrorsReturnedFromUpdaterWorkerAreForwaredToApiHandler()
917
926
  {
918
927
  await RunAsync(
928
+ experimentsManager: new ExperimentsManager() { UseLegacyUpdateHandler = true },
919
929
  packages: [],
920
930
  job: new Job()
921
931
  {
@@ -1040,6 +1050,7 @@ public class RunWorkerTests
1040
1050
  var repoMetadata = XElement.Parse("""<repository type="git" url="https://nuget.example.com/some-package" />""");
1041
1051
  var repoMetadata2 = XElement.Parse("""<repository type="git" url="https://nuget.example.com/some-package2" />""");
1042
1052
  await RunAsync(
1053
+ experimentsManager: new ExperimentsManager() { UseLegacyUpdateHandler = true },
1043
1054
  packages:
1044
1055
  [
1045
1056
  MockNuGetPackage.CreateSimplePackage("Some.Package", "1.0.0", "net8.0", additionalMetadata: [repoMetadata]),
@@ -1372,6 +1383,7 @@ public class RunWorkerTests
1372
1383
  CommitMessage = TestPullRequestCommitMessage,
1373
1384
  PrTitle = TestPullRequestTitle,
1374
1385
  PrBody = TestPullRequestBody,
1386
+ DependencyGroup = null,
1375
1387
  },
1376
1388
  new MarkAsProcessed("TEST-COMMIT-SHA")
1377
1389
  ]
@@ -1384,6 +1396,7 @@ public class RunWorkerTests
1384
1396
  var repoMetadata = XElement.Parse("""<repository type="git" url="https://nuget.example.com/some-package" />""");
1385
1397
  var repoMetadata2 = XElement.Parse("""<repository type="git" url="https://nuget.example.com/some-package2" />""");
1386
1398
  await RunAsync(
1399
+ experimentsManager: new ExperimentsManager() { UseLegacyUpdateHandler = true },
1387
1400
  packages:
1388
1401
  [
1389
1402
  MockNuGetPackage.CreateSimplePackage("Some.Package", "1.0.0", "net8.0", additionalMetadata: [repoMetadata]),
@@ -1943,6 +1956,7 @@ public class RunWorkerTests
1943
1956
  CommitMessage = TestPullRequestCommitMessage,
1944
1957
  PrTitle = TestPullRequestTitle,
1945
1958
  PrBody = TestPullRequestBody,
1959
+ DependencyGroup = null,
1946
1960
  },
1947
1961
  new MarkAsProcessed("TEST-COMMIT-SHA")
1948
1962
  ]
@@ -1953,6 +1967,7 @@ public class RunWorkerTests
1953
1967
  public async Task UpdatedFilesAreOnlyReportedOnce()
1954
1968
  {
1955
1969
  await RunAsync(
1970
+ experimentsManager: new ExperimentsManager() { UseLegacyUpdateHandler = true },
1956
1971
  job: new()
1957
1972
  {
1958
1973
  PackageManager = "nuget",
@@ -2261,6 +2276,7 @@ public class RunWorkerTests
2261
2276
  CommitMessage = TestPullRequestCommitMessage,
2262
2277
  PrTitle = TestPullRequestTitle,
2263
2278
  PrBody = TestPullRequestBody,
2279
+ DependencyGroup = null,
2264
2280
  },
2265
2281
  new MarkAsProcessed("TEST-COMMIT-SHA")
2266
2282
  ]
@@ -2271,6 +2287,7 @@ public class RunWorkerTests
2271
2287
  public async Task PackageListedInSecurityAdvisoriesSectionIsNotVulnerable()
2272
2288
  {
2273
2289
  await RunAsync(
2290
+ experimentsManager: new ExperimentsManager() { UseLegacyUpdateHandler = true },
2274
2291
  job: new()
2275
2292
  {
2276
2293
  Source = new()
@@ -2361,6 +2378,7 @@ public class RunWorkerTests
2361
2378
  public async Task PackageListedInSecurityAdvisoriesSectionIsNotPresent()
2362
2379
  {
2363
2380
  await RunAsync(
2381
+ experimentsManager: new ExperimentsManager() { UseLegacyUpdateHandler = true },
2364
2382
  job: new()
2365
2383
  {
2366
2384
  Source = new()
@@ -2451,6 +2469,7 @@ public class RunWorkerTests
2451
2469
  public async Task NonProjectFilesAreIncludedInPullRequest()
2452
2470
  {
2453
2471
  await RunAsync(
2472
+ experimentsManager: new ExperimentsManager() { UseLegacyUpdateHandler = true },
2454
2473
  job: new()
2455
2474
  {
2456
2475
  Source = new()
@@ -2660,6 +2679,7 @@ public class RunWorkerTests
2660
2679
  CommitMessage = TestPullRequestCommitMessage,
2661
2680
  PrTitle = TestPullRequestTitle,
2662
2681
  PrBody = TestPullRequestBody,
2682
+ DependencyGroup = null,
2663
2683
  },
2664
2684
  new MarkAsProcessed("TEST-COMMIT-SHA"),
2665
2685
  ]
@@ -2670,6 +2690,7 @@ public class RunWorkerTests
2670
2690
  public async Task PullRequestAlreadyExistsForLatestVersion()
2671
2691
  {
2672
2692
  await RunAsync(
2693
+ experimentsManager: new ExperimentsManager() { UseLegacyUpdateHandler = true },
2673
2694
  job: new()
2674
2695
  {
2675
2696
  Source = new()
@@ -2779,6 +2800,7 @@ public class RunWorkerTests
2779
2800
  public async Task AnalysisResultWithoutUpdatedDependenciesDoesNotCauseError()
2780
2801
  {
2781
2802
  await RunAsync(
2803
+ experimentsManager: new ExperimentsManager() { UseLegacyUpdateHandler = true },
2782
2804
  job: new()
2783
2805
  {
2784
2806
  Source = new()
@@ -2925,6 +2947,7 @@ public class RunWorkerTests
2925
2947
  CommitMessage = TestPullRequestCommitMessage,
2926
2948
  PrTitle = TestPullRequestTitle,
2927
2949
  PrBody = TestPullRequestBody,
2950
+ DependencyGroup = null,
2928
2951
  },
2929
2952
  new MarkAsProcessed("TEST-COMMIT-SHA"),
2930
2953
  ]
@@ -2945,6 +2968,7 @@ public class RunWorkerTests
2945
2968
  var file2ContentUpdated = rawBOM.Concat(Encoding.ASCII.GetBytes("updated2")).ToArray();
2946
2969
 
2947
2970
  await RunAsync(
2971
+ experimentsManager: new ExperimentsManager() { UseLegacyUpdateHandler = true },
2948
2972
  job: new Job()
2949
2973
  {
2950
2974
  Source = new()
@@ -3159,6 +3183,7 @@ public class RunWorkerTests
3159
3183
  CommitMessage = TestPullRequestCommitMessage,
3160
3184
  PrTitle = TestPullRequestTitle,
3161
3185
  PrBody = TestPullRequestBody,
3186
+ DependencyGroup = null,
3162
3187
  },
3163
3188
  new MarkAsProcessed("TEST-COMMIT-SHA"),
3164
3189
  ]
@@ -3169,6 +3194,7 @@ public class RunWorkerTests
3169
3194
  public async Task LineEndingsAreDetectedAndRestored()
3170
3195
  {
3171
3196
  await RunAsync(
3197
+ experimentsManager: new ExperimentsManager() { UseLegacyUpdateHandler = true },
3172
3198
  job: new Job()
3173
3199
  {
3174
3200
  Source = new()
@@ -3414,6 +3440,7 @@ public class RunWorkerTests
3414
3440
  CommitMessage = TestPullRequestCommitMessage,
3415
3441
  PrTitle = TestPullRequestTitle,
3416
3442
  PrBody = TestPullRequestBody,
3443
+ DependencyGroup = null,
3417
3444
  },
3418
3445
  new MarkAsProcessed("TEST-COMMIT-SHA"),
3419
3446
  ]
@@ -3424,6 +3451,7 @@ public class RunWorkerTests
3424
3451
  public async Task UnknownErrorsGenerateAllRequiredApiCalls()
3425
3452
  {
3426
3453
  await RunAsync(
3454
+ experimentsManager: new ExperimentsManager() { UseLegacyUpdateHandler = true },
3427
3455
  job: new Job()
3428
3456
  {
3429
3457
  Source = new()
@@ -3495,7 +3523,7 @@ public class RunWorkerTests
3495
3523
 
3496
3524
  var worker = new RunWorker(jobId, testApiHandler, discoveryWorker, analyzeWorker, updaterWorker, logger);
3497
3525
  var repoContentsPathDirectoryInfo = new DirectoryInfo(tempDirectory.DirectoryPath);
3498
- var actualResult = await worker.RunAsync(job, repoContentsPathDirectoryInfo, "TEST-COMMIT-SHA");
3526
+ var actualResult = await worker.RunAsync(job, repoContentsPathDirectoryInfo, "TEST-COMMIT-SHA", experimentsManager);
3499
3527
  var actualApiMessages = testApiHandler.ReceivedMessages
3500
3528
  .Select(m =>
3501
3529
  {
@@ -3559,6 +3587,6 @@ public class RunWorkerTests
3559
3587
 
3560
3588
  internal static string SerializeObjectAndType(object obj)
3561
3589
  {
3562
- return $"{obj.GetType().Name}:{JsonSerializer.Serialize(obj)}";
3590
+ return $"{obj.GetType().Name}:{JsonSerializer.Serialize(obj, RunWorker.SerializerOptions)}";
3563
3591
  }
3564
3592
  }