[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Ludovic Courtès |
Date: |
Sat, 18 Nov 2023 13:12:03 -0500 (EST) |
branch: master
commit 1c2e4f0f70f22d0e1385709d5ddf5cb348eafe38
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sat Nov 18 19:01:25 2023 +0100
database: Allow filtering out new failures.
* src/cuirass/database.scm (db-get-builds): Add support for
‘new-failure’.
(db-get-builds-min, db-get-builds-max): Add support for ‘newly-failed’.
---
src/cuirass/database.scm | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index 2b40afb..106533f 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -1449,7 +1449,11 @@ CASE WHEN CAST(:borderlowid AS integer) IS NULL THEN
. ,(match (assq-ref filters 'weather)
(#f #f)
('all "Builds.weather >= 0")
- ('new "(Builds.weather = 0 OR Builds.weather = 1)")))
+ ('new "(Builds.weather = 0 OR Builds.weather = 1)")
+ ('new-failure
+ (string-append
+ "Builds.weather = "
+ (number->string (build-weather new-failure))))))
(border-low-time
. "(((:borderlowtime, :borderlowid) < (Builds.stoptime, Builds.id))
OR :borderlowtime IS NULL OR :borderlowid IS NULL)")
@@ -1995,6 +1999,8 @@ WHERE evaluation = " eval " AND
((" status " = 'pending' AND Builds.status < 0) OR
(" status " = 'succeeded' AND Builds.status = 0) OR
(" status " = 'failed' AND Builds.status > 0) OR
+ (" status " = 'newly-failed' AND Builds.status = " (build-status failed) "
+ AND Builds.weather = " (build-weather new-failure) ") OR
" status "::text IS NULL)
ORDER BY stoptime ASC, id ASC
LIMIT 1"))
@@ -2012,6 +2018,8 @@ WHERE evaluation = " eval " AND
((" status " = 'pending' AND Builds.status < 0) OR
(" status " = 'succeeded' AND Builds.status = 0) OR
(" status " = 'failed' AND Builds.status > 0) OR
+ (" status " = 'newly-failed' AND Builds.status = " (build-status failed) "
+ AND Builds.weather = " (build-weather new-failure) ") OR
" status "::text IS NULL)
ORDER BY stoptime DESC, id DESC
LIMIT 1"))