From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 16 17:19:59 2022 Received: (at 53060) by debbugs.gnu.org; 16 Jan 2022 22:20:00 +0000 Received: from localhost ([127.0.0.1]:44388 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9DsV-0002TD-Ls for submit@debbugs.gnu.org; Sun, 16 Jan 2022 17:19:59 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:56778) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9DsS-0002Sv-W2 for 53060@debbugs.gnu.org; Sun, 16 Jan 2022 17:19:58 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 255E8195; Sun, 16 Jan 2022 23:19:50 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zKMnKh3pdDcK; Sun, 16 Jan 2022 23:19:49 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 0ADC618A; Sun, 16 Jan 2022 23:19:48 +0100 (CET) From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxime Devos Subject: Re: bug#53060: [PATCH 0/2] Allow the github updater to update git sources References: <538acb9dc52f6992a5a65846db48f8b7382fb1be.camel@telenet.be> Date: Sun, 16 Jan 2022 23:19:48 +0100 In-Reply-To: <538acb9dc52f6992a5a65846db48f8b7382fb1be.camel@telenet.be> (Maxime Devos's message of "Thu, 06 Jan 2022 21:48:15 +0100") Message-ID: <87wnizz5kr.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: / Authentication-Results: hera.aquilenet.fr; none X-Rspamd-Server: hera X-Rspamd-Queue-Id: 255E8195 X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DBL_PROHIBIT(0.00)[0.9.0.0:email]; RCPT_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 53060 Cc: 53060@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hi, Maxime Devos skribis: > Follow-up to=C2=A0. > > To test, you can do > > $ make check > $ ./pre-inst-env guix refresh -t github -u zig > > and verify that the version and sha256/base32 has been updated > (zig@0.9.0 doesn't work though; patches aren't applying cleanly). Nice, applied! One comment: > +(define (call-with-releases thunk tags releases) > + (mock ((guix http-client) http-fetch > + (lambda* (uri #:key headers) > + (unless (string-prefix? "mock://" uri) > + (error "the URI ~a should not be used" uri)) > + (define components > + (string-split (substring uri 8) #\/)) > + (pk 'stuff components headers) > + (define (scm->json-port scm) > + (open-input-string (scm->json-string scm))) > + (match components > + (("repos" "foo" "foomatics" "releases") > + (scm->json-port releases)) > + (("repos" "foo" "foomatics" "tags") > + (scm->json-port tags)) > + (rest (error "TODO ~a" rest))))) > + (parameterize ((%github-api "mock://")) > + (thunk)))) I think the whole point of having the =E2=80=98%github-api=E2=80=99 paramet= er is that it allows us to mock the HTTP server instead of having to override bindings such as =E2=80=98http-fetch=E2=80=99. I=E2=80=99d have a slight preference for doing that, similar to what is don= e in tests/cpan.scm for instance. WDYT? Thanks, Ludo=E2=80=99.