Include more information about invalid query parameters
In the /compare response. This should enable qa.guix.gnu.org to detect when the base revision for a comparison is unknown.
This commit is contained in:
parent
cc61bb5f13
commit
9fc5821180
1 changed files with 23 additions and 24 deletions
|
|
@ -254,6 +254,19 @@
|
|||
((application/json)
|
||||
(render-json
|
||||
`((error . "invalid query")
|
||||
(query_parameters
|
||||
. ,(map
|
||||
(match-lambda
|
||||
((key . val)
|
||||
(cons key
|
||||
(match val
|
||||
(($ <invalid-query-parameter> value message)
|
||||
`((invalid_value . ,value)
|
||||
(message . ,(call-with-output-string
|
||||
(lambda (port)
|
||||
(sxml->html message port))))))
|
||||
(val val)))))
|
||||
query-parameters))
|
||||
(base_job . ,base-job)
|
||||
(target_job . ,target-job))))
|
||||
(else
|
||||
|
|
@ -433,30 +446,16 @@
|
|||
(render-json
|
||||
'((error . "invalid query"))))
|
||||
(else
|
||||
(letpar& ((base-job
|
||||
(match (assq-ref query-parameters 'base_commit)
|
||||
(($ <invalid-query-parameter> value)
|
||||
(with-thread-postgresql-connection
|
||||
(lambda (conn)
|
||||
(select-job-for-commit conn value))))
|
||||
(_ #f)))
|
||||
(target-job
|
||||
(match (assq-ref query-parameters 'target_commit)
|
||||
(($ <invalid-query-parameter> value)
|
||||
(with-thread-postgresql-connection
|
||||
(lambda (conn)
|
||||
(select-job-for-commit conn value))))
|
||||
(_ #f))))
|
||||
(render-html
|
||||
#:sxml (compare query-parameters
|
||||
'datetime
|
||||
#f
|
||||
#f
|
||||
#f
|
||||
#f
|
||||
#f
|
||||
#f
|
||||
#f)))))
|
||||
(render-html
|
||||
#:sxml (compare query-parameters
|
||||
'datetime
|
||||
#f
|
||||
#f
|
||||
#f
|
||||
#f
|
||||
#f
|
||||
#f
|
||||
#f))))
|
||||
|
||||
(let ((base-branch (assq-ref query-parameters 'base_branch))
|
||||
(base-datetime (assq-ref query-parameters 'base_datetime))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue