[cuirass] /search/latest/archive fails

  • Done
  • quality assurance status badge
Details
One participant
  • Ricardo Wurmus
Owner
unassigned
Submitted by
Ricardo Wurmus
Severity
normal
R
R
Ricardo Wurmus wrote on 7 Oct 2023 11:20
(address . bug-guix@gnu.org)
87cyxqokew.fsf@elephly.net
Hi,

I noticed that queries like this now consistently fail:


This should redirect to a download URL.

I went through the code and found that the problem lies in the return
value of HANDLE-BUILDS-SEARCH-REQUEST, which does not include the ID
field for BUILDPRODUCTS:

Toggle snippet (30 lines)
scheme@(guile-user)> ,use (cuirass database)
scheme@(guile-user)> ,m (cuirass http)
scheme@(cuirass http)> (define query (uri-decode "spec%3Atarball+status%3Asuccess+system%3Ax86_64-linux+guix-binary.tar.xz"))
scheme@(cuirass http)> (vector->list
(handle-builds-search-request
`((query . ,query)
(nr . 1)
(order . finish-time+build-id))))
2023-10-07T11:15:58 builds search request took 0.256186 seconds
$1 = (((id . 2190078) (evaluation . "827027") (jobset . "tarball") (job . "binary-tarball.x86_64-linux") (timestamp . 1696611284) (starttime . 1696611211) (stoptime . 1696611284) (derivation . "/gnu/store/icam3qbpkjhsgrglx4wsy53bsrznqvs3-guix-binary.tar.xz.drv") (buildoutputs ("out" ("path" . "/gnu/store/0yb96ks4fa6781817ala5w706f945zq4-guix-binary.tar.xz"))) (system . "x86_64-linux") (nixname . "guix-binary.tar.xz") (buildstatus . 0) (weather . -1) (busy . 0) (priority . 9) (finished . 1) (buildproducts . #(((type . "archive") (path . "/gnu/store/0yb96ks4fa6781817ala5w706f945zq4-guix-binary.tar.xz") (file-size . 108105168))))))
scheme@(cuirass http)> (define build (car $1)
)
scheme@(cuirass http)>
(assoc-ref build 'id)
$2 = 2190078
scheme@(cuirass http)> (define products (vector->list
(assoc-ref build 'buildproducts)))
scheme@(cuirass http)> products
$3 = (((type . "archive") (path . "/gnu/store/0yb96ks4fa6781817ala5w706f945zq4-guix-binary.tar.xz") (file-size . 108105168)))
scheme@(cuirass http)> (define product-type "archive")
scheme@(cuirass http)> (find (lambda (product)
(string=? (assoc-ref product 'type)
product-type))
products)
$4 = ((type . "archive") (path . "/gnu/store/0yb96ks4fa6781817ala5w706f945zq4-guix-binary.tar.xz") (file-size . 108105168))
scheme@(cuirass http)> (define product $4)
scheme@(cuirass http)> (assoc-ref product 'id)
$5 = #f

Without the ID of the build product cuirass cannot build the download
URL.

--
Ricardo
R
R
Ricardo Wurmus wrote on 7 Oct 2023 12:51
(address . 66384@debbugs.gnu.org)
878r8eog8u.fsf@elephly.net
This is a consequence of commit
9b227abd29b15e7e25c54a71c524e7b26252a270, and it should be enough to fix
it like this:

Toggle snippet (17 lines)
diff --git a/src/cuirass/http.scm b/src/cuirass/http.scm
index 7e4fd3b..9c4c723 100644
--- a/src/cuirass/http.scm
+++ b/src/cuirass/http.scm
@@ -133,7 +133,8 @@
(finished . ,(bool->int finished?))
(buildproducts . ,(list->vector
(map (lambda (product)
- `((type . ,(build-product-type product))
+ `((id . ,(build-product-id product))
+ (type . ,(build-product-type product))
(path . ,(build-product-file product))
(file-size . ,(build-product-file-size product))))
(build-products build))))))


--
Ricardo
R
R
Ricardo Wurmus wrote on 9 Oct 2023 21:33
(address . 66384-done@debbugs.gnu.org)
87v8bfmvyy.fsf@elephly.net
Ricardo Wurmus <rekado@elephly.net> writes:

Toggle quote (19 lines)
> This is a consequence of commit
> 9b227abd29b15e7e25c54a71c524e7b26252a270, and it should be enough to fix
> it like this:
>
> diff --git a/src/cuirass/http.scm b/src/cuirass/http.scm
> index 7e4fd3b..9c4c723 100644
> --- a/src/cuirass/http.scm
> +++ b/src/cuirass/http.scm
> @@ -133,7 +133,8 @@
> (finished . ,(bool->int finished?))
> (buildproducts . ,(list->vector
> (map (lambda (product)
> - `((type . ,(build-product-type product))
> + `((id . ,(build-product-id product))
> + (type . ,(build-product-type product))
> (path . ,(build-product-file product))
> (file-size . ,(build-product-file-size product))))
> (build-products build))))))

Fixed with commit 72a1fc58d5fe7c2b5fce04dc07fe9eaaba0f8be3.

--
Ricardo
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 66384@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 66384
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch