From: "Ludovic Courtès" <ludo@gnu.org>
To: Maxime Devos <maximedevos@telenet.be>
Cc: 53060@debbugs.gnu.org
Subject: [bug#53060] [PATCH 0/2] Allow the github updater to update git sources
Date: Sun, 16 Jan 2022 23:19:48 +0100 [thread overview]
Message-ID: <87wnizz5kr.fsf@gnu.org> (raw)
In-Reply-To: <538acb9dc52f6992a5a65846db48f8b7382fb1be.camel@telenet.be> (Maxime Devos's message of "Thu, 06 Jan 2022 21:48:15 +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
> + (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 ‘%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?
Thanks,
Ludo’.
next prev parent reply other threads:[~2022-01-16 22:21 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 ` Ludovic Courtès [this message]
2022-01-17 10:12 ` [bug#53060] [PATCH 0/2] Allow the github updater to update git sources Maxime Devos
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=87wnizz5kr.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=53060@debbugs.gnu.org \
--cc=maximedevos@telenet.be \
/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.