-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Feature Request
Is your feature request related to a problem? Please describe.
Scoop's GitHub checkver currently has inconsistent behavior that relies on fragile HTML scraping. When using the
GitHub matcher with additional properties like regex, it falls back to parsing HTML pages instead of using the GitHub
API, leading to:
- Brittle regex patterns that match against HTML URLs instead of clean version strings
- Performance issues due to downloading full HTML pages vs compact JSON API responses
- Maintenance burden as manifest authors must understand GitHub's HTML structure
- Reliability problems when GitHub changes their HTML layout, breaking existing manifests
Describe the solution you'd like
Modify Scoop's checkver logic to use GitHub API by default when using the GitHub matcher, regardless of additional
properties. The proposed solution would:
- Enable
jsonpathwith GitHub matcher: Allowjsonpathto work withgithubproperty - Default to API mode: Use GitHub API for all GitHub matcher usage, not just simple cases
- Simplify regex patterns: Extract version directly from tag_name field, then clean with simple regex
Examples of improved manifest structure:
// Current (HTML scraping)
"checkver": {
"github": "https://github.com/wez/atomicparsley",
"regex": "/releases/tag/(\\d+\\.\\d+\\.[a-f0-9]+)"
}
// Proposed (API + jsonpath)
"checkver": {
"github": "https://github.com/wez/atomicparsley",
"jsonpath": "$.tag_name",
"regex": "([\\d]+\\.[\\d]+\\.[\\d]+\\.[a-f0-9]+)"
}
// Simple cases remains the same
"checkver": {
"github": "https://github.com/owner/repo"
}
We can also share the result between checkver and hash extraction, since it is using github API for github assets now.
Describe alternatives you've considered
One option could be introducing more controls within the checkver property itself. However, in most cases, it's primarily used to match a tag, so additional flexibility may not offer substantial benefit.