summaryrefslogtreecommitdiff
path: root/guix/import/github.scm
Commit message (Collapse)AuthorAge
* import: github: Reuse HTTP connection for the /tags URL fallback.Ludovic Courtès2022-03-06
| | | | | | | * 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'.
* import: github: Gracefully handle rate limit exhaustion.Ludovic Courtès2022-03-06
| | | | | | | | | | | | | | | | | | | | 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'.
* import/github: Test it.Maxime Devos2022-01-16
| | | | | | | | | | * 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>
* import/github: Return <git-reference> objects for git-fetch origins.Maxime Devos2022-01-16
| | | | | | | | | * 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>
* import: github: Gracefully handle projects that have disappeared.Ludovic Courtès2020-07-24
| | | | | | | | | 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.
* import: Do not assume that 'package-source' returns an origin.Ludovic Courtès2020-07-03
| | | | | | | * 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.
* import: github: Use HTTP "Authorization" header for access tokens.Matt Wette2020-02-22
| | | | | | | | | | | | 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.
* import/github: Check for more version prefixes.Efraim Flashner2019-09-20
| | | | | * guix/import/github.scm (latest-released-version): Allow the version string to begin with the word 'version'.
* import: github: Fix incorrect no-release case.Ludovic Courtès2019-09-08
| | | | | | | | | | 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.
* import: github: 'github-package?' uses 'package-upstream-name'.Ludovic Courtès2019-08-27
| | | | | | | * 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.
* maint: Switch to Guile-JSON 3.x.Ludovic Courtès2019-07-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* import: github: Sort releases before picking the latest one.Arun Isaac2019-05-15
| | | | | * guix/import/github.scm (latest-released-version): Sort releases before picking the first one as the latest.
* import: github: Improve readability.Arun Isaac2019-05-15
| | | | | * guix/import/github.scm (latest-released-version)[release->version]: Separate out release->version as a new function.
* import: github: Improve readability.Arun Isaac2019-01-21
| | | | | * guix/import/github.scm (latest-released-version): Use any and cond instead of a recursive loop and an if-else ladder respectively.
* import: github: Use prereleases when package has no releases.Arun Isaac2019-01-21
| | | | | * guix/import/github.scm (latest-released-version): Use preleases when package has no releases.
* import: github: Check if git URIs are GitHub URIs.Arun Isaac2019-01-21
| | | | | | | | | | 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.
* import: github: Do not update URI for packages using git-fetch.Arun Isaac2019-01-16
| | | | | | * 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".
* refresh: github: updates for origins using 'git-fetch'.Eric Bavier2018-12-31
| | | | | | | | | * 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'.
* import: github: Filter out tags that don't look like version numbers.Ludovic Courtès2018-08-20
| | | | | * guix/import/github.scm (latest-released-version): Filter out RELEASE if it doesn't start with digit.
* import: github: Get /tags when /releases returns the empty list.Ludovic Courtès2018-08-20
| | | | | | | | | 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.
* import: github: Request API v3 in the 'Accept' header.Ludovic Courtès2018-08-20
| | | | | | * guix/import/json.scm (json-fetch): Add #:headers argument and honor it. * guix/import/github.scm (latest-released-version): Pass #:headers to 'json-fetch'.
* import: json: Consolidate duplicate json-fetch functionality.Jelle Licht2018-06-10
| | | | | | | | | | | | | * 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.
* import: github: Gracefully handle multiple-URL origins.Ludovic Courtès2017-10-28
| | | | | * guix/import/github.scm (latest-release)[origin-github-uri]: New procedure. Use it.
* import: github: Better tolerate unexpected file extensions.Ludovic Courtès2017-01-28
| | | | | * guix/import/github.scm (find-extension): Add ".tbz". (updated-github-url): When 'find-extension' returns #f, use "" for EXT.
* import: github: Catch HTTP 403 error during fetch.Mathieu OTHACEHE2017-01-19
| | | | | | | | * 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>
* http-client: Provide 'User-Agent' header by default.Ludovic Courtès2017-01-13
| | | | | | | * 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.
* import: github: Fix regression on the /releases retrieval.Ludovic Courtès2017-01-13
| | | | | | | | | 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.
* import: github: Use 'json-fetch'.Ludovic Courtès2016-12-20
| | | | | * guix/import/github.scm (json-fetch*): Remove. (latest-released-version): Adjust accordingly.
* import: github: Add .love extension.Efraim Flashner2016-10-10
| | | | | * guix/import/github.scm (find-extension): Add '.love' extension to the list of extensions checked.
* import: github: Tiny cosmetic change.Ludovic Courtès2016-05-31
| | | | * guix/import/github.scm (find-extension): Use a one-argument lambda.
* import github: Add to extension list.Efraim Flashner2016-05-31
| | | | * guix/import/github.scm (find-extension): Add '.tgz' extension.
* upstream: Pass a package object to updaters.Ludovic Courtès2016-04-15
| | | | | | | | | | | | | | * 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.
* import: Add github-updater.Ben Woodcroft2016-02-26
* 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.