dependabot-nuget 0.350.0 → 0.352.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 784c940d61ac0b10f0d1b6516c7b33bbaa6e8de03da294ee43245746303e24bb
4
- data.tar.gz: 6fddc772c732c7a21c56121fdf90f35d668cc6ce3c5662ae134d6060ae55f291
3
+ metadata.gz: 011bc96766fde7190676e83ac5f6fb5a227ad6a8efa644010309df485732231c
4
+ data.tar.gz: 0fe5b3850138fcc5c1c2bef7bc180e17b4137851b34d7d096474561d211f15f4
5
5
  SHA512:
6
- metadata.gz: 82b32710529925d9392c82d7403ad91eea8445f3ef734190a1175ed56a60bd9a2f338f7066956c5074f1478e4f57ff36b94a1670fabc77a068a8362aee442bf7
7
- data.tar.gz: 6b5c2ed6e27c43f1c9f264a6dd749f42fc71018e308a66484aa6aa734dfa232e845be87c75797cb0f8cff8a54e71f164f56fb07394faf7ac0fdcfc776713f007
6
+ metadata.gz: a549a494e8b71d2441455b71a7b48076d20ce0051fcbd02da7762b02e311b155a0affd5810b4af67279fb61d1db63a010d2e0f7798608b4a66e8ac5c02ae9611
7
+ data.tar.gz: a62dbf38f60ecefbe4dac4ffc32564caecf35c4b80e70e5555d49ef0ac4677767613977f75ee5838f470fe2bf55aca0d25074919325f96b683dbdd975eac08d5
@@ -222,7 +222,7 @@ public partial class DiscoveryWorker : IDiscoveryWorker
222
222
  .ToImmutableArray();
223
223
  }
224
224
 
