GNU bug report logs -
#53060
[PATCH 0/2] Allow the github updater to update git sources
Previous Next
Reported by: Maxime Devos <maximedevos <at> telenet.be>
Date: Thu, 6 Jan 2022 20:49:02 UTC
Severity: normal
Tags: patch
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #19 received at 53060 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Ludovic Courtès schreef op zo 16-01-2022 om 23:19 [+0100]:
> Hi,
>
> Maxime Devos <maximedevos <at> 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 <at> 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.
[signature.asc (application/pgp-signature, inline)]
This bug report was last modified 3 years and 180 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.