Skip to content

Commit 60aac45

Browse files
committed
fix: [CI-8492]: same identifier artifact output
1 parent 6cf3d28 commit 60aac45

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

879-pipeline-ci-commons/src/main/java/io/harness/pms/sdk/core/plugin/CommonAbstractStepExecutable.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,12 @@ private void publishArtifact(Ambiance ambiance, StepElementParameters stepParame
400400
OptionalSweepingOutput optionalSweepingOutput = executionSweepingOutputResolver.resolveOptional(
401401
ambiance, RefObjectUtils.getSweepingOutputRefObject(artifactOutputVariableKey));
402402
if (!optionalSweepingOutput.isFound()) {
403-
executionSweepingOutputResolver.consume(ambiance, artifactOutputVariableKey,
404-
StepArtifactSweepingOutput.builder().stepArtifacts(stepArtifacts).build(), StepOutcomeGroup.STAGE.name());
403+
try {
404+
executionSweepingOutputResolver.consume(ambiance, artifactOutputVariableKey,
405+
StepArtifactSweepingOutput.builder().stepArtifacts(stepArtifacts).build(), StepOutcomeGroup.STAGE.name());
406+
} catch (Exception e) {
407+
log.error("Error while consuming artifact sweeping output", e);
408+
}
405409
}
406410

407411
// we found a bug CI-7115 due to which we had to change the outcome identifier from artifact_+stepId to
@@ -410,8 +414,12 @@ private void publishArtifact(Ambiance ambiance, StepElementParameters stepParame
410414
optionalSweepingOutput = executionSweepingOutputResolver.resolveOptional(
411415
ambiance, RefObjectUtils.getSweepingOutputRefObject("artifact_" + stepIdentifier));
412416
if (!optionalSweepingOutput.isFound()) {
413-
executionSweepingOutputResolver.consume(ambiance, "artifact_" + stepIdentifier,
414-
StepArtifactSweepingOutput.builder().stepArtifacts(stepArtifacts).build(), StepOutcomeGroup.STAGE.name());
417+
try {
418+
executionSweepingOutputResolver.consume(ambiance, "artifact_" + stepIdentifier,
419+
StepArtifactSweepingOutput.builder().stepArtifacts(stepArtifacts).build(), StepOutcomeGroup.STAGE.name());
420+
} catch (Exception e) {
421+
log.error("Error while consuming artifact sweeping output", e);
422+
}
415423
}
416424

417425
String uniqueStepIdentifier = getUniqueStepIdentifier(ambiance, stepIdentifier);

0 commit comments

Comments
 (0)