From: "Ludovic Courtès" <ludo@gnu.org>
To: zimoun <zimon.toutoune@gmail.com>
Cc: Guix Devel <guix-devel@gnu.org>
Subject: Re: Reproductibility, Data Services, guix weather
Date: Fri, 16 Oct 2020 12:17:40 +0200 [thread overview]
Message-ID: <87v9fa79vf.fsf@gnu.org> (raw)
In-Reply-To: <86mu0rt95k.fsf@gmail.com> (zimoun's message of "Mon, 12 Oct 2020 23:40:55 +0200")
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")
>
> \f
> (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’.
prev parent reply other threads:[~2020-10-16 10:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-12 21:40 Reproductibility, Data Services, guix weather zimoun
2020-10-13 19:41 ` Christopher Baines
2020-10-14 20:17 ` zimoun
2020-10-15 8:45 ` Christopher Baines
2020-10-15 9:18 ` zimoun
2020-10-16 10:17 ` Ludovic Courtès [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87v9fa79vf.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=guix-devel@gnu.org \
--cc=zimon.toutoune@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.