unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Christopher Baines <mail@cbaines.net>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: Guix Data Service client module
Date: Sat, 05 Feb 2022 16:04:18 +0100	[thread overview]
Message-ID: <878rupgxsd.fsf@gnu.org> (raw)
In-Reply-To: <87zgn6gbst.fsf@cbaines.net> (Christopher Baines's message of "Fri, 04 Feb 2022 10:14:05 +0000")

Hi!

Christopher Baines <mail@cbaines.net> skribis:

> Ludovic Courtès <ludo@gnu.org> writes:
>
>> Hello Guix!
>>
>> Here’s a client module for the Guix Data Service, allowing you to access
>> a subset of the Guix Data Service interfaces from the comfort of your
>> REPL.

[...]

> I added some exports (included below) so that I could more easily use
> the module.
>
> Maybe open-data-service could have the url default to
> "https://data.guix.gnu.org".

Sure!

> The only thing I can see that's required before merging though is the
> exports. I'm now thinking about this kind of thing (getting data out of
> the data service) in the context of patch/branch review.

I think there’s a couple of issues that would be nice to address in the
JSON API of the data service.

First, it’s unversioned, which will make it hard to maintain things
going forward.  How about adding, say, “/v1” to URL paths, similar to
what SWH does?

Second, there are places where I found inconsistencies or redundancy in
the API.  For instance there are several JSON schemas for things called
“branches” (see the FIXME in there).

The API to access package version history, which I think lots of users
are interested in, is not intuitive IMO:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> (define s (open-data-service "https://data.guix.gnu.org"))
scheme@(guile-user)> (car (package-versions (lookup-package s "emacs")))
$20 = #<<package-version> string: "27.2" branches: (#<<branch> name: "master" repository-id: 1>)>
scheme@(guile-user)> (car (package-version-history s (car (package-version-branches $20)) "emacs"))
$21 = #<<package-version-range> version: "27.2" first-revision: #<<revision> commit: "cc33f50d0e2a7835e99913226cb4c4b0e9e961ae" date: #<date nanosecond: 0 second: 54 minute: 30 hour: 20 day: 25 month: 3 year: 2021 zone-offset: 0>> last-revision: #<<revision> commit: "de38ccf2e0bb2fd21393925c296b65dca7499bd3" date: #<date nanosecond: 0 second: 37 minute: 48 hour: 13 day: 4 month: 2 year: 2022 zone-offset: 0>>>
--8<---------------cut here---------------end--------------->8---

That said, I don’t have any suggestion on this one.

I also wonder if there’s a way to obtain a commit range for a given
package version, directly, without having to browse the list returned by
‘package-version-history’?

Thanks for taking a look!

Ludo’.


  reply	other threads:[~2022-02-05 15:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-27 21:23 Guix Data Service client module Ludovic Courtès
2022-02-04 10:14 ` Christopher Baines
2022-02-05 15:04   ` Ludovic Courtès [this message]
2022-02-15 18:10     ` Christopher Baines

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

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878rupgxsd.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=mail@cbaines.net \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).