From 056cfdca9e7fd7426a315fcbffc38d8ee2891212 Mon Sep 17 00:00:00 2001 From: TerrenceMcGuinness-NOAA Date: Fri, 15 Mar 2024 18:30:23 +0000 Subject: [PATCH] GitHub message error paths (#2401) Add feature to message paths to error logs of failed experiments to GitHub Messaging the PR from Jenkins. --- ci/Jenkinsfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index 34535ed608..bda7b5c694 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -155,6 +155,12 @@ pipeline { sh(script: "${HOMEgfs}/ci/scripts/utils/ci_utils_wrapper.sh cancel_all_batch_jobs ${HOME}/RUNTESTS") ws(HOME) { if (fileExists('RUNTESTS/error.logs')) { + def error_logs = sh(script: "cat RUNTESTS/error.logs", returnStdout: true).trim() + try { + pullRequest.comment("Experiment ${Case} failed on ${Machine}\n\nError logs:\n\n${error_logs}") + } catch (Exception error) { + echo "Failed to comment on PR: ${error.getMessage()}" + } def fileContent = readFile 'RUNTESTS/error.logs' def lines = fileContent.readLines() for (line in lines) {