Merged
Conversation
The `GithubReleases` livecheck strategy was originally set up to check the `tag_name` value and fall back to the release `name`. At the time, I advocated for only checking `tag_name`, as matching the version from the release name is almost never needed and could be handled in a `strategy` block. Notably, only checking `tag_name` makes it easier to switch between the `Git` and `GithubLatest` strategies (i.e., the same regex can be used for both). This modifies `GithubReleases` to only check the `tag_name` value by default, as this behavior makes it a little easier for us to implement batch `GithubLatest` data fetching in the future (i.e., using the GitHub GraphQL API to fetch the latest release `tag_name` for 100 repositories per request). I've done comparative checks across all `GithubLatest` and `GithubReleases` `livecheck` blocks in homebrew-core and homebrew-cask to confirm that the results remain the same after this change. If we need to match against the release `name` going forward, we can check the value in a `strategy` block, as we're already doing in ~5 cases (out of ~1350 checks using `GithubLatest` or `GithubReleases`).
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts the GithubReleases livecheck strategy to only match versions from GitHub release tag_name, removing the previous fallback to the release name to better align with other GitHub-based strategies and future batching plans.
Changes:
- Remove
name-based fallback version matching inGithubReleases(match onlytag_name). - Update
GithubReleasesstrategy specs/fixtures and expectations to reflect the new matching behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
Library/Homebrew/livecheck/strategy/github_releases.rb |
Simplifies matching logic to extract versions only from release["tag_name"]. |
Library/Homebrew/test/livecheck/strategy/github_releases_spec.rb |
Updates fixture data and expected matches to align with tag-only matching. |
Comments suppressed due to low confidence (1)
Library/Homebrew/test/livecheck/strategy/github_releases_spec.rb:60
- The updated fixture no longer includes a release where
tag_namedoesn’t match the regex butnamecontains a version (the behavior being removed in this PR). Without such a case, the spec won’t fail if fallback-to-namematching is accidentally reintroduced later. Consider adding a release object with a non-matchingtag_namebut a version-likename, and asserting that version is not returned inmatches.
{
"tag_name": "1.2.2",
"name": "No version title",
"draft": false,
"prerelease": false
},
{
"tag_name": "no-version-tag",
"name": "No version title",
"draft": false,
"prerelease": false
},
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bevanjkay
approved these changes
Mar 1, 2026
p-linnane
approved these changes
Mar 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
brew lgtm(style, typechecking and tests) with your changes locally?The
GithubReleaseslivecheck strategy was originally set up to check thetag_namevalue and fall back to the releasename. At the time, I advocated for only checkingtag_name, as matching the version from the release name is almost never needed and could be handled in astrategyblock. Notably, only checkingtag_namemakes it easier to switch between theGitandGithubLateststrategies (i.e., the same regex can be used for both).This modifies
GithubReleasesto only check thetag_namevalue by default, as this behavior makes it a little easier for us to implement batchGithubLatestdata fetching in the future (i.e., using the GitHub GraphQL API to fetch the latest releasetag_namefor 100 repositories per request). I've done comparative checks across allGithubLatestandGithubReleaseslivecheckblocks in homebrew-core and homebrew-cask to confirm that the results remain the same after this change. If we need to match against the releasenamegoing forward, we can check the value in astrategyblock, as we're already doing in ~5 cases (out of ~1350 checks usingGithubLatestorGithubReleases).