From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id cPH/B76FEWUpBQEA9RJhRA:P1 (envelope-from ) for ; Mon, 25 Sep 2023 15:06:06 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id cPH/B76FEWUpBQEA9RJhRA (envelope-from ) for ; Mon, 25 Sep 2023 15:06:06 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B7B87DD00 for ; Mon, 25 Sep 2023 15:06:05 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1695647166; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=2E4EtrVlKPQFU+22Iw8w2wjmwMl7YfhKEb8hXoTh3g0=; b=HM/UFhlPK63LJRSYhcq0/lKzsBBCsi8qFEfuwsmpw8GkT3sAm5jz1Rz/7w1jaLUT2oqgbD CElsSPKzHZIMVJtkTI/6SdtLK9e6G+OcLb5+lcKplFxfdLhqoMhMS30VsU8/egOATb/Zqo T5Ljmqm+IcUR8JQlLZHlX+p8bqwJUOWwjeBz7PvP8BeQuYY2S1AyZZtKARuLpRvavdGlTO KmunQz+msOWbjwUNpV67bDHlaf2SqQcyetnyCd05P0mPoW6DPEiT6v9q3Pd/1Fn8BeE8Vx iB1uyPIef5h1Uw1sl+IXGGHFci1s+JmfMlkuhcB8NLeeOr8afzz7NVtMozuwbw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1695647166; a=rsa-sha256; cv=none; b=f1Cwt7zg+8BL3eN3jXoE/rogcJF38FHSRpflYO2auae1j3iYMaKk92kt0pNKLS8UvJlXhP gHpKzJjJckBy80RcLv9l3sq2YsK1Dm+oQ6GGCsca/bOy+A3ERJ1xmPTET+cvokdpbPck2k +ujdq+n8WuuujBJdFxotjUXwWTHmMw1vkorzKqvK6/V3pC5Th+x5HlAPbxKRRnEuzcHOdz 5JLo5/2012PKytqrDtiQvVUobyNCbAHlJqhV22B26abLRK4BHNRm/ZEpKy+gr9IW9myjhD 5ANN8iP/pjYAojd/m1B3xL90cjJzOYZM4FLkuPtExnzgZHUOxB/kxH4zGJ2b6A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=none Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qklHD-0001FL-Lx; Mon, 25 Sep 2023 09:05:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qklHB-0001ET-Cc for guix-devel@gnu.org; Mon, 25 Sep 2023 09:05:25 -0400 Received: from mira.cbaines.net ([212.71.252.8]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qklH8-0004E5-I4 for guix-devel@gnu.org; Mon, 25 Sep 2023 09:05:25 -0400 Received: from localhost (unknown [217.155.61.229]) by mira.cbaines.net (Postfix) with ESMTPSA id 243CB27BBE2; Mon, 25 Sep 2023 14:05:21 +0100 (BST) Received: from felis (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id d89c567f; Mon, 25 Sep 2023 13:05:20 +0000 (UTC) References: <87cyyew4g8.fsf@cbaines.net> <96dbe856c24031965ed4087adab8507b797920dd.1695152179.git.vivien@planete-kraus.eu> User-agent: mu4e 1.10.5; emacs 28.2 From: Christopher Baines To: Vivien Kraus 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 In-reply-to: <96dbe856c24031965ed4087adab8507b797920dd.1695152179.git.vivien@planete-kraus.eu> Message-ID: <87h6ni4d4h.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=212.71.252.8; envelope-from=mail@cbaines.net; helo=mira.cbaines.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx0.migadu.com X-Migadu-Spam-Score: -6.84 X-Spam-Score: -6.84 X-Migadu-Queue-Id: B7B87DD00 X-TUID: 2Ex4npdrlq4n --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Vivien Kraus writes: > Hi! > > Here is a small library that exports 3 types: > =E2=88=92 is the collection of metadata that is pre= sent > in the square brackets in the patch names; > =E2=88=92 is an individual item of the patch series; > =E2=88=92 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/?or= der=3D-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=3D-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 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmURhY5fFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9Xd48Q//XNggbRaL8qFz02fT80ZTzV5o8DTXRXcp FFasuDeRu7CKPdE18c59iBi38JORxz2q7Limk+8u2aUc/NNtAAoJn/r4it3/ukfo 4gZkE3I9dgt+5+D3ctj0frzMC6OdPJxKecI3c7bilfit0sv5fbQriQK58z7bpQc9 36pasmI3PDb8i9re/m9RbMN2si194ZBFwIbZaGHvX+NJJg/8ZakmlD0CLbT+rj+b +G5ykmVaTad7V086N12CJDGHhpgJB1Jimdaze5PEC23Gs4wyIBpqBupOjqISv6ig sWwYFauh0E9YWqznwtHHrt9m/yWjd8u53628yKugxUzaBVtcFGcSCnzMJ6E1WhzO KmvN47/99N01FTfGYCy8vwQXXyN8FXIge1mRfa4pNTW9AAhZZgT2aoFnPq4gEqSK uFhdVg6HDCpcjIRCo0SvnUU+y/Oz+d33fYH9JhEr6Uc1r4sFtWRYWFD45WigbejH tfOn64gRtYdBjM6WF2xf6c7D0PhUiCJNYTuD0shmM+vZ9BHilr9+O78b/jeujRY5 CewwWNdU9wVaqiE9dmEOdDvseeEpBJvHFA8ETkjNwHkVDydsWzkQCh0D3TrbtFEm EGf64yeHKNezQxo4HYaF68tUTjckaiH7Hcz1eiYeg7rbf5vthDBHdbfSbqSbqlg7 pdIhh+Ii1ik= =VVD0 -----END PGP SIGNATURE----- --=-=-=--