From 30665c65aaea29fa9afe3e42eb5341c7cae5e258 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 | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/pkgs/update-nixfiles/update-nixfiles.sh b/pkgs/update-nixfiles/update-nixfiles.sh index bac780a..02e6fbb 100644 --- a/pkgs/update-nixfiles/update-nixfiles.sh +++ b/pkgs/update-nixfiles/update-nixfiles.sh @@ -21,7 +21,6 @@ merge_theirs () { } test_build () { - local last_error local build_jobs build_jobs="$(curl --fail -s -L -H "Accept: application/json" "${JOBSET_URL}/latest-eval" | jq -r ".builds | .[]")" @@ -42,10 +41,16 @@ test_build () { echo "Build ${build} was successful" done - last_error="$(curl --fail -s -L -H "Accept: application/json" "${JOBSET_URL}" | jq -r ".errortime")" - [[ $last_error -gt $(date +%s) ]] && - echo "Evaluation error encountered at $(date +%Y-%m-%d-%H:%M:%S --date="@${last_error}")" && - exit 1 +# Idk why this is broken someone should fix me +# local last_error +# local now +# +# last_error="$(curl --fail -s -L -H "Accept: application/json" "${JOBSET_URL}" | jq -r ".errortime")" +# now="$(date +%s)" +# +# [[ $last_error -gt $now ]] && +# echo "Evaluation error encountered at $(date +%Y-%m-%d-%H:%M:%S --date="@${last_error}")" && +# exit 1 } wait_for_hydra () { @@ -54,15 +59,17 @@ wait_for_hydra () { local counter 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")" + while [[ $counter -lt 180 ]]; do + counter=$((counter +1)) + 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 fi - sleep 30 + sleep 5 done - if [[ $counter -ge 30 ]]; then + + if [[ $counter -ge 180 ]]; then echo "Hydra no workey" exit 1 fi