From 677c18e39874095a47940ace8bf9ad5f92094ffd Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sun, 26 Nov 2023 22:49:20 +0000 Subject: Cancel and resubmit builds where the derivation has changed But the output remains the same. This will hopefully avoid some instances where the data service deletes the derivation as it corresponds to a removed revision and the build can't start because of the missing derivation. --- guix-qa-frontpage/manage-builds.scm | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/guix-qa-frontpage/manage-builds.scm b/guix-qa-frontpage/manage-builds.scm index e3a25cf..f5195eb 100644 --- a/guix-qa-frontpage/manage-builds.scm +++ b/guix-qa-frontpage/manage-builds.scm @@ -625,8 +625,14 @@ (loop (cdr changes) (if (vector-any (lambda (build) - (member (assoc-ref build "status") - '("scheduled" "started" "succeeded" "failed"))) + (let ((build-status + (assoc-ref build "status"))) + (if (string=? build-status "scheduled") + (not (assoc-ref + build + "build_for_equivalent_derivation")) + (member build-status + '("started" "succeeded" "failed"))))) (assoc-ref change "builds")) builds-to-submit-details ; build exists (cons @@ -636,12 +642,23 @@ (priority change))) builds-to-submit-details)) (fold (lambda (build result) - (if (member (assoc-ref build "status") - '("scheduled" "started")) - (set-insert - (assoc-ref build "build_server_build_id") - result) - result)) + (let ((build-status + (assoc-ref build "status"))) + (if (or (string=? build-status "started") + (and (string=? build-status "scheduled") + ;; Cancel and replace builds for + ;; equivalent derivations, since + ;; the derivation might be removed + ;; from the data service preventing + ;; the build from starting. + (not + (assoc-ref + build + "build_for_equivalent_derivation")))) + (set-insert + (assoc-ref build "build_server_build_id") + result) + result))) build-ids-to-keep-set (vector->list (assoc-ref change "builds")))) -- cgit v1.2.3