summaryrefslogtreecommitdiff
path: root/guix/import/github.scm
AgeCommit message (Expand)Author
2022-03-06import: github: Reuse HTTP connection for the /tags URL fallback....* guix/import/github.scm (fetch-releases-or-tags): Call 'open-connection-for-uri' and reuse the same connection for the two 'http-fetch' calls. * .dir-locals.el (scheme-mode): Add 'call-with-port'. Ludovic Courtès
2022-03-06import: github: Gracefully handle rate limit exhaustion....Previously, 'guix refresh' would literally crash when the rate limit was reached due to the call to 'error'. With this change, the updater notices when the rate limit is reached and it turns itself into a no-op until the rate limit has been reset. When running "guix refresh" (with no arguments), the 'github' updater gets used until the rate limit has been reached, after which "guix refresh" automatically picks up the next valid updater, typically 'generic-git'. * guix/import/github.scm (fetch-releases-or-tags): Use 'http-fetch' directly instead of 'json-fetch' to let 'http-get-error?' exceptions through. Handle 403 errors with an 'X-RateLimit-Remaining' header. (%rate-limit-reset-time): New variable. (update-rate-limit-reset-time!, request-rate-limit-reached?): New procedures. (latest-released-version): Remove calls to 'error'. Ludovic Courtès
2022-01-16import/github: Test it....* Makefile.am (SCM_TESTS): Register new tests. * guix/import/github.scm (%github-api): New variable. (fetch-releases-or-tags): Use the new variable. * tests/import-github.scm: New file with tests. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Maxime Devos
2022-01-16import/github: Return <git-reference> objects for git-fetch origins....* guix/import/github.scm (latest-released-version): Also return the tag. (latest-release): Use this information to return <git-reference> objects when appropriate. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Maxime Devos
2020-07-24import: github: Gracefully handle projects that have disappeared....Fixes <https://bugs.gnu.org/42509>. Reported by Alexandru-Sergiu Marton <brown121407@posteo.ro>. * guix/import/github.scm (fetch-releases-or-tags): Use 'http-fetch' instead of 'json-fetch', and guard against 404 errors. Upon 404, emit a warning and return the empty vector. Ludovic Courtès
2020-07-03import: Do not assume that 'package-source' returns an origin....* guix/gnu-maintenance.scm (gnu-package?): Check whether 'package-source' returns an origin. * guix/import/github.scm (updated-github-url): Likewise. * guix/import/launchpad.scm (updated-launchpad-url): Likewise. Ludovic Courtès
2020-02-22import: github: Use HTTP "Authorization" header for access tokens....Fixes <https://bugs.gnu.org/39511>. The "access_token" query parameter is now deprecated: https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api/#authenticating-using-query-parameters * guix/import/github.scm (fetch-releases-or-tags)[headers]: Add "Authorization" header when (%github-token) is true. [decorate]: Remove, and remove callers. Matt Wette
2019-09-20import/github: Check for more version prefixes....* guix/import/github.scm (latest-released-version): Allow the version string to begin with the word 'version'. Efraim Flashner
2019-09-08import: github: Fix incorrect no-release case....This is a followup to 81c3dc32244a17241d74eea9fa265edfcb326f6d. Since that commit, when /releases returned an empty JSON array, we would not fall back to /tags because of the incorrect match. * guix/import/github.scm (fetch-releases-or-tags): Match the empty vector instead of the empty list. Ludovic Courtès
2019-08-27import: github: 'github-package?' uses 'package-upstream-name'....* guix/import/github.scm (updated-github-url): Use 'package-upstream-name' instead of 'package-name'. This allows 'github-package?' to match more packages, given an appropriate upstream name. Ludovic Courtès
2019-07-25maint: Switch to Guile-JSON 3.x....Guile-JSON 3.x is incompatible with Guile-JSON 1.x, which we relied on until now: it maps JSON dictionaries to alists (instead of hash tables), and JSON arrays to vectors (instead of lists). This commit is about adjusting all the existing code to this new mapping. * m4/guix.m4 (GUIX_CHECK_GUILE_JSON): New macro. * configure.ac: Use it. * doc/guix.texi (Requirements): Mention the Guile-JSON version. * guix/git-download.scm (git-fetch)[guile-json]: Use GUILE-JSON-3. * guix/import/cpan.scm (string->license): Expect vectors instead of lists. (module->dist-name): Use 'json-fetch' instead of 'json-fetch-alist'. (cpan-fetch): Likewise. * guix/import/crate.scm (crate-fetch): Likewise, and call 'vector->list' for DEPS. * guix/import/gem.scm (rubygems-fetch): Likewise. * guix/import/json.scm (json-fetch-alist): Remove. * guix/import/pypi.scm (pypi-fetch): Use 'json-fetch' instead of 'json-fetch-alist'. (latest-source-release, latest-wheel-release): Call 'vector->list' on RELEASES. * guix/import/stackage.scm (stackage-lts-info-fetch): Use 'json-fetch' instead of 'json-fetch-alist'. (lts-package-version): Use 'vector->list'. * guix/import/utils.scm (hash-table->alist): Remove. (alist->package): Pass 'vector->list' on the inputs fields, and default to the empty vector. * guix/scripts/import/json.scm (guix-import-json): Remove call to 'hash-table->alist'. * guix/swh.scm (define-json-reader): Expect pair? or null? instead of hash-table?. [extract-field]: Use 'assoc-ref' instead of 'hash-ref'. (json->branches): Use 'map' instead of 'hash-map->list'. (json->checksums): Likewise. (json->directory-entries, origin-visits): Call 'vector->list' on the result of 'json->scm'. * tests/import-utils.scm ("alist->package with dependencies"): New test. * gnu/installer.scm (build-compiled-file)[builder]: Use GUILE-JSON-3. * gnu/installer.scm (installer-program)[installer-builder]: Likewise. * gnu/installer/locale.scm (iso639->iso639-languages): Use 'assoc-ref' instead of 'hash-ref', and pass vectors through 'vector->list'. (iso3166->iso3166-territories): Likewise. * gnu/system/vm.scm (system-docker-image)[build]: Use GUILE-JSON-3. * guix/docker.scm (manifest, config): Adjust for Guile-JSON 3. * guix/scripts/pack.scm (docker-image)[build]: Use GUILE-JSON-3. * guix/import/github.scm (fetch-releases-or-tags): Update docstring. (latest-released-version): Use 'assoc-ref' instead of 'hash-ref'. Pass the result of 'fetch-releases-or-tags' to 'vector->list'. * guix/import/launchpad.scm (latest-released-version): Likewise. Ludovic Courtès
2019-05-15import: github: Sort releases before picking the latest one....* guix/import/github.scm (latest-released-version): Sort releases before picking the first one as the latest. Arun Isaac
2019-05-15import: github: Improve readability....* guix/import/github.scm (latest-released-version)[release->version]: Separate out release->version as a new function. Arun Isaac
2019-01-21import: github: Improve readability....* guix/import/github.scm (latest-released-version): Use any and cond instead of a recursive loop and an if-else ladder respectively. Arun Isaac
2019-01-21import: github: Use prereleases when package has no releases....* guix/import/github.scm (latest-released-version): Use preleases when package has no releases. Arun Isaac
2019-01-21import: github: Check if git URIs are GitHub URIs....This fixes a regression introduced in 9a5091d0c181453d0f31ce97f96a4e577a25e796 whereby packages with git origin URIs not hosted on GitHub would be wrongly detected as being covered under the github updater. Reported by Efraim Flashner <efraim@flashner.co.il>. * guix/import/github.scm (updated-github-url): Check if git URIs are GitHub URIs. Arun Isaac
2019-01-16import: github: Do not update URI for packages using git-fetch....* guix/import/github.scm (updated-github-url): Return the unchanged source URI for packages using git-fetch. [updated-url]: Do not handle URIs which end with ".git". Arun Isaac
2018-12-31refresh: github: updates for origins using 'git-fetch'....* guix/import/github.scm (updated-github-url): Respond with the repository url for the 'git-fetch' fetch method. (github-package?): Simplify boolean expression. (github-repository, github-user-slash-repository): Strip trailing ".git" from project if present. (latest-release)<origin-github-uri>: Recognize a 'git-reference'. Eric Bavier
2018-08-20import: github: Filter out tags that don't look like version numbers....* guix/import/github.scm (latest-released-version): Filter out RELEASE if it doesn't start with digit. Ludovic Courtès
2018-08-20import: github: Get /tags when /releases returns the empty list....This allows "guix refresh" to work for many packages where it would previously fail with "no updater for PACKAGE". * guix/import/github.scm (fetch-releases-or-tags): New procedure. (latest-released-version): Use it instead of calling 'json-fetch'. Adjust 'hash-ref' call. Ludovic Courtès
2018-08-20import: github: Request API v3 in the 'Accept' header....* guix/import/json.scm (json-fetch): Add #:headers argument and honor it. * guix/import/github.scm (latest-released-version): Pass #:headers to 'json-fetch'. Ludovic Courtès
2018-06-10import: json: Consolidate duplicate json-fetch functionality....* guix/import/json.scm (json-fetch): Return a list or hash table. (json-fetch-alist): New procedure. * guix/import/github.scm (json-fetch*): Remove. (latest-released-version): Use json-fetch. * guix/import/cpan.scm (module->dist-name): Use json-fetch-alist. (cpan-fetch): Likewise. * guix/import/crate.scm (crate-fetch): Likewise. * guix/import/gem.scm (rubygems-fetch): Likewise. * guix/import/pypi.scm (pypi-fetch): Likewise. * guix/import/stackage.scm (stackage-lts-info-fetch): Likewise. Jelle Licht
2017-10-28import: github: Gracefully handle multiple-URL origins....* guix/import/github.scm (latest-release)[origin-github-uri]: New procedure. Use it. Ludovic Courtès
2017-01-28import: github: Better tolerate unexpected file extensions....* guix/import/github.scm (find-extension): Add ".tbz". (updated-github-url): When 'find-extension' returns #f, use "" for EXT. Ludovic Courtès
2017-01-19import: github: Catch HTTP 403 error during fetch....* guix/import/github.scm (json-fetch*): Catch 403 HTTP error that may be raised if a github token has not been set. Signed-off-by: Mathieu OTHACEHE <m.othacehe@gmail.com> Signed-off-by: Ludovic Courtès <ludo@gnu.org> Mathieu OTHACEHE
2017-01-13http-client: Provide 'User-Agent' header by default....* guix/http-client.scm (http-fetch): Add #:headers parameter and honor it. Rename 'auth-header' to 'headers'. * guix/import/github.scm (json-fetch*): Add comment about required User-Agent. Ludovic Courtès
2017-01-13import: github: Fix regression on the /releases retrieval....Fixes a regression introduced in 62bd24db39a86f80242f923eb4cc2f18f3b02c67, which introduced a call to 'hash-table->alist'. * guix/import/github.scm (json-fetch*): New procedure. (latest-released-version): Use it. Ludovic Courtès
2016-12-20import: github: Use 'json-fetch'....* guix/import/github.scm (json-fetch*): Remove. (latest-released-version): Adjust accordingly. Ludovic Courtès
2016-10-10import: github: Add .love extension....* guix/import/github.scm (find-extension): Add '.love' extension to the list of extensions checked. Efraim Flashner
2016-05-31import: github: Tiny cosmetic change....* guix/import/github.scm (find-extension): Use a one-argument lambda. Ludovic Courtès
2016-05-31import github: Add to extension list....* guix/import/github.scm (find-extension): Add '.tgz' extension. Efraim Flashner
2016-04-15upstream: Pass a package object to updaters....* guix/upstream.scm (package-update-path): Pass PACKAGE to 'latest-release'. * guix/gnu-maintenance.scm (latest-release*) (latest-gnome-release, latest-xorg-release): Adjust accordingly. * guix/import/cran.scm (latest-cran-release): (latest-bioconductor-release): Likewise. * guix/import/elpa.scm (latest-release): Likewise. * guix/import/gem.scm (latest-release): Likewise. * guix/import/github.scm (latest-release): Likewise. * guix/import/hackage.scm (latest-release): Likewise. * guix/import/pypi.scm (latest-release): Likewise. Ludovic Courtès
2016-02-26import: Add github-updater....* guix/import/github.scm: New file. * guix/scripts/refresh.scm (%updaters): Add %GITHUB-UPDATER. * doc/guix.texi (Invoking guix refresh): Mention it. * Makefile.am (MODULES): Add gnu/import/github.scm. Ben Woodcroft