@@ -164,6 +164,8 @@ public async Task VersionsAreMergedInBackflowAfterForwardFlowTest()
164164 _versionDetails [ $ "repo/{ lastFlow . RepoSha } "] = new VersionDetails (
165165 [
166166 CreateDependency ( "Package.From.Build" , "1.0.0" , LastVmrSha ) ,
167+ CreateDependency ( "Package.Excluded.From.Backflow" , "1.0.0" , LastVmrSha ) ,
168+ CreateDependency ( "Package.Also.Excluded.From.Backflow" , "1.0.0" , LastVmrSha ) ,
167169 CreateDependency ( "Package.Removed.In.Repo" , "1.0.0" , LastVmrSha ) ,
168170 CreateDependency ( "Package.Updated.In.Both" , "1.0.0" , LastVmrSha ) ,
169171 CreateDependency ( "Package.Removed.In.VMR" , "1.0.0" , LastVmrSha ) , // Will be removed in VMR
@@ -174,6 +176,8 @@ public async Task VersionsAreMergedInBackflowAfterForwardFlowTest()
174176 _versionDetails [ $ "repo/{ TargetBranch } "] = new VersionDetails (
175177 [
176178 CreateDependency ( "Package.From.Build" , "1.0.1" , LastVmrSha ) , // Updated
179+ CreateDependency ( "Package.Excluded.From.Backflow" , "1.0.0" , LastVmrSha ) ,
180+ CreateDependency ( "Package.Also.Excluded.From.Backflow" , "1.0.0" , LastVmrSha ) ,
177181 CreateDependency ( "Package.Updated.In.Both" , "1.0.3" , LastVmrSha ) , // Updated (vmr updated to 3.0.0)
178182 CreateDependency ( "Package.Added.In.Repo" , "1.0.0" , LastVmrSha ) , // Added
179183 CreateDependency ( "Package.Added.In.Both" , "2.2.2" , LastVmrSha ) , // Added in both
@@ -191,6 +195,8 @@ public async Task VersionsAreMergedInBackflowAfterForwardFlowTest()
191195 _versionDetails [ $ "vmr/{ CurrentVmrSha } "] = new VersionDetails (
192196 [
193197 CreateDependency ( "Package.From.Build" , "1.0.0" , LastVmrSha ) ,
198+ CreateDependency ( "Package.Excluded.From.Backflow" , "1.0.0" , LastVmrSha ) ,
199+ CreateDependency ( "Package.Also.Excluded.From.Backflow" , "1.0.0" , LastVmrSha ) ,
194200 CreateDependency ( "Package.Removed.In.Repo" , "1.0.0" , LastVmrSha ) ,
195201 CreateDependency ( "Package.Updated.In.Both" , "3.0.0" , LastVmrSha ) , // Updated (repo updated to 1.0.3)
196202 CreateDependency ( "Package.Added.In.VMR" , "2.0.0" , LastVmrSha ) , // Added
@@ -202,6 +208,8 @@ public async Task VersionsAreMergedInBackflowAfterForwardFlowTest()
202208 var build = CreateNewBuild ( CurrentVmrSha ,
203209 [
204210 ( "Package.From.Build" , "1.0.5" ) ,
211+ ( "Package.Excluded.From.Backflow" , "1.0.2" ) ,
212+ ( "Package.Also.Excluded.From.Backflow" , "1.0.2" ) ,
205213 ( "Another.Package.From.Build" , "1.0.5" ) ,
206214 ( "Yet.Another.Package.From.Build" , "1.0.5" )
207215 ] ) ;
@@ -215,13 +223,17 @@ public async Task VersionsAreMergedInBackflowAfterForwardFlowTest()
215223 // - Package.Removed.In.VMR - removed in VMR (and thus in repo)
216224 // - Package.Added.In.Repo: 1.0.0 - added in repo, so already there
217225 // - Package.Added.In.VMR - added in VMR, so it was just added in the repo (not getting updated)
226+ // - Package.Excluded.From.Backflow - excluded from backflow
227+ // - Package.Also.Excluded.From.Backflow - excluded from backflow
218228 await TestConflictResolver (
219229 build ,
220230 lastFlow ,
221231 currentFlow ,
222232 expectedDependencies :
223233 [
224234 ( "Package.From.Build" , "1.0.5" ) ,
235+ ( "Package.Excluded.From.Backflow" , "1.0.0" ) ,
236+ ( "Package.Also.Excluded.From.Backflow" , "1.0.0" ) ,
225237 ( "Package.Updated.In.Both" , "3.0.0" ) ,
226238 ( "Package.Added.In.Repo" , "1.0.0" ) ,
227239 ( "Package.Added.In.VMR" , "2.0.0" ) ,
@@ -233,7 +245,8 @@ await TestConflictResolver(
233245 new ( "Package.From.Build" , "1.0.1" , "1.0.5" ) ,
234246 new ( "Package.Updated.In.Both" , "1.0.3" , "3.0.0" ) ,
235247 ] ,
236- headBranchExisted : false ) ;
248+ headBranchExisted : false ,
249+ excludedAssets : [ "Package.Excluded.From.Backflow" , "Package.Also.*" ] ) ;
237250
238251 // Now we will add a new dependency to the PR branch
239252 // We will change a dependency in the repo too
@@ -260,6 +273,8 @@ await TestConflictResolver(
260273
261274 build = CreateNewBuild ( newVmrSha , [ ..build . Assets . Select ( a => ( a . Name , "1.0.6" ) ) ] ) ;
262275
276+ // This time, don't exclude the assets from an update.
277+ // We should see the updates.
263278 await TestConflictResolver (
264279 build ,
265280 currentFlow ,
@@ -268,6 +283,8 @@ await TestConflictResolver(
268283 [
269284 // Same as before
270285 ( "Package.From.Build" , "1.0.6" ) ,
286+ ( "Package.Excluded.From.Backflow" , "1.0.6" ) ,
287+ ( "Package.Also.Excluded.From.Backflow" , "1.0.6" ) ,
271288 ( "Package.Updated.In.Both" , "3.0.0" ) ,
272289 ( "Package.Added.In.Repo" , "1.0.0" ) ,
273290 ( "Package.Added.In.VMR" , "2.0.0" ) ,
@@ -281,9 +298,12 @@ await TestConflictResolver(
281298 [
282299 new ( "New.Package.In.Vmr" , null , To : "4.0.0" ) ,
283300 new ( "New.Package.In.Repo" , null , To : "4.0.0" ) ,
301+ new ( "Package.Excluded.From.Backflow" , "1.0.0" , To : "1.0.6" ) ,
302+ new ( "Package.Also.Excluded.From.Backflow" , "1.0.0" , To : "1.0.6" ) ,
284303 new ( "Package.From.Build" , "1.0.5" , To : "1.0.6" ) ,
285304 ] ,
286- headBranchExisted : true ) ;
305+ headBranchExisted : true ,
306+ excludedAssets : [ ] ) ;
287307 }
288308
289309 // Tests a case when conflicting updates were made in the repo and VMR.
@@ -327,7 +347,8 @@ public async Task ConflictingChangesThrowTest()
327347 currentFlow ,
328348 [ ] ,
329349 [ ] ,
330- headBranchExisted : false ) ;
350+ headBranchExisted : false ,
351+ excludedAssets : [ ] ) ;
331352
332353 await action . Should ( ) . ThrowAsync < ConflictingDependencyUpdateException > ( ) ;
333354 }
@@ -338,7 +359,8 @@ private async Task TestConflictResolver(
338359 Backflow currentFlow ,
339360 ( string Name , string Version ) [ ] expectedDependencies ,
340361 ExpectedUpdate [ ] expectedUpdates ,
341- bool headBranchExisted )
362+ bool headBranchExisted ,
363+ string [ ] excludedAssets )
342364 {
343365 var gitFileChanges = new GitFileContentContainer ( ) ;
344366 _dependencyFileManager
@@ -376,7 +398,7 @@ private async Task TestConflictResolver(
376398 build ,
377399 PrBranch ,
378400 TargetBranch ,
379- excludedAssets : [ ] ,
401+ excludedAssets : excludedAssets ,
380402 headBranchExisted ,
381403 cancellationToken ) ;
382404
0 commit comments