all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 53060@debbugs.gnu.org
Subject: [bug#53060] [PATCH 0/2] Allow the github updater to update git sources
Date: Mon, 17 Jan 2022 10:12:46 +0000	[thread overview]
Message-ID: <92f867a635d71b427a97012e308ed6578b3db4f4.camel@telenet.be> (raw)
In-Reply-To: <87wnizz5kr.fsf@gnu.org>

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

Ludovic Courtès schreef op zo 16-01-2022 om 23:19 [+0100]:
> Hi,
> 
> Maxime Devos <maximedevos@telenet.be> skribis:
> 
> > Follow-up to <https://issues.guix.gnu.org/50072>.
> > 
> > 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 [...])
> > +        (parameterize ((%github-api "mock://"))
> > +          (thunk))))
> 
> I think the whole point of having the ‘%github-api’ parameter is that it
> allows us to mock the HTTP server instead of having to override bindings
> such as ‘http-fetch’.
> 
> I’d have a slight preference for doing that, similar to what is done 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.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

  reply	other threads:[~2022-01-17 10:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-06 20:48 [bug#53060] [PATCH 0/2] Allow the github updater to update git sources Maxime Devos
2022-01-06 20:50 ` [bug#53060] [PATCH 1/2] import/github: Return <git-reference> objects for git-fetch origins Maxime Devos
2022-01-06 20:50   ` [bug#53060] [PATCH 2/2] import/github: Test it Maxime Devos
2022-01-16 22:19 ` [bug#53060] [PATCH 0/2] Allow the github updater to update git sources Ludovic Courtès
2022-01-17 10:12   ` Maxime Devos [this message]
2022-01-17 13:13     ` Ludovic Courtès

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=92f867a635d71b427a97012e308ed6578b3db4f4.camel@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=53060@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.