From: ludo@gnu.org (Ludovic Courtès)
To: Ben Woodcroft <b.woodcroft@uq.edu.au>
Cc: "guix-devel@gnu.org" <guix-devel@gnu.org>
Subject: Re: [PATCH] draft addition of github updater
Date: Mon, 16 Nov 2015 10:15:35 +0100 [thread overview]
Message-ID: <87h9kmb8zs.fsf@gnu.org> (raw)
In-Reply-To: <5647D2A8.8040603@uq.edu.au> (Ben Woodcroft's message of "Sun, 15 Nov 2015 10:32:40 +1000")
Hi!
Ben Woodcroft <b.woodcroft@uq.edu.au> skribis:
> Importing from GitHub seems very non-trivial, but can we update?
> There's a number of issues with the attached patch but so far out of
> the 171 github package in guix, it recognizes 101, and 17 are detected
> as out of date (see below).
Woow, nice!
> I have two questions:
>
> 1. Some guess-work is required to get between the version as it is
> defined in guix, and that presented in the github json, where only the
> "tag_name" is available. Is it OK to be a little speculative in this
> conversion e.g. "v1.0" => "1.0"?
I guess so. What I would do is do that conversion when the tag matches
“^v[0-9]” and leave the tag as-is in other cases. WDYT?
We can always add more heuristics later if we find that there’s another
widely-used convention for tag names.
> 2. For mass-updates, it fails when it hits the abuse limit on github
> (60 api requests per hour). This can be overcome by authenticating
> with an access token, but I don't think that token should go in the
> git repository. So I'm after some guidance on the best way of the user
> providing a token to the updater (or some other workaround).
Argh, that’s annoying. How does it fail exactly? What’s the impact on
the behavior of ‘guix refresh’?
I guess (guix import github) could contain something like:
(define %github-token
;; Token to be passed to Github.com to avoid the 60-request per hour
;; limit, or #f.
(make-parameter (getenv "GUIX_GITHUB_TOKEN")))
and we’d need to document that, or maybe write a message hinting at it
when we know the limit has been reached.
WDYT?
> +;; TODO: Are all of these imports used?
> +(define-module (guix import github)
> + #:use-module (ice-9 binary-ports)
By default modules are compiled with -Wunbound-variables, so you can
find out by removing modules until you get an “unbound variable”
warning.
> +(define (json-fetch* url)
> + "Return a list/hash representation of the JSON resource URL, or #f on
> +failure."
> + ;; TODO: make silent
> + (call-with-temporary-output-file
> + (lambda (temp port)
> + (and (url-fetch url temp)
> + (call-with-input-file temp json->scm)))))
See how ‘pypi-fetch’ makes it silent.
Overall it LGTM.
I was thinking we could have a generic Git updater that would look for
available tags upstream. I wonder how efficient that would be compared
to using the GitHub-specific API, and if there would be other
differences. What are your thoughts on this?
Thanks!
Ludo’.
next prev parent reply other threads:[~2015-11-16 9:15 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-15 0:32 [PATCH] draft addition of github updater Ben Woodcroft
2015-11-16 9:15 ` Ludovic Courtès [this message]
2015-12-20 0:42 ` Ben Woodcroft
2016-01-03 20:46 ` Ludovic Courtès
2016-01-05 16:05 ` Ricardo Wurmus
2016-04-15 8:42 ` Updaters now receive package objects Ludovic Courtès
2016-02-21 3:13 ` [PATCH] draft addition of github updater Ben Woodcroft
2016-02-21 3:17 ` Ben Woodcroft
2016-02-23 13:22 ` Ludovic Courtès
2016-02-27 3:14 ` Ben Woodcroft
2016-02-27 11:55 ` Ricardo Wurmus
2016-02-28 14:35 ` Ludovic Courtès
2015-11-16 14:14 ` Efraim Flashner
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=87h9kmb8zs.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=b.woodcroft@uq.edu.au \
--cc=guix-devel@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.