Hi! Christopher Baines <m...@cbaines.net> skribis:
> Ludovic Courtès <l...@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’.