guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reproductibility, Data Services, guix weather


From: Ludovic Courtès
Subject: Re: Reproductibility, Data Services, guix weather
Date: Fri, 16 Oct 2020 12:17:40 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Hi!

zimoun <zimon.toutoune@gmail.com> skribis:

> (define %prefix-url
>   "https://data.guix-patches.cbaines.net/revision";)
>
> (define %suffix-url
>   "output_consistency=not-matching&target=none&all_results=on")
>
> (define %json-name "package-derivation-outputs.json")
>
>
> (define* (json-url revision
>               #:optional
>               (system (%current-system))
>               (json %json-name))
>   "Return the URL corresponding to REVISION."
>   (string-append
>    %prefix-url "/" revision "/" json "?" %suffix-url"&system=" system))
>
> (define* (json-file revision
>                     #:optional
>                     (system (%current-system))
>                     (name %json-name)
>                     (tmp %temporary-directory))
>   "Path where the JSON is stored.
>
> By default in %TEMPORARY-DIRECTORY/REV-%JSON-NAME."
>   (let ((hash (substring revision 0 6)))
>     (string-append tmp "/" hash "-" name "-" system)))
>
> (define (fetch-json revision system)
>   "Fetch the JSON file from the Data Service corresponding to REVISION.
>
> Store the result in %TEMPORARY-DIRECTORY."
>   (let* ((out (json-file revision system))
>          (url (json-url revision system)))
>     (url-fetch url out)))

I think it’s a good idea.  My suggestion would be to do as for (guix
ci): make a (guix data-service-client) (?) module that contains proper
bindings to a subset of the Data Service APIs, using
‘define-json-mapping’.

Once we have that, we can consider using it in ‘guix weather’ or in new
tools such as the proposed ‘guix git log’.

Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]