aboutsummaryrefslogtreecommitdiff
path: root/guix-qa-frontpage/view
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-06-16 22:55:00 +0100
committerChristopher Baines <mail@cbaines.net>2023-06-16 22:55:00 +0100
commit8a705dd48a7d867e9613b0c3bd794c9c4aad5183 (patch)
tree4e585d58dfaf5eeb26ea81c238dba7b2e4401f3a /guix-qa-frontpage/view
parentf8c2008da7107ef1f5e9b1d1f06391d84cdc9a7c (diff)
downloadqa-frontpage-8a705dd48a7d867e9613b0c3bd794c9c4aad5183.tar
qa-frontpage-8a705dd48a7d867e9613b0c3bd794c9c4aad5183.tar.gz
Improve error reporting on the issue page
This regressed when more data started to be cached, since the exceptions couldn't be stored in the db, but now some of the information makes it through.
Diffstat (limited to 'guix-qa-frontpage/view')
-rw-r--r--guix-qa-frontpage/view/issue.scm81
1 files changed, 54 insertions, 27 deletions
diff --git a/guix-qa-frontpage/view/issue.scm b/guix-qa-frontpage/view/issue.scm
index 47737be..09e6bb5 100644
--- a/guix-qa-frontpage/view/issue.scm
+++ b/guix-qa-frontpage/view/issue.scm
@@ -139,7 +139,7 @@ td.bad {
(th "Message")))
(tbody
,@(if (and comparison-details
- (not (guix-data-service-error? comparison-details)))
+ (not (assq-ref comparison-details 'exception)))
(if (eq? (vector-length (assoc-ref comparison-details "lint_warnings"))
0)
`((tr
@@ -181,19 +181,32 @@ td.bad {
(td (@ (colspan 3)
(class "bad"))
"Comparison unavailable"
- ,@(or (and=> (and (guix-data-service-error? comparison-details)
- (assoc-ref (guix-data-service-error-response-body
- comparison-details)
- "target_job"))
- (lambda (target-job)
- `((p
- "Yet to process "
- (a (@ (href ,(string-append
- "https://data.qa.guix.gnu.org/revision/"
- (assoc-ref target-job "commit"))))
- "revision")
- ", job "
- ,(assoc-ref target-job "state")))))
+ ,@(or (and=>
+ (assq-ref comparison-details 'exception)
+ (lambda (exception)
+ (and=>
+ (assq-ref comparison-details 'invalid_query_parameters)
+ (lambda (invalid-params)
+ (let ((target-commit
+ (assoc-ref invalid-params "target_commit")))
+ (cond
+ (target-commit
+ (let ((error (assq-ref target-commit 'error))
+ (value (assq-ref target-commit 'value)))
+ `((p
+ ,(cond
+ ((eq? error 'yet-to-process-revision)
+ "Yet to process ")
+ ((eq? error 'failed-to-process-revision)
+ "Failed to process ")
+ (else
+ "Unknown issue with "))
+ (a (@ (href ,(string-append
+ "https://data.qa.guix.gnu.org/revision/"
+ value)))
+ "revision")))))
+ (else
+ #f)))))))
'()))))))))
(div
@@ -325,19 +338,33 @@ td.bad {
(td (@ (colspan 10)
(class "bad"))
"Comparison unavailable"
- ,@(or (and=> (and (guix-data-service-error? comparison-details)
- (assoc-ref (guix-data-service-error-response-body
- comparison-details)
- "target_job"))
- (lambda (target-job)
- `((p
- "Yet to process "
- (a (@ (href ,(string-append
- "https://data.qa.guix.gnu.org/revision/"
- (assoc-ref target-job "commit"))))
- "revision")
- ", job "
- ,(assoc-ref target-job "state")))))
+
+ ,@(or (and=>
+ (assq-ref comparison-details 'exception)
+ (lambda (exception)
+ (and=>
+ (assq-ref comparison-details 'invalid_query_parameters)
+ (lambda (invalid-params)
+ (let ((target-commit
+ (assoc-ref invalid-params "target_commit")))
+ (cond
+ (target-commit
+ (let ((error (assq-ref target-commit 'error))
+ (value (assq-ref target-commit 'value)))
+ `((p
+ ,(cond
+ ((eq? error 'yet-to-process-revision)
+ "Yet to process ")
+ ((eq? error 'failed-to-process-revision)
+ "Failed to process ")
+ (else
+ "Unknown issue with "))
+ (a (@ (href ,(string-append
+ "https://data.qa.guix.gnu.org/revision/"
+ value)))
+ "revision")))))
+ (else
+ #f)))))))
'()))))))))
(div