From de719538a980d6966c87a26cc3c8ac558a02c2d7 Mon Sep 17 00:00:00 2001 From: SusmithaGU Date: Thu, 31 Aug 2023 18:34:20 +0530 Subject: [PATCH 1/2] fix(orca): tying exceptions to tasks --- .../com/netflix/spinnaker/orca/q/handler/RunTaskHandler.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/orca-queue/src/main/kotlin/com/netflix/spinnaker/orca/q/handler/RunTaskHandler.kt b/orca-queue/src/main/kotlin/com/netflix/spinnaker/orca/q/handler/RunTaskHandler.kt index 436c3e2873..330394b51c 100644 --- a/orca-queue/src/main/kotlin/com/netflix/spinnaker/orca/q/handler/RunTaskHandler.kt +++ b/orca-queue/src/main/kotlin/com/netflix/spinnaker/orca/q/handler/RunTaskHandler.kt @@ -228,6 +228,8 @@ class RunTaskHandler( } val status = stage.failureStatus(default = TERMINAL) stage.context["exception"] = exceptionDetails + //Adding here serves two purposes one to display taskwise failures,other to display the exact failure when continue pipeline is set to true + taskModel.taskExceptionDetails["exception"] = exceptionDetails repository.storeStage(stage) queue.push(CompleteTask(message, status, TERMINAL)) trackResult(stage, thisInvocationStartTimeMs, taskModel, status) From b28937b2bbddca7209e21aba739f5b58bbd23793 Mon Sep 17 00:00:00 2001 From: SusmithaGU Date: Fri, 1 Sep 2023 11:44:38 +0530 Subject: [PATCH 2/2] fix(orca): added test separately --- .../spinnaker/orca/q/handler/RunTaskHandlerTest.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/RunTaskHandlerTest.kt b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/RunTaskHandlerTest.kt index 23953f0481..1412feee74 100644 --- a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/RunTaskHandlerTest.kt +++ b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/RunTaskHandlerTest.kt @@ -583,6 +583,14 @@ object RunTaskHandlerTest : SubjectSpek({ } ) } + + it("attaches the exception to the taskExceptionDetails") { + verify(repository).storeStage( + check { + assertThat(it.tasks[0].taskExceptionDetails["exception"]).isEqualTo(exceptionDetails) + } + ) + } } and("the task should not fail the whole pipeline, only the branch") {