From 83b4cc0051b643dd6087f17bbe5b909fe2a0ce4c Mon Sep 17 00:00:00 2001 From: emily Date: Sun, 10 Nov 2024 22:56:53 +0100 Subject: [PATCH] update-nixfiles: fix eval check --- pkgs/update-nixfiles/update-nixfiles.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/update-nixfiles/update-nixfiles.sh b/pkgs/update-nixfiles/update-nixfiles.sh index bac780a..6126d15 100644 --- a/pkgs/update-nixfiles/update-nixfiles.sh +++ b/pkgs/update-nixfiles/update-nixfiles.sh @@ -23,6 +23,7 @@ merge_theirs () { test_build () { local last_error local build_jobs + local now build_jobs="$(curl --fail -s -L -H "Accept: application/json" "${JOBSET_URL}/latest-eval" | jq -r ".builds | .[]")" for build in ${build_jobs}; do @@ -42,8 +43,9 @@ test_build () { echo "Build ${build} was successful" done + now="$(date +%s)" last_error="$(curl --fail -s -L -H "Accept: application/json" "${JOBSET_URL}" | jq -r ".errortime")" - [[ $last_error -gt $(date +%s) ]] && + [[ $last_error -gt $now ]] && echo "Evaluation error encountered at $(date +%Y-%m-%d-%H:%M:%S --date="@${last_error}")" && exit 1 } @@ -55,7 +57,7 @@ wait_for_hydra () { counter=0 git_rev="$(git -C "${1}/nixfiles" rev-parse update-inputs)" while true; do - hydra_rev="$(curl -s -L -H "Accept: application/json" "${2}/latest-eval" | jq -r .flake | sed -E "s/.+&rev=(.*)/\1/g")" + hydra_rev="$(curl -s -L -H "Accept: application/json" "${2}/evals" | jq -r '.evals | max_by(.id) | .flake' | sed -E "s/.+&rev=(.*)/\1/g")" if [[ "${git_rev}" == "${hydra_rev}" ]]; then echo "Hydra got new commit" break