Skip to content

Commit

Permalink
fix(bake): Bake stage output may contain output from unrelated stages (
Browse files Browse the repository at this point in the history
…#3652)

As @luispollo notes in the code I removed, the current implementation may include output from completely unrelated bakes that are running at the same time as the bake stage in question. I fail to see any reason this can be correct.

After applying this fix, each bake stage will contain the bakes created in that bake stage, and nothing else.

Coupled with [this PR](#3651), this fix will make the output of pipelines with multiple bake stages correct, as all the `deploymentDetails` will be merged instead of overwritten, and thus contain all images created, and not just an arbitrary list which is timing dependent.

Co-authored-by: Mark Vulfson <mvulfson@netflix.com>
  • Loading branch information
jervi and marchello2000 committed May 12, 2020
1 parent 4ab200b commit 0bcc69c
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,8 @@ class BakeStage implements StageDefinitionBuilder {

@Nonnull
TaskResult execute(@Nonnull StageExecution stage) {
def bakeInitializationStages = stage.execution.stages.findAll {
it.parentStageId == stage.parentStageId && it.status == ExecutionStatus.RUNNING
}

// FIXME? (lpollo): I don't know why we do this, but we include in relatedStages all parallel bake stages in the
// same pipeline, not just the ones related to the stage passed to this task, which means this list actually
// contains *unrelated* bake stages...
def relatedBakeStages = stage.execution.stages.findAll {
it.type == PIPELINE_CONFIG_TYPE && bakeInitializationStages*.id.contains(it.parentStageId)
it.type == PIPELINE_CONFIG_TYPE && stage.id == it.parentStageId
}

def globalContext = [
Expand Down

0 comments on commit 0bcc69c

Please sign in to comment.