Subject: Re: bug#63462: [PATCH maintenance] hydra: build-package-metadata: Update fields in sources.json.

From: Ludovic Courtès <[email-masked]>
Date: Fri, 12 May 2023 13:47:40 +0200

Hi,

Simon Tournier <[email-masked]> skribis:

> This format had been discussed in
> <https://gitlab.softwareheritage.org/swh/infra/sysadm-environment/-/issues/4868>.
>
> * hydra/build-package-metadata.scm (origin->json)[resolve]: Add the fields
> 'outputHashAlgo' and 'outputHashMode'.

Neat, thanks for the update!  (I pushed it on your behalf because you’re
not currently authorized in maintenance.git; please email guix-sysadmin
if you’d like to be there.)

>                   `(("integrity" . ,(string-append algorithm-string "-"
> -                                                  (base64-encode hash-value)))))
> +                                                  (base64-encode hash-value)))
> +                   ("outputHashAlgo" . ,algorithm-string)
> +                   ("outputHashMode" . ,(if (or (eq? url-fetch method)
> +                                                (eq? url-fetch/tarbomb method)
> +                                                (eq? url-fetch/zipbomb method))
> +                                            "flat"
> +                                            "recursive"))))

I wish they had opted for something more expressive (and also with a
more meaningful name :-)) than ‘outputHashMode’, similar to what you did
for ‘guix hash -S’.  But anyway, it does the job!

It looks like SWH will be storing nar hashes; will there be endpoints to
query directories by nar hash?

Thanks,
Ludo’.