225
- private async static Task<ImmutableArray<string>> ExpandEntryPointsIntoProjectsAsync(IEnumerable<string> entryPoints, ExperimentsManager experimentsManager)
225
+ internal async static Task<ImmutableArray<string>> ExpandEntryPointsIntoProjectsAsync(IEnumerable<string> entryPoints, ExperimentsManager experimentsManager)
226
226
  {
227
227
  HashSet<string> expandedProjects = new(PathComparer.Instance);
228
228
  HashSet<string> seenProjects = new(PathComparer.Instance);
@@ -330,7 +330,7 @@ public partial class DiscoveryWorker : IDiscoveryWorker
330
330
  // referenced projects commonly use the Windows-style directory separator which can cause problems on Unix
331
331
  // but Windows is able to handle a Unix-style path, so we normalize everything to that then normalize again
332
332
  // with regards to relative paths, e.g., "some/path/" + "..\other\file" => "some/other/file"
333
- string referencedProjectPath = Path.Join(projectDir, projectItem.EvaluatedInclude.NormalizePathToUnix());
333
+ string referencedProjectPath = Path.Combine(projectDir, projectItem.EvaluatedInclude.NormalizePathToUnix());
334
334
  string normalizedReferenceProjectPath = new FileInfo(referencedProjectPath).FullName;
335
335
  if (seenItems.Add(normalizedReferenceProjectPath))
336
336
  {
@@ -51,13 +51,6 @@ internal class GroupUpdateAllVersionsHandler : IUpdateHandler
51
51
  var repoContentsPath = caseInsensitiveRepoContentsPath ?? originalRepoContentsPath;
52
52
  foreach (var group in job.DependencyGroups)
53
53
  {
54
- var existingGroupPr = job.ExistingGroupPullRequests.FirstOrDefault(pr => pr.DependencyGroupName == group.Name);
55
- if (existingGroupPr is not null)
56
- {
57
- logger.Info($"Existing pull request found for group {group.Name}. Skipping pull request creation.");
58
- continue;
59
- }
60
-
61
54
  logger.Info($"Starting update for group {group.Name}");
62
55
  var groupMatcher = group.GetGroupMatcher();
63
56
  var updateOperationsPerformed = new List<UpdateOperationBase>();
@@ -146,19 +139,29 @@ internal class GroupUpdateAllVersionsHandler : IUpdateHandler
146
139
 
147
140
  if (updateOperationsPerformed.Count > 0)
148
141
  {
149
- var commitMessage = PullRequestTextGenerator.GetPullRequestCommitMessage(job, [.. updateOperationsPerformed], group.Name);
150
- var prTitle = PullRequestTextGenerator.GetPullRequestTitle(job, [.. updateOperationsPerformed], group.Name);
151
- var prBody = await PullRequestTextGenerator.GetPullRequestBodyAsync(job, [.. updateOperationsPerformed], [.. updatedDependencies], experimentsManager);
152
- await apiHandler.CreatePullRequest(new CreatePullRequest()
142
+ var existingPullRequest = job.GetExistingPullRequestForDependencies(
143
+ dependencies: updatedDependencies.Select(d => new Dependency(d.Name, d.Version, DependencyType.Unknown)),
144
+ considerVersions: true);
145
+ if (existingPullRequest is not null)
153
146
  {
154
- Dependencies = [.. updatedDependencies],
155
- UpdatedDependencyFiles = [.. allUpdatedDependencyFiles],
156
- BaseCommitSha = baseCommitSha,
157
- CommitMessage = commitMessage,
158
- PrTitle = prTitle,
159
- PrBody = prBody,
160
- DependencyGroup = group.Name,
161
- });
147
+ logger.Info($"Pull request already exists for {string.Join(", ", existingPullRequest!.Item2.Select(d => $"{d.DependencyName}/{d.DependencyVersion}"))}");
148
+ }
149
+ else
150
+ {
151
+ var commitMessage = PullRequestTextGenerator.GetPullRequestCommitMessage(job, [.. updateOperationsPerformed], group.Name);
152
+ var prTitle = PullRequestTextGenerator.GetPullRequestTitle(job, [.. updateOperationsPerformed], group.Name);
153
+ var prBody = await PullRequestTextGenerator.GetPullRequestBodyAsync(job, [.. updateOperationsPerformed], [.. updatedDependencies], experimentsManager);
154
+ await apiHandler.CreatePullRequest(new CreatePullRequest()
155
+ {
156
+ Dependencies = [.. updatedDependencies],
157
+ UpdatedDependencyFiles = [.. allUpdatedDependencyFiles],
158
+ BaseCommitSha = baseCommitSha,
159
+ CommitMessage = commitMessage,
160
+ PrTitle = prTitle,
161
+ PrBody = prBody,
162
+ DependencyGroup = group.Name,
163
+ });
164
+ }
162
165
  }
163
166
  }
164
167
  }
@@ -254,19 +257,29 @@ internal class GroupUpdateAllVersionsHandler : IUpdateHandler
254
257
  var updatedDependencyFiles = await tracker.StopTrackingAsync(restoreOriginalContents: true);
255
258
  if (updateOperationsPerformed.Count > 0)
256
259
  {
257
- var commitMessage = PullRequestTextGenerator.GetPullRequestCommitMessage(job, [.. updateOperationsPerformed], null);
258
- var prTitle = PullRequestTextGenerator.GetPullRequestTitle(job, [.. updateOperationsPerformed], null);
259
- var prBody = await PullRequestTextGenerator.GetPullRequestBodyAsync(job, [.. updateOperationsPerformed], [.. updatedDependencies], experimentsManager);
260
- await apiHandler.CreatePullRequest(new CreatePullRequest()
260
+ var existingPullRequest = job.GetExistingPullRequestForDependencies(
261
+ dependencies: updatedDependencies.Select(d => new Dependency(d.Name, d.Version, DependencyType.Unknown)),
262
+ considerVersions: true);
263
+ if (existingPullRequest is not null)
261
264
  {
262
- Dependencies = [.. updatedDependencies],
263
- UpdatedDependencyFiles = [.. updatedDependencyFiles],
264
- BaseCommitSha = baseCommitSha,
265
- CommitMessage = commitMessage,
266
- PrTitle = prTitle,
267
- PrBody = prBody,
268
- DependencyGroup = null,
269
- });
265
+ logger.Info($"Pull request already exists for {string.Join(", ", existingPullRequest!.Item2.Select(d => $"{d.DependencyName}/{d.DependencyVersion}"))}");
266
+ }
267
+ else
268
+ {
269
+ var commitMessage = PullRequestTextGenerator.GetPullRequestCommitMessage(job, [.. updateOperationsPerformed], null);
270
+ var prTitle = PullRequestTextGenerator.GetPullRequestTitle(job, [.. updateOperationsPerformed], null);
271
+ var prBody = await PullRequestTextGenerator.GetPullRequestBodyAsync(job, [.. updateOperationsPerformed], [.. updatedDependencies], experimentsManager);
272
+ await apiHandler.CreatePullRequest(new CreatePullRequest()
273
+ {
274
+ Dependencies = [.. updatedDependencies],
275
+ UpdatedDependencyFiles = [.. updatedDependencyFiles],
276
+ BaseCommitSha = baseCommitSha,
277
+ CommitMessage = commitMessage,
278
+ PrTitle = prTitle,
279
+ PrBody = prBody,
280
+ DependencyGroup = null,
281
+ });
282
+ }
270
283
  }
