Opened 10 months ago

Last modified 6 months ago

#67824 assigned enhancement

pg github: livecheck: use json api

Reported by: mascguy (Christopher Nielsen) Owned by: mascguy (Christopher Nielsen)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: portgroup Cc: ryandesign (Ryan Carsten Schmidt), cooljeanius (Eric Gallager)
Port: pg-github

Description

Switch livecheck to use the GitHub API, as illustrated in a number of ports. (With the caveat that this example ignore alphabetic characters, to avoid pre-releases, betas, etc.)

livecheck.url       https://api.github.com/repos/${github.author}/${github.project}/tags?per_page=200
livecheck.curloptions
livecheck.regex     "\"name\": \"v([0-9\.\]+)\","

While the existing scheme works fine when checking the most recent project versions, it's limited to 10 due to pagination. Whereas the API allows us to specify how many we want, whilst also being faster.

Change History (3)

comment:1 Changed 10 months ago by mascguy (Christopher Nielsen)

p.s. We'd need to support multiple info sources, including both tags and releases. So that should be configurable.

comment:2 Changed 10 months ago by mascguy (Christopher Nielsen)

Ports that currently utilize the API, are as follows:

aqua/qt5/Portfilehttps://api.github.com/repos/qt/qtwebengine/git/refs/tags
devel/icu/Portfilehttps://api.github.com/repos/unicode-org/icu/releases?per_page=100
devel/icu-devel/Portfilehttps://api.github.com/repos/unicode-org/icu/releases?per_page=100
devel/tinyobjloader/Portfilehttps://api.github.com/repos/tinyobjloader/tinyobjloader/tags?per_page=100
graphics/jasper2/Portfilehttps://api.github.com/repos/jasper-software/jasper/tags
graphics/wxWidgets-3.0/Portfilehttps://api.github.com/repos/${github.author}/${github.project}/releases
lang/libomp/Portfilehttps://api.github.com/repos/llvm/llvm-project/tags
math/sundials5/Portfilehttps://api.github.com/repos/${github.author}/${github.project}/tags?per_page=200
math/sundials6/Portfilehttps://api.github.com/repos/${github.author}/${github.project}/tags?per_page=200
multimedia/rav1e/Portfilehttps://api.github.com/repos/xiph/rav1e/releases
python/py-clang/Portfilehttps://api.github.com/repos/llvm/llvm-project/git/refs/tags
python/py-wxpython-3.0/Portfilehttps://api.github.com/repos/wxWidgets/wxPython/tags
sysutils/kubectl/Portfilehttps://api.github.com/repos/kubernetes/kubernetes/releases?per_page=100
sysutils/pwait/Portfilehttps://api.github.com/repos/${github.author}/${github.project}/commits?path=${repo_path}/${name}.c&page=1&per_page=1
textproc/hunspell-dict-uk_UA/Portfilehttps://api.github.com/repos/brown-uk/dict_uk/releases?per_page=100

comment:3 Changed 6 months ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added
Note: See TracTickets for help on using tickets.