From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id gLxWA6BB5WHSXwEAgWs5BA (envelope-from ) for ; Mon, 17 Jan 2022 11:14:56 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id uE2fN59B5WEEJwAAG6o9tA (envelope-from ) for ; Mon, 17 Jan 2022 11:14:55 +0100 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 5296A364F8 for ; Mon, 17 Jan 2022 11:14:55 +0100 (CET) Received: from localhost ([::1]:51990 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n9P2M-0004We-1Q for larch@yhetil.org; Mon, 17 Jan 2022 05:14:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54914) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9P1X-0004BX-65 for guix-patches@gnu.org; Mon, 17 Jan 2022 05:14:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:51923) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n9P1V-0003jt-Pz for guix-patches@gnu.org; Mon, 17 Jan 2022 05:14:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n9P1V-0005qe-NG for guix-patches@gnu.org; Mon, 17 Jan 2022 05:14:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53060] [PATCH 0/2] Allow the github updater to update git sources Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 17 Jan 2022 10:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53060 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 53060@debbugs.gnu.org Received: via spool by 53060-submit@debbugs.gnu.org id=B53060.164241438222389 (code B ref 53060); Mon, 17 Jan 2022 10:14:01 +0000 Received: (at 53060) by debbugs.gnu.org; 17 Jan 2022 10:13:02 +0000 Received: from localhost ([127.0.0.1]:44822 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9P0S-0005oR-6I for submit@debbugs.gnu.org; Mon, 17 Jan 2022 05:13:02 -0500 Received: from xavier.telenet-ops.be ([195.130.132.52]:41202) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9P0O-0005oH-Ut for 53060@debbugs.gnu.org; Mon, 17 Jan 2022 05:12:54 -0500 Received: from [192.168.179.254] ([188.189.128.58]) by xavier.telenet-ops.be with bizsmtp id jmCq2600U1Fk3F801mCq2k; Mon, 17 Jan 2022 11:12:51 +0100 Message-ID: <92f867a635d71b427a97012e308ed6578b3db4f4.camel@telenet.be> From: Maxime Devos Date: Mon, 17 Jan 2022 10:12:46 +0000 In-Reply-To: <87wnizz5kr.fsf@gnu.org> References: <538acb9dc52f6992a5a65846db48f8b7382fb1be.camel@telenet.be> <87wnizz5kr.fsf@gnu.org> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-HPlQiW+A6J2pCc/Af1VH" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1642414371; bh=CXpewoX9N1kYunX3E+xlayhjrsIm6cD1SOq/tCWWdcI=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=X0QtLVgCI43wRp8QpbHZpnZoN4iAAnyelEEF4TFDDkIcqdZl0KDCRXXAZA2nlln0D 764s/EPbevhzYFLV8vrx8z53NK8PubuWQ9gQO+R9Eeb2m7hSLrwHpdeJVS+oG22Hnb wHMOb207xAS0UNSOWdIeVfvIiXIpyb5EuXdZ95hGxxP9+yoNt/5C7vqRIdhIUrv/PO xgweTLWWk/0ct/cEDn9ITVhd6yO1NxueFLi/l7CWoBw5T9J3rdd9pAriRdeKyUs3ov nnINsbhlONNuS3dyvZSeK8ITDNr1iwV74ZH7OO5trH9/0LTURXWIoObqJldZe4wVe0 qXZ1U0XKhMlaQ== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1642414495; 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:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=CXpewoX9N1kYunX3E+xlayhjrsIm6cD1SOq/tCWWdcI=; b=c10WynO+yT9rgOXSFtUn05uvpJYTjC7dAoTITk1bwVG/SGji987fjDk1yaYED8/aktmLPn 9ji3J2QSr2nilqljr3scJI2nAz2KTX6QnI4TjGMn96Vu9mmvMdN3/MemDQHOgr34pbequC db7b8LUMd+sXVAoV3pqJCkNLUI17kdKhh91FIAPZhDTBt3lNSw6MFcDKlJU6Jck29LShUt xr8WSfENxzszFSexecdYYANFYaTyuTLrHjBuJuwwWzb8STi6OMqqUlda2fb+q/uXohyDqH gLnkUpYBoehbkd0kjuXdD2Z9aIaoRozrrmalTfIlDvzHIZ+rJazJfRRL0LJZTg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1642414495; a=rsa-sha256; cv=none; b=rQH6z+n/abd59LMsInxF4qi5NGJgI/0znUmEKqDgjK8fmsyAk6rikeKvmqs3xv8lD754qo L9VWZMjSMA0rZS9ZTFcdmRbj4flKrVpaEgFI+jO+OhRrkxjGhLyYV3rFWUIGzmUXh44IUp Y97FF/lg7RO+rOJdfuHjYbJCLXm2DIq22mkSYAVWiJWhZ2Y4nXtEV3Vrgmgkm93d449x+K F51SfAUjg5ZdUB1LIaXfc0rS2/hcSKjukSEZVaV01Fsm9OSjjpFfPrFmunpYkKCEy0gqbk YjutcHXF47LhZYCNzb0cZyYvn2rxavWwKqlAGNSIRjgX1Kmk0WBM4WWRptSjOg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=X0QtLVgC; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.22 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=X0QtLVgC; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 5296A364F8 X-Spam-Score: -4.22 X-Migadu-Scanner: scn1.migadu.com X-TUID: s/fguRpSNw5t --=-HPlQiW+A6J2pCc/Af1VH Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s schreef op zo 16-01-2022 om 23:19 [+0100]: > Hi, >=20 > Maxime Devos skribis: >=20 > > Follow-up to=C2=A0. > >=20 > > To test, you can do > >=20 > > $ make check > > $ ./pre-inst-env guix refresh -t github -u zig > >=20 > > and verify that the version and sha256/base32 has been updated > > (zig@0.9.0 doesn't work though; patches aren't applying cleanly). >=20 > Nice, applied! >=20 > One comment: >=20 > > +(define (call-with-releases thunk tags releases) > > + (mock ((guix http-client) http-fetch [...]) > > + (parameterize ((%github-api "mock://")) > > + (thunk)))) >=20 > I think the whole point of having the =E2=80=98%github-api=E2=80=99 param= eter 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. >=20 > I=E2=80=99d have a slight preference for doing that, similar to what is d= one in > tests/cpan.scm for instance. WDYT? tests/cpan.scm uses 'with-http-server', which I do not find ideal because the answers the HTTP server gives depend on the order the HTTP server was queried, without verifying the URI. Mocking 'http-fetch' allows me not to worry about ordering and allows verifying the URI. It might be possible to modify 'with-http-server' into something (with-http-server*?) that allows looking at the HTTP headers and URI and dynamically generate a response based on that. Due to the mocking, %github-api isn't truly necessary, but having "https://api.github.com" in a single location helps avoiding typos like writing "http://" instead of "https://" somewhere, or adjusting the domain name if GitHub decided to change it for whatever reason (hopefully unlikely?), or if Tor becomes very popular among the general public and GitHub has an ".onion" address, then it could be changed to the ".onion" address easily, ... Greetings, Maxime. --=-HPlQiW+A6J2pCc/Af1VH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYeVBHhccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7q3sAP4kMdB9LatxdqyGx9g64mGfbZpD ojbG3MT8OaJwVNEj+wEAtkmuGM5U4iN6AVnjDF++dgyX8gyPdnJTI/UYhOkDjgw= =onMq -----END PGP SIGNATURE----- --=-HPlQiW+A6J2pCc/Af1VH--