271
284
  }
272
285
  }
@@ -22,6 +22,8 @@ public class XmlFileWriter : IFileWriter
22
22
  private const string PackageVersionElementName = "PackageVersion";
23
23
  private const string PropertyGroupElementName = "PropertyGroup";
24
24
 
25
+ private const string UpdaterAnnotationKind = "dependabot";
26
+
25
27
  private readonly ILogger _logger;
26
28
 
27
29
  // these file extensions are valid project entrypoints; everything else is ignored
@@ -357,10 +359,11 @@ public class XmlFileWriter : IFileWriter
357
359
  currentVersionString = versionAttribute.Value;
358
360
  updateVersionLocation = version =>
359
361
  {
362
+ var existingAnnotation = versionAttribute.GetAnnotations(UpdaterAnnotationKind).First();
360
363
  var refoundVersionAttribute = filesAndContents[filePath]
361
364
  .DescendantNodes()
362
365
  .OfType<XmlAttributeSyntax>()
363
- .First(a => a.FullSpan.Start == versionAttribute.FullSpan.Start);
366
+ .First(a => a.GetAnnotations(UpdaterAnnotationKind).Any(an => an == existingAnnotation));
364
367
  ReplaceNode(filePath, refoundVersionAttribute, refoundVersionAttribute.WithValue(version));
365
368
  };
366
369
  goto doVersionUpdate;
@@ -373,10 +376,11 @@ public class XmlFileWriter : IFileWriter
373
376
  currentVersionString = versionElement.GetContentValue();
374
377
  updateVersionLocation = version =>
375
378
  {
379
+ var existingAnnotation = versionElement.AsNode.GetAnnotations(UpdaterAnnotationKind).First();
376
380
  var refoundVersionElement = filesAndContents[filePath]
377
381
  .DescendantNodes()
378
382
  .OfType<IXmlElementSyntax>()
379
- .First(e => e.AsNode.FullSpan.Start == versionElement.AsNode.FullSpan.Start);
383
+ .First(e => e.AsNode.GetAnnotations(UpdaterAnnotationKind).Any(an => an == existingAnnotation));
380
384
  ReplaceNode(filePath, refoundVersionElement.AsNode, refoundVersionElement.WithContent(version).AsNode);
381
385
  };
382
386
  goto doVersionUpdate;
@@ -556,7 +560,18 @@ public class XmlFileWriter : IFileWriter
556
560
  var fullPath = Path.Join(repoContentsPath.FullName, path);
557
561
  var contents = await File.ReadAllTextAsync(fullPath);
558
562
  var document = Parser.ParseText(contents);
559
- return document;
563
+
564
+ // ensure relevant nodes have a unique annotation so we can do precise edits later
565
+ var documentWithAllAnnotations = document.ReplaceNodes(
566
+ document.DescendantNodes(),
567
+ (_, node) => node switch
568
+ {
569
+ var nodeType when nodeType is XmlAttributeSyntax or XmlElementSyntax
570
+ => node.WithAnnotations(new SyntaxAnnotation(UpdaterAnnotationKind)),
571
+ _ => node,
572
+ });
573
+
574
+ return documentWithAllAnnotations;
560
575
  }
561
576
 
