From 4d4a85f4e8eeb17a7669f8a7ff6691e3a03c0779 Mon Sep 17 00:00:00 2001 From: Sergio Garcia <47090312+singiamtel@users.noreply.github.com> Date: Thu, 14 Nov 2024 10:20:37 +0100 Subject: [PATCH] Report PR start time too (#1407) --- 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..5d01270a 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 +'%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 : "${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 c356ffb8..677af25c 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

+
Build host%(hostname)s
Started at%(pr_start_time)s
Finished at%(finish_time)s
Built PR %(repo)s#%(pr_id)s