guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/05: Guard against some changes in how guile-json represents null valu


From: Christopher Baines
Subject: 01/05: Guard against some changes in how guile-json represents null values
Date: Fri, 19 Jun 2020 12:00:49 -0400 (EDT)

cbaines pushed a commit to branch master
in repository data-service.

commit 308e553b11792bc2c06320ac970a06eb2e8a3447
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Fri Jun 19 14:12:24 2020 +0100

    Guard against some changes in how guile-json represents null values
---
 guix-data-service/model/channel-instance.scm | 2 +-
 guix-data-service/model/derivation.scm       | 2 +-
 guix-data-service/model/package.scm          | 6 ++----
 guix-data-service/model/system-test.scm      | 2 +-
 4 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/guix-data-service/model/channel-instance.scm 
b/guix-data-service/model/channel-instance.scm
index 50ee864..1985cd3 100644
--- a/guix-data-service/model/channel-instance.scm
+++ b/guix-data-service/model/channel-instance.scm
@@ -94,7 +94,7 @@ ORDER BY channel_instances.system DESC")
       (list system
             derivation_file_name
             (filter (lambda (build)
-                      (assoc-ref build "status"))
+                      (string? (assoc-ref build "status")))
                     (vector->list
                      (json-string->scm builds-json))))))
    (exec-query conn query (list commit-hash))))
diff --git a/guix-data-service/model/derivation.scm 
b/guix-data-service/model/derivation.scm
index a19b336..9687ede 100644
--- a/guix-data-service/model/derivation.scm
+++ b/guix-data-service/model/derivation.scm
@@ -179,7 +179,7 @@ ORDER BY derivations.system DESC,
                 target
                 file-name
                 (filter (lambda (build)
-                          (assoc-ref build "status"))
+                          (string? (assoc-ref build "status")))
                         (vector->list
                          (json-string->scm builds-json)))))
          ((file_name system target)
diff --git a/guix-data-service/model/package.scm 
b/guix-data-service/model/package.scm
index 0f68539..01ba65a 100644
--- a/guix-data-service/model/package.scm
+++ b/guix-data-service/model/package.scm
@@ -346,8 +346,7 @@ ORDER BY first_datetime DESC, package_version DESC")
                 (if (string-null? builds-json)
                     '()
                     (filter (lambda (build)
-                              (not (eq?  (assoc-ref build "build_server_id")
-                                         #nil)))
+                              (number? (assoc-ref build "build_server_id")))
                             (vector->list
                              (json-string->scm builds-json)))))))
        (exec-query
@@ -462,8 +461,7 @@ ORDER BY first_datetime DESC, package_version DESC")
                 (if (string-null? builds-json)
                     '()
                     (filter (lambda (build)
-                              (not (eq?  (assoc-ref build "build_server_id")
-                                         #nil)))
+                              (number? (assoc-ref build "build_server_id")))
                             (vector->list
                              (json-string->scm builds-json)))))))
        (exec-query
diff --git a/guix-data-service/model/system-test.scm 
b/guix-data-service/model/system-test.scm
index 665eff2..7ac55e8 100644
--- a/guix-data-service/model/system-test.scm
+++ b/guix-data-service/model/system-test.scm
@@ -136,7 +136,7 @@ ORDER BY name ASC")
             (string->number column_number)
             derivation_file_name
             (filter (lambda (build)
-                      (assoc-ref build "status"))
+                      (string? (assoc-ref build "status")))
                     (vector->list
                      (json-string->scm builds-json))))))
    (exec-query conn query (list system commit-hash))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]