562
577
  private static async Task WriteFileContentsAsync(DirectoryInfo repoContentsPath, string path, XmlDocumentSyntax document)
@@ -3,6 +3,7 @@ using System.Text.Json;
3
3
 
4
4
  using NuGetUpdater.Core.Discover;
5
5
  using NuGetUpdater.Core.Run.ApiModel;
6
+ using NuGetUpdater.Core.Test.Utilities;
6
7
 
7
8
  using Xunit;
8
9
 
@@ -1617,4 +1618,39 @@ public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
1617
1618
  }
1618
1619
  );
1619
1620
  }
1621
+
1622
+ [Theory]
1623
+ [InlineData(@"..\project2\project2.csproj")] // relative
1624
+ [InlineData(@"$(MSBuildThisFileDirectory)..\project2\project2.csproj")] // absolute
1625
+ public async Task ExpandEntryPoints(string projectReferencePath)
1626
+ {
1627
+ using var tempDir = await TemporaryDirectory.CreateWithContentsAsync(
1628
+ ("src/project1/project1.csproj", $"""
1629
+ <Project Sdk="Microsoft.NET.Sdk">
1630
+ <PropertyGroup>
1631
+ <TargetFramework>net9.0</TargetFramework>
1632
+ </PropertyGroup>
1633
+ <ItemGroup>
1634
+ <ProjectReference Include="{projectReferencePath}" />
1635
+ </ItemGroup>
1636
+ </Project>
1637
+ """),
1638
+ ("src/project2/project2.csproj", """
1639
+ <Project Sdk="Microsoft.NET.Sdk">
1640
+ <PropertyGroup>
1641
+ <TargetFramework>net9.0</TargetFramework>
1642
+ </PropertyGroup>
1643
+ </Project>
1644
+ """)
1645
+ );
1646
+ var actualEntryPoints = (await DiscoveryWorker.ExpandEntryPointsIntoProjectsAsync([Path.Combine(tempDir.DirectoryPath, "src/project1/project1.csproj")], new ExperimentsManager()))
1647
+ .Select(p => p.NormalizePathToUnix())
1648
+ .ToArray();
1649
+ var expectedEntryPoints = new[]
1650
+ {
1651
+ Path.Combine(tempDir.DirectoryPath, "src/project1/project1.csproj").NormalizePathToUnix(),
1652
+ Path.Combine(tempDir.DirectoryPath, "src/project2/project2.csproj").NormalizePathToUnix(),
1653
+ };
1654
+ AssertEx.Equal(expectedEntryPoints, actualEntryPoints);
1655
+ }
1620
1656
  }
@@ -995,6 +995,28 @@ public class GroupUpdateAllVersionsHandlerTests : UpdateHandlersTestsBase
995
995
  ],
996
996
  DependencyFiles = ["/src/project.csproj"],
997
997
  },
998
+ new UpdatedDependencyList()
999
+ {
1000
+ Dependencies = [
1001
+ new()
1002
+ {
1003
+ Name = "Package.For.Group.One",
1004
+ Version = "1.0.0",
1005
+ Requirements = [
1006
+ new() { Requirement = "1.0.0", File = "/src/project.csproj", Groups = ["dependencies"] },
1007
+ ],
1008
+ },
1009
+ new()
1010
+ {
1011
+ Name = "Package.For.Group.Two",
1012
+ Version = "2.0.0",
1013
+ Requirements = [
1014
+ new() { Requirement = "2.0.0", File = "/src/project.csproj", Groups = ["dependencies"] },
1015
+ ],
1016
+ },
1017
+ ],
1018
+ DependencyFiles = ["/src/project.csproj"],
1019
+ },
998
1020
  new MarkAsProcessed("TEST-COMMIT-SHA"),
999
1021
  ]
1000
1022
  );
@@ -1128,4 +1150,224 @@ public class GroupUpdateAllVersionsHandlerTests : UpdateHandlersTestsBase
1128
1150
  ]
1129
1151
  );
1130
1152
  }
