summaryrefslogtreecommitdiff
path: root/src/cuirass/database.scm
diff options
context:
space:
mode:
authorClément Lassieur <clement@lassieur.org>2018-07-02 17:25:31 +0200
committerClément Lassieur <clement@lassieur.org>2018-07-14 21:35:14 +0200
commitbe713f8a30788861806a74865b07403aa6774117 (patch)
tree41a687a50f29b5bd4eca36906fb8daf14d8b440c /src/cuirass/database.scm
parent03c4095f0a1a614af3b1e1cd63270d28d98b39a3 (diff)
downloadcuirass-be713f8a30788861806a74865b07403aa6774117.tar
cuirass-be713f8a30788861806a74865b07403aa6774117.tar.gz
database: Call a specification 'jobset' instead of 'project'.
This removes the possibility to filter specifications by branch, because branches were previously called 'jobset'. But it doesn't matter because later on, specifications will have as many branches as inputs. And people should filter by specification name instead. * doc/cuirass.texi (Build Information, Latest builds): Remove 'jobset', replace 'project' with 'jobset'. * src/cuirass/http.scm (build->hydra-build): Idem. * tests/database.scm (db-get-builds): Idem. * tests/http.scm (build-query-result, /api/latestbuilds?nr=1&jobset=guix, /api/latestbuilds?nr=1&jobset=gnu): Idem. * src/cuirass/database.scm (db-format-build, db-get-builds): Don't associate builds with branches (which were called 'jobset' afterwards). (db-get-builds): Remove the #:project filter.
Diffstat (limited to 'src/cuirass/database.scm')
-rw-r--r--src/cuirass/database.scm20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index 0dcae30..3627d2e 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -404,7 +404,7 @@ log file for DRV."
(define (db-format-build db build)
(match build
(#(id timestamp starttime stoptime log status derivation job-name system
- nix-name repo-name branch)
+ nix-name repo-name)
`((#:id . ,id)
(#:timestamp . ,timestamp)
(#:starttime . ,starttime)
@@ -416,13 +416,12 @@ log file for DRV."
(#:system . ,system)
(#:nix-name . ,nix-name)
(#:repo-name . ,repo-name)
- (#:outputs . ,(db-get-outputs db id))
- (#:branch . ,branch)))))
+ (#:outputs . ,(db-get-outputs db id))))))
(define (db-get-builds db filters)
"Retrieve all builds in database DB which are matched by given FILTERS.
-FILTERS is an assoc list which possible keys are 'project | 'jobset | 'job |
-'system | 'nr | 'order | 'status."
+FILTERS is an assoc list which possible keys are 'jobset | 'job | 'system |
+'nr | 'order | 'status."
;; XXX Change caller and remove
(define (assqx-ref filters key)
@@ -466,7 +465,7 @@ Assumes that if group id stays the same the group headers stay the same."
(define (finish-group)
(match repeated-row
(#(timestamp starttime stoptime log status derivation job-name system
- nix-name repo-name branch)
+ nix-name repo-name)
`((#:id . ,repeated-builds-id)
(#:timestamp . ,timestamp)
(#:starttime . ,starttime)
@@ -478,8 +477,7 @@ Assumes that if group id stays the same the group headers stay the same."
(#:system . ,system)
(#:nix-name . ,nix-name)
(#:repo-name . ,repo-name)
- (#:outputs . ,outputs)
- (#:branch . ,branch)))))
+ (#:outputs . ,outputs)))))
(define (same-group? builds-id)
(= builds-id repeated-builds-id))
@@ -519,22 +517,20 @@ Assumes that if group id stays the same the group headers stay the same."
(stmt-text (format #f "\
SELECT Builds.id, Outputs.name, Outputs.path, Builds.timestamp, Builds.starttime, Builds.stoptime, Builds.log, Builds.status, Builds.derivation,\
Derivations.job_name, Derivations.system, Derivations.nix_name,\
-Specifications.repo_name, Specifications.branch \
+Specifications.repo_name \
FROM Builds \
INNER JOIN Derivations ON Builds.derivation = Derivations.derivation AND Builds.evaluation = Derivations.evaluation \
INNER JOIN Evaluations ON Derivations.evaluation = Evaluations.id \
INNER JOIN Specifications ON Evaluations.specification = Specifications.repo_name \
LEFT JOIN Outputs ON Outputs.build = Builds.id \
WHERE (:id IS NULL OR (:id = Builds.id)) \
-AND (:project IS NULL OR (:project = Specifications.repo_name)) \
-AND (:jobset IS NULL OR (:jobset = Specifications.branch)) \
+AND (:jobset IS NULL OR (:jobset = Specifications.repo_name)) \
AND (:job IS NULL OR (:job = Derivations.job_name)) \
AND (:system IS NULL OR (:system = Derivations.system)) \
AND (:status IS NULL OR (:status = 'done' AND Builds.status >= 0) OR (:status = 'pending' AND Builds.status < 0)) \
ORDER BY ~a, Builds.id ASC LIMIT :nr;" order))
(stmt (sqlite-prepare db stmt-text #:cache? #t)))
(sqlite-bind-arguments stmt #:id (assqx-ref filters 'id)
- #:project (assqx-ref filters 'project)
#:jobset (assqx-ref filters 'jobset)
#:job (assqx-ref filters 'job)
#:system (assqx-ref filters 'system)