[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Ludovic Courtès |
Date: |
Thu, 1 Mar 2018 11:31:45 -0500 (EST) |
branch: master
commit f083282fd3bf813fda0b54ed33278d2d5325dfa1
Author: Ludovic Courtès <address@hidden>
Date: Thu Mar 1 15:50:40 2018 +0100
http: Return build completion time as #:timestamp when completed.
* src/cuirass/http.scm (build->hydra-build): Set #:timestamp to
#:stoptime when BUILD is finished.
---
src/cuirass/http.scm | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/src/cuirass/http.scm b/src/cuirass/http.scm
index 0548184..9a379da 100644
--- a/src/cuirass/http.scm
+++ b/src/cuirass/http.scm
@@ -35,11 +35,23 @@
(define (bool->int bool)
(if bool 1 0))
+ (define finished?
+ (bool->int
+ (not (memv (assq-ref build #:status)
+ (list (build-status scheduled)
+ (build-status started))))))
+
`((#:id . ,(assq-ref build #:id))
(#:project . ,(assq-ref build #:repo-name))
(#:jobset . ,(assq-ref build #:branch))
(#:job . ,(assq-ref build #:job-name))
- (#:timestamp . ,(assq-ref build #:timestamp))
+
+ ;; Hydra's API uses "timestamp" as the time of the last useful event for
+ ;; that build: evaluation or completion.
+ (#:timestamp . ,(if finished?
+ (assq-ref build #:stoptime)
+ (assq-ref build #:timestamp)))
+
(#:starttime . ,(assq-ref build #:starttime))
(#:stoptime . ,(assq-ref build #:stoptime))
(#:derivation . ,(assq-ref build #:derivation))
@@ -50,10 +62,7 @@
(#:busy . ,(bool->int (eqv? (build-status started)
(assq-ref build #:status))))
(#:priority . 0)
- (#:finished . ,(bool->int
- (not (memv (assq-ref build #:status)
- (list (build-status scheduled)
- (build-status started))))))
+ (#:finished . ,finished?)
(#:buildproducts . #nil)
(#:releasename . #nil)
(#:buildinputs_builds . #nil)))
- master updated (f5a15ca -> aa4c778), Ludovic Courtès, 2018/03/01
- [no subject], Ludovic Courtès, 2018/03/01
- [no subject], Ludovic Courtès, 2018/03/01
- [no subject], Ludovic Courtès, 2018/03/01
- [no subject], Ludovic Courtès, 2018/03/01
- [no subject],
Ludovic Courtès <=
- [no subject], Ludovic Courtès, 2018/03/01
- [no subject], Ludovic Courtès, 2018/03/01
- [no subject], Ludovic Courtès, 2018/03/01