1153
+
1154
+ [Fact]
1155
+ public async Task NoPullRequestCreatedForExisting_NoGroup()
1156
+ {
1157
+ await TestAsync(
1158
+ job: new Job()
1159
+ {
1160
+ Source = CreateJobSource("/src"),
1161
+ ExistingPullRequests = [
1162
+ new()
1163
+ {
1164
+ Dependencies = [
1165
+ new()
1166
+ {
1167
+ DependencyName = "Some.Dependency",
1168
+ DependencyVersion = NuGetVersion.Parse("2.0.0"),
1169
+ }
1170
+ ]
1171
+ }
1172
+ ]
1173
+ },
1174
+ files: [
1175
+ ("src/project.csproj", "initial contents"),
1176
+ ],
1177
+ discoveryWorker: TestDiscoveryWorker.FromResults(
1178
+ ("/src", new WorkspaceDiscoveryResult()
1179
+ {
1180
+ Path = "/src",
1181
+ Projects = [
1182
+ new()
1183
+ {
1184
+ FilePath = "project.csproj",
1185
+ Dependencies = [
1186
+ new("Some.Dependency", "1.0.0", DependencyType.PackageReference, TargetFrameworks: ["net9.0"]),
1187
+ ],
1188
+ ImportedFiles = [],
1189
+ AdditionalFiles = [],
1190
+ }
1191
+ ],
1192
+ })
1193
+ ),
1194
+ analyzeWorker: new TestAnalyzeWorker(input =>
1195
+ {
1196
+ var repoRoot = input.Item1;
1197
+ var discovery = input.Item2;
1198
+ var dependencyInfo = input.Item3;
1199
+ var newVersion = dependencyInfo.Name switch
1200
+ {
1201
+ "Some.Dependency" => "2.0.0",
1202
+ _ => throw new NotImplementedException($"Test didn't expect to update dependency {dependencyInfo.Name}"),
1203
+ };
1204
+ return Task.FromResult(new AnalysisResult()
1205
+ {
1206
+ CanUpdate = true,
1207
+ UpdatedVersion = newVersion,
1208
+ UpdatedDependencies = [],
1209
+ });
1210
+ }),
1211
+ updaterWorker: new TestUpdaterWorker(async input =>
1212
+ {
1213
+ var repoRoot = input.Item1;
1214
+ var workspacePath = input.Item2;
1215
+ var dependencyName = input.Item3;
1216
+ var previousVersion = input.Item4;
1217
+ var newVersion = input.Item5;
1218
+ var isTransitive = input.Item6;
1219
+
1220
+ await File.WriteAllTextAsync(Path.Join(repoRoot, workspacePath), "updated contents");
1221
+
1222
+ return new UpdateOperationResult()
1223
+ {
1224
+ UpdateOperations = [new DirectUpdate() { DependencyName = dependencyName, NewVersion = NuGetVersion.Parse(newVersion), UpdatedFiles = [workspacePath] }],
1225
+ };
1226
+ }),
1227
+ expectedUpdateHandler: GroupUpdateAllVersionsHandler.Instance,
1228
+ expectedApiMessages: [
1229
+ new IncrementMetric()
1230
+ {
1231
+ Metric = "updater.started",
1232
+ Tags = new()
1233
+ {
1234
+ ["operation"] = "group_update_all_versions",
1235
+ }
1236
+ },
1237
+ new UpdatedDependencyList()
1238
+ {
1239
+ Dependencies = [
1240
+ new()
1241
+ {
1242
+ Name = "Some.Dependency",
1243
+ Version = "1.0.0",
1244
+ Requirements = [
1245
+ new() { Requirement = "1.0.0", File = "/src/project.csproj", Groups = ["dependencies"] },
1246
+ ],
1247
+ },
1248
+ ],
1249
+ DependencyFiles = ["/src/project.csproj"],
1250
+ },
1251
+ new MarkAsProcessed("TEST-COMMIT-SHA"),
1252
+ ]
1253
+ );
1254
+ }
1255
+
1256
+ [Fact]
1257
+ public async Task NoPullRequestCreatedForExisting_Group()
1258
+ {
1259
+ await TestAsync(
1260
+ job: new Job()
1261
+ {
1262
+ Source = CreateJobSource("/src"),
1263
+ DependencyGroups = [new() { Name = "test-group" }],
1264
+ ExistingGroupPullRequests = [
1265
+ new()
1266
+ {
1267
+ DependencyGroupName = "test-group",
1268
+ Dependencies = [
1269
+ new()
1270
+ {
1271
+ DependencyName = "Some.Dependency",
1272
+ DependencyVersion = NuGetVersion.Parse("2.0.0"),
1273
+ }
1274
+ ]
1275
+ }
1276
+ ]
1277
+ },
1278
+ files: [
1279
+ ("src/project.csproj", "initial contents"),
1280
+ ],
1281
+ discoveryWorker: TestDiscoveryWorker.FromResults(
1282
+ ("/src", new WorkspaceDiscoveryResult()
1283
+ {
1284
+ Path = "/src",
1285
+ Projects = [
1286
+ new()
1287
+ {
1288
+ FilePath = "project.csproj",
1289
+ Dependencies = [
1290
+ new("Some.Dependency", "1.0.0", DependencyType.PackageReference, TargetFrameworks: ["net9.0"]),
1291
+ ],
1292
+ ImportedFiles = [],
1293
+ AdditionalFiles = [],
1294
+ }
1295
+ ],
1296
+ })
1297
+ ),
1298
+ analyzeWorker: new TestAnalyzeWorker(input =>
1299
+ {
1300
+ var repoRoot = input.Item1;
1301
+ var discovery = input.Item2;
1302
+ var dependencyInfo = input.Item3;
1303
+ var newVersion = dependencyInfo.Name switch
1304
+ {
1305
+ "Some.Dependency" => "2.0.0",
1306
+ _ => throw new NotImplementedException($"Test didn't expect to update dependency {dependencyInfo.Name}"),
1307
+ };
1308
+ return Task.FromResult(new AnalysisResult()
1309
+ {
1310
+ CanUpdate = true,
1311
+ UpdatedVersion = newVersion,
1312
+ UpdatedDependencies = [],
1313
+ });
1314
+ }),
1315
+ updaterWorker: new TestUpdaterWorker(async input =>
1316
+ {
1317
+ var repoRoot = input.Item1;
1318
+ var workspacePath = input.Item2;
1319
+ var dependencyName = input.Item3;
1320
+ var previousVersion = input.Item4;
1321
+ var newVersion = input.Item5;
1322
+ var isTransitive = input.Item6;
1323
+
1324
+ await File.WriteAllTextAsync(Path.Join(repoRoot, workspacePath), "updated contents");
1325
+
1326
+ return new UpdateOperationResult()
1327
+ {
1328
+ UpdateOperations = [new DirectUpdate() { DependencyName = dependencyName, NewVersion = NuGetVersion.Parse(newVersion), UpdatedFiles = [workspacePath] }],
1329
+ };
1330
+ }),
1331
+ expectedUpdateHandler: GroupUpdateAllVersionsHandler.Instance,
1332
+ expectedApiMessages: [
1333
+ new IncrementMetric()
1334
+ {
1335
+ Metric = "updater.started",
1336
+ Tags = new()
1337
+ {
1338
+ ["operation"] = "group_update_all_versions",
1339
+ }
1340
+ },
1341
+ new UpdatedDependencyList()
1342
+ {
1343
+ Dependencies = [
1344
+ new()
1345
+ {
1346
+ Name = "Some.Dependency",
1347
+ Version = "1.0.0",
1348
+ Requirements = [
1349
+ new() { Requirement = "1.0.0", File = "/src/project.csproj", Groups = ["dependencies"] },
1350
+ ],
1351
+ },
1352
+ ],
1353
+ DependencyFiles = ["/src/project.csproj"],
1354
+ },
1355
+ new UpdatedDependencyList()
1356
+ {
1357
+ Dependencies = [
1358
+ new()
1359
+ {
1360
+ Name = "Some.Dependency",
1361
+ Version = "1.0.0",
1362
+ Requirements = [
1363
+ new() { Requirement = "1.0.0", File = "/src/project.csproj", Groups = ["dependencies"] },
1364
+ ],
1365
+ },
1366
+ ],
1367
+ DependencyFiles = ["/src/project.csproj"],
1368
+ },
1369
+ new MarkAsProcessed("TEST-COMMIT-SHA"),
1370
+ ]
1371
+ );
1372
+ }
1131
1373
  }
