aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service/web/controller.scm
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-08-06 09:55:03 +0100
committerChristopher Baines <mail@cbaines.net>2019-08-06 09:55:03 +0100
commit36a16d356f526bcc3425147ffc6a36df1c1a1782 (patch)
tree3323f1d08475dab79dedab2a25abeee197202bde /guix-data-service/web/controller.scm
parent82c3e8942bc24adf1658dfcd058e07f4f5a1d67d (diff)
downloaddata-service-36a16d356f526bcc3425147ffc6a36df1c1a1782.tar
data-service-36a16d356f526bcc3425147ffc6a36df1c1a1782.tar.gz
Improve derivation comparison to show more changes
In cases where the version is changed for example, the relevant derivations will now show up, whereas previously they did not.
Diffstat (limited to 'guix-data-service/web/controller.scm')
-rw-r--r--guix-data-service/web/controller.scm53
1 files changed, 29 insertions, 24 deletions
diff --git a/guix-data-service/web/controller.scm b/guix-data-service/web/controller.scm
index e55ebae..8c4530f 100644
--- a/guix-data-service/web/controller.scm
+++ b/guix-data-service/web/controller.scm
@@ -429,30 +429,35 @@
(systems (assq-ref query-parameters 'system))
(targets (assq-ref query-parameters 'target))
(build-statuses (assq-ref query-parameters 'build_status)))
- (let-values
- (((base-packages-vhash target-packages-vhash)
- (package-data->package-data-vhashes
- (package-differences-data conn
- (commit->revision-id conn base-commit)
- (commit->revision-id conn target-commit)))))
- (let ((derivation-changes
- (package-data-derivation-changes base-packages-vhash
- target-packages-vhash)))
- (case (most-appropriate-mime-type
- '(application/json text/html)
- mime-types)
- ((application/json)
- (render-json
- derivation-changes
- #:extra-headers http-headers-for-unchanging-content))
- (else
- (render-html
- #:sxml (compare/derivations
- query-parameters
- (valid-systems conn)
- build-status-strings
- derivation-changes)
- #:extra-headers http-headers-for-unchanging-content))))))))
+ (let*
+ ((data
+ (package-differences-data conn
+ (commit->revision-id conn base-commit)
+ (commit->revision-id conn target-commit)))
+ (names-and-versions
+ (package-data->names-and-versions data)))
+ (let-values
+ (((base-packages-vhash target-packages-vhash)
+ (package-data->package-data-vhashes data)))
+ (let ((derivation-changes
+ (package-data-derivation-changes names-and-versions
+ base-packages-vhash
+ target-packages-vhash)))
+ (case (most-appropriate-mime-type
+ '(application/json text/html)
+ mime-types)
+ ((application/json)
+ (render-json
+ derivation-changes
+ #:extra-headers http-headers-for-unchanging-content))
+ (else
+ (render-html
+ #:sxml (compare/derivations
+ query-parameters
+ (valid-systems conn)
+ build-status-strings
+ derivation-changes)
+ #:extra-headers http-headers-for-unchanging-content)))))))))
(define (render-compare/packages mime-types
conn