diff options
author | Christopher Baines <mail@cbaines.net> | 2023-11-26 22:49:20 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2023-11-26 22:49:20 +0000 |
commit | 677c18e39874095a47940ace8bf9ad5f92094ffd (patch) | |
tree | 5d8f28419f3e75809e9365fb0b5f15b39bb5ca05 | |
parent | 3eb7ca766219c58ef5fa82fdf9f2d8dded91dcdd (diff) | |
download | qa-frontpage-677c18e39874095a47940ace8bf9ad5f92094ffd.tar qa-frontpage-677c18e39874095a47940ace8bf9ad5f92094ffd.tar.gz |
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.
-rw-r--r-- | guix-qa-frontpage/manage-builds.scm | 33 |
1 files 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")))) |