@@ -1833,4 +1833,78 @@ public class XmlFileWriterTests : FileWriterTestsBase
1833
1833
  ]
1834
1834
  );
1835
1835
  }
1836
+
1837
+ [Fact]
1838
+ public async Task MultipleEdits_AttributeSpansChange()
1839
+ {
1840
+ await TestAsync(
1841
+ files: [
1842
+ ("project.csproj", """
1843
+ <Project Sdk="Microsoft.NET.Sdk">
1844
+ <ItemGroup Condition="'$(Configuration)' == 'Release'">
1845
+ <PackageReference Include="Some.Dependency" Version="9.0.0" />
1846
+ </ItemGroup>
1847
+ <ItemGroup Condition="'$(Configuration)' == 'Debug'">
1848
+ <PackageReference Include="Some.Dependency" Version="9.0.0" />
1849
+ </ItemGroup>
1850
+ </Project>
1851
+ """)
1852
+ ],
1853
+ initialProjectDependencyStrings: ["Some.Dependency/9.0.0"],
1854
+ requiredDependencyStrings: ["Some.Dependency/10.0.0"],
1855
+ expectedFiles: [
1856
+ ("project.csproj", """
1857
+ <Project Sdk="Microsoft.NET.Sdk">
1858
+ <ItemGroup Condition="'$(Configuration)' == 'Release'">
1859
+ <PackageReference Include="Some.Dependency" Version="10.0.0" />
1860
+ </ItemGroup>
1861
+ <ItemGroup Condition="'$(Configuration)' == 'Debug'">
1862
+ <PackageReference Include="Some.Dependency" Version="10.0.0" />
1863
+ </ItemGroup>
1864
+ </Project>
1865
+ """)
1866
+ ]
1867
+ );
1868
+ }
1869
+
1870
+ [Fact]
1871
+ public async Task MultipleEdits_ElementSpansChange()
1872
+ {
1873
+ await TestAsync(
1874
+ files: [
1875
+ ("project.csproj", """
1876
+ <Project Sdk="Microsoft.NET.Sdk">
1877
+ <ItemGroup Condition="'$(Configuration)' == 'Release'">
1878
+ <PackageReference Include="Some.Dependency">
1879
+ <Version>9.0.0</Version>
1880
+ </PackageReference>
1881
+ </ItemGroup>
1882
+ <ItemGroup Condition="'$(Configuration)' == 'Debug'">
1883
+ <PackageReference Include="Some.Dependency">
1884
+ <Version>9.0.0</Version>
1885
+ </PackageReference>
1886
+ </ItemGroup>
1887
+ </Project>
1888
+ """)
1889
+ ],
1890
+ initialProjectDependencyStrings: ["Some.Dependency/9.0.0"],
1891
+ requiredDependencyStrings: ["Some.Dependency/10.0.0"],
1892
+ expectedFiles: [
1893
+ ("project.csproj", """
1894
+ <Project Sdk="Microsoft.NET.Sdk">
1895
+ <ItemGroup Condition="'$(Configuration)' == 'Release'">
1896
+ <PackageReference Include="Some.Dependency">
1897
+ <Version>10.0.0</Version>
1898
+ </PackageReference>
1899
+ </ItemGroup>
1900
+ <ItemGroup Condition="'$(Configuration)' == 'Debug'">
1901
+ <PackageReference Include="Some.Dependency">
1902
+ <Version>10.0.0</Version>
1903
+ </PackageReference>
1904
+ </ItemGroup>
1905
+ </Project>
1906
+ """)
1907
+ ]
1908
+ );
1909
+ }
1836
1910
  }
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.350.0
4
+ version: 0.352.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.350.0
18
+ version: 0.352.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.350.0
25
+ version: 0.352.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: debug
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -552,7 +552,7 @@ licenses:
552
552
  - MIT
553
553
  metadata:
554
554
  bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
555
- changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.350.0
555
+ changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.352.0
556
556
  rdoc_options: []
557
557
  require_paths:
558
558
  - lib