unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Christopher Baines <mail@cbaines.net>
To: Vivien Kraus <vivien@planete-kraus.eu>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH qa-frontpage WIP] Add a library to parse patchwork json data
Date: Mon, 25 Sep 2023 13:59:15 +0100	[thread overview]
Message-ID: <87h6ni4d4h.fsf@cbaines.net> (raw)
In-Reply-To: <96dbe856c24031965ed4087adab8507b797920dd.1695152179.git.vivien@planete-kraus.eu>

[-- Attachment #1: Type: text/plain, Size: 1791 bytes --]


Vivien Kraus <vivien@planete-kraus.eu> writes:

> Hi!
>
> Here is a small library that exports 3 types:
> − <patch-name-metadata> is the collection of metadata that is present
>   in the square brackets in the patch names;
> − <patch> is an individual item of the patch series;
> − <patch-series> is a whole series of patches;
>
> And a set of functions to parse and serialize these.
>
> A fun experiment is to run the following script:
>
> (use-modules (guix-qa-frontpage patchwork patch-series))
> (use-modules (rnrs bytevectors))
> (use-modules (web client))
> (use-modules (ice-9 receive))
> (use-modules (json))
>
> (define patchwork-data
>   (receive (r body)
>       (http-get "https://patches.guix-patches.cbaines.net/api/patches/?order=-id")
>     (json-string->scm (utf8->string body))))
>
> (define patchwork-series
>   (map scm->patch-series (vector->list patchwork-data)))
>
> (for-each
>  (lambda (correct-series)
>    (display correct-series)
>    (newline))
>  (map patch-series->scm patchwork-series))
>
> You will see that patchwork has quite a lot of creativity when it
> comes to breaking my expectations. I made sure to add as much
> information in exceptions so that we can understand what is happening.

This looks good, but would it be possible to adapt this to work with the
series endpoint [1], rather than the patches one?

1: https://patches.guix-patches.cbaines.net/api/series/?order=-id

I think the use of the patches endpoint currently is just because
previously the Patchwork checks information was used. Now that Patchwork
checks aren't used, I think the series endpoint can be used instead, and
this should map much more closely to the data structures you're trying
to construct.

Thanks,

Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 987 bytes --]

  reply	other threads:[~2023-09-25 13:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-17  5:42 [PATCH qa-frontpage] Apply incoming patches onto the correct feature branch Vivien Kraus
2023-09-19 14:33 ` Christopher Baines
2023-09-19 17:37   ` [PATCH qa-frontpage WIP] Add a library to parse patchwork json data Vivien Kraus
2023-09-25 12:59     ` Christopher Baines [this message]
2023-10-21 16:35   ` [PATCH qa-frontpage] Apply incoming patches onto the correct feature branch 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=87h6ni4d4h.fsf@cbaines.net \
    --to=mail@cbaines.net \
    --cc=guix-devel@gnu.org \
    --cc=vivien@planete-kraus.eu \
    /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).