From 4f3c60c80859fbafbd41d65f474cb5b2cb673bc3 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Mon, 7 Dec 2020 12:08:16 -0500 Subject: [PATCH] batches.py: Fix handling of "changed-and-after" all_reused_in_prev_batch should only check components in the previous batch, not components in all batches including future batches. This was accidentally regressed by some code refactoring in c36bd7ebac2. --- module_build_service/scheduler/batches.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/module_build_service/scheduler/batches.py b/module_build_service/scheduler/batches.py index c351f4c8..97553974 100644 --- a/module_build_service/scheduler/batches.py +++ b/module_build_service/scheduler/batches.py @@ -233,7 +233,9 @@ def start_next_batch_build(config, module, builder, components=None): # This is used to determine if it's worth checking if a component can be # reused later on in the code all_reused_in_prev_batch = all( - c.reused_component_id is not None for c in module.component_builds) + c.reused_component_id is not None for c in module.component_builds + if c.batch == module.batch + ) # Although this variable isn't necessary, it is easier to read code later on with it prev_batch = module.batch