aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMathieu Othacehe <othacehe@gnu.org>2020-09-10 14:25:19 +0200
committerMathieu Othacehe <othacehe@gnu.org>2020-09-10 15:16:15 +0200
commitf5b0d39328567a20336945bf1e2ff93aff1a9973 (patch)
tree6c42597061c14826ecd2cdfdc90559be44a814bd /bin
parentaf12a80599346968fb9f52edb33b48dd26852788 (diff)
downloadcuirass-f5b0d39328567a20336945bf1e2ff93aff1a9973.tar
cuirass-f5b0d39328567a20336945bf1e2ff93aff1a9973.tar.gz
Add a status field to Evaluation table.
The Evaluation table currently has an 'in_progress' field. Distinction between succeeded and failed evaluations are based on the presence of Builds records for the evaluation. It it also not possible to distinguish aborted evaluations from failed evaluations. Rename 'in_progress' field to 'status'. The 'status' field can be equal to 'started', 'succeeded', 'failed' or 'aborted'. * src/cuirass/database.scm (evaluation-status): New exported enumeration. (db-set-evaluations-done, db-set-evaluation-done): Remove them. (db-abort-pending-evaluations, db-set-evaluation-status): New exported procedures. (db-add-evaluation, db-get-builds, db-get-evaluations, db-get-evaluations-build-summary, db-get-evaluation-summary): Adapt to use 'status' field instead of 'in_progress' field. * src/cuirass/templates.scm (evaluation-badges): Ditto. * src/schema.sql (Evaluations): Rename 'in_progress' field to 'status'. * src/sql/upgrade-10.sql: New file. * bin/cuirass.in (main): Use "db-abort-pending-evaluations" instead of "db-set-evaluations-done". * src/cuirass/base.scm (evaluate): Use "db-set-evaluation-status" instead of "db-set-evaluations-done". (build-packages): Use "db-set-evaluation-status" instead of "db-set-evaluation-done". * tests/database.scm (sqlite-exec): Adapt accordingly. * tests/http.scm (evaluations-query-result): Ditto.
Diffstat (limited to 'bin')
-rw-r--r--bin/cuirass.in15
1 files changed, 8 insertions, 7 deletions
diff --git a/bin/cuirass.in b/bin/cuirass.in
index b2721de..c4bcfaa 100644
--- a/bin/cuirass.in
+++ b/bin/cuirass.in
@@ -162,14 +162,15 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@"
(clear-build-queue)
- ;; If Cuirass was stopped during an evaluation, consider
- ;; it done. Builds that were not registered during this
- ;; evaluation will be registered during the next
- ;; evaluation.
- (db-set-evaluations-done)
+ ;; If Cuirass was stopped during an evaluation,
+ ;; abort it. Builds that were not registered
+ ;; during this evaluation will be registered
+ ;; during the next evaluation.
+ (db-abort-pending-evaluations)
- ;; First off, restart builds that had not completed or
- ;; were not even started on a previous run.
+ ;; First off, restart builds that had not
+ ;; completed or were not even started on a
+ ;; previous run.
(spawn-fiber
(essential-task
'restart-builds exit-channel