From af2032baf3de357f605981ed608c6f9d6b3c761f Mon Sep 17 00:00:00 2001 From: Sergio Date: Thu, 26 Sep 2024 16:39:27 +0200 Subject: [PATCH 1/3] Report PR start time too --- ci/build-loop.sh | 9 ++++++--- report-pr-errors | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ci/build-loop.sh b/ci/build-loop.sh index 6b6914f3..f0e16655 100755 --- a/ci/build-loop.sh +++ b/ci/build-loop.sh @@ -9,7 +9,10 @@ . build-helpers.sh get_config -ensure_vars CI_NAME CHECK_NAME PR_REPO PR_BRANCH PACKAGE ALIBUILD_DEFAULTS +PR_START_TIME=$(TZ=Europe/Zurich date +'%Y-%m-%d, %a %H:%M CET') +echo "Started $PR_REPO@$PR_HASH at $PR_START_TIME on $host_id" + +ensure_vars CI_NAME CHECK_NAME PR_REPO PR_BRANCH PACKAGE ALIBUILD_DEFAULTS PR_START_TIME : "${WORKERS_POOL_SIZE:=1}" "${WORKER_INDEX:=0}" "${PR_REPO_CHECKOUT:=$(basename "$PR_REPO")}" @@ -47,12 +50,12 @@ case "$BUILD_TYPE" in # Create a status on GitHub showing the build start time, but only if this is # the first build of this check! # If we are running in Nomad, add a link to the this allocation. - untested) report_pr_errors --pending -m "Started $(TZ=Europe/Zurich date +'%a %H:%M CET') on $host_id" \ + untested) report_pr_errors --pending -m "Started $PR_START_TIME on $host_id" \ ${NOMAD_ALLOC_ID:+--log-url "https://alinomad.cern.ch/ui/allocations/$NOMAD_ALLOC_ID"} ;; # Rebuilds only change the existing status's message, keeping the red status # and URL intact. failed) set-github-status -k -c "$PR_REPO@$PR_HASH" -s "$CHECK_NAME/$(build_type_to_status "$BUILD_TYPE")" \ - -m "Rechecking since $(TZ=Europe/Zurich date +'%a %H:%M CET') on $host_id" ;; + -m "Rechecking since $PR_START_TIME on $host_id" ;; # See above for why we don't update the status for green checks. succeeded) ;; esac diff --git a/report-pr-errors b/report-pr-errors index 37538105..eb6e37fa 100755 --- a/report-pr-errors +++ b/report-pr-errors @@ -372,6 +372,7 @@ class Logs(object): self.fst_task_timeout or self.fst_failed_command), 'hostname': htmlescape(platform.node()), + 'pr_start_time': os.getenv('PR_START_TIME', ''), 'finish_time': datetime.datetime.now().strftime('%a %-d %b %Y, %H:%M:%S %Z'), 'repo': self.pr_built.repo_name, 'pr_id': self.pr_built.id, @@ -588,6 +589,7 @@ PRETTY_LOG_TEMPLATE = '''\

The build %(status)s

+ From 09636e599ce4c1d560f3ae959118b5f72f22306e Mon Sep 17 00:00:00 2001 From: Sergio Date: Tue, 12 Nov 2024 15:04:54 +0100 Subject: [PATCH 2/3] Make log easier to grep --- ci/build-loop.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build-loop.sh b/ci/build-loop.sh index f0e16655..0af1f14b 100755 --- a/ci/build-loop.sh +++ b/ci/build-loop.sh @@ -10,7 +10,7 @@ get_config PR_START_TIME=$(TZ=Europe/Zurich date +'%Y-%m-%d, %a %H:%M CET') -echo "Started $PR_REPO@$PR_HASH at $PR_START_TIME on $host_id" +echo "$PR_START_TIME: Started building check $CHECK_NAME for $PR_REPO@$PR_HASH on $host_id" ensure_vars CI_NAME CHECK_NAME PR_REPO PR_BRANCH PACKAGE ALIBUILD_DEFAULTS PR_START_TIME From 81f0bf57f1c8993d0d2f500aca7487c4308d429e Mon Sep 17 00:00:00 2001 From: Sergio Date: Tue, 12 Nov 2024 16:09:48 +0100 Subject: [PATCH 3/3] Make the message shorter --- ci/build-loop.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build-loop.sh b/ci/build-loop.sh index 0af1f14b..5d01270a 100755 --- a/ci/build-loop.sh +++ b/ci/build-loop.sh @@ -9,7 +9,7 @@ . build-helpers.sh get_config -PR_START_TIME=$(TZ=Europe/Zurich date +'%Y-%m-%d, %a %H:%M CET') +PR_START_TIME=$(TZ=Europe/Zurich date +'%a %H:%M CET') echo "$PR_START_TIME: Started building check $CHECK_NAME for $PR_REPO@$PR_HASH on $host_id" ensure_vars CI_NAME CHECK_NAME PR_REPO PR_BRANCH PACKAGE ALIBUILD_DEFAULTS PR_START_TIME
Build host%(hostname)s
Started at%(pr_start_time)s
Finished at%(finish_time)s
Built PR %(repo)s#%(pr_id)s