From df36cfeccd584317f4c045d672594592fdb48432 Mon Sep 17 00:00:00 2001 From: Asher Feldman Date: Thu, 6 Feb 2020 16:57:23 -0800 Subject: [PATCH] fix(artifacts): don't output buildArtifacts as korkArtifacts (#3417) --- .../spinnaker/orca/igor/tasks/GetBuildArtifactsTask.java | 5 ----- .../orca/igor/tasks/GetBuildArtifactsTaskSpec.groovy | 5 +++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/orca-igor/src/main/groovy/com/netflix/spinnaker/orca/igor/tasks/GetBuildArtifactsTask.java b/orca-igor/src/main/groovy/com/netflix/spinnaker/orca/igor/tasks/GetBuildArtifactsTask.java index b6311a335f..6afcbab989 100644 --- a/orca-igor/src/main/groovy/com/netflix/spinnaker/orca/igor/tasks/GetBuildArtifactsTask.java +++ b/orca-igor/src/main/groovy/com/netflix/spinnaker/orca/igor/tasks/GetBuildArtifactsTask.java @@ -22,7 +22,6 @@ import com.netflix.spinnaker.orca.igor.BuildService; import com.netflix.spinnaker.orca.igor.model.CIStageDefinition; import com.netflix.spinnaker.orca.pipeline.model.Stage; -import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; @@ -45,10 +44,6 @@ public class GetBuildArtifactsTask extends RetryableIgorTask stageDefinition.getPropertyFile(), stageDefinition.getMaster(), stageDefinition.getJob()); - if (artifacts == null) { - artifacts = new ArrayList<>(); - } - artifacts.addAll(stageDefinition.getBuildInfo().getArtifacts()); Map> outputs = Collections.singletonMap("artifacts", artifacts); return TaskResult.builder(ExecutionStatus.SUCCEEDED) .context(Collections.emptyMap()) diff --git a/orca-igor/src/test/groovy/com/netflix/spinnaker/orca/igor/tasks/GetBuildArtifactsTaskSpec.groovy b/orca-igor/src/test/groovy/com/netflix/spinnaker/orca/igor/tasks/GetBuildArtifactsTaskSpec.groovy index 6215e5eab3..ffe7dd9514 100644 --- a/orca-igor/src/test/groovy/com/netflix/spinnaker/orca/igor/tasks/GetBuildArtifactsTaskSpec.groovy +++ b/orca-igor/src/test/groovy/com/netflix/spinnaker/orca/igor/tasks/GetBuildArtifactsTaskSpec.groovy @@ -114,8 +114,9 @@ class GetBuildArtifactsTaskSpec extends Specification { then: 1 * buildService.getArtifacts(BUILD_NUMBER, null, MASTER, JOB) >> [testArtifact] - artifacts.size() == 2 - artifacts*.name == ["my-artifact", "another-artifact"] + // Modified to reflect a fix to avoid mixing build and kork artifacts in outputs.artifacts. + artifacts.size() == 1 + artifacts*.name == ["my-artifact"] } def createStage(String propertyFile) {