Skip to content

Fix GitHub release version detection - #23338

Merged
MikeMcQuaid merged 1 commit into
mainfrom
fix-version-detection
Jul 28, 2026
Merged

Fix GitHub release version detection#23338
MikeMcQuaid merged 1 commit into
mainfrom
fix-version-detection

Conversation

@MikeMcQuaid

Copy link
Copy Markdown
Member
  • Prefer numeric release tags over asset filename versions.
  • Audit equivalent versions with different string forms.

Fixes #23336.


  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • Have you explained what your changes do? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • AI was used to generate or assist with generating this PR.

OpenAI Codex 5.6 Sol xhigh with local review and testing.


- Prefer numeric release tags over asset filename versions.
- Audit equivalent versions with different string forms.
- Fixes #23336.
Copilot AI review requested due to automatic review settings July 28, 2026 14:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes Homebrew’s version inference for GitHub “releases/download” URLs by preferring the numeric release tag version (e.g., v3.2) over versions embedded in asset filenames (e.g., hstr-3.2.0-...). It also tightens formula auditing to catch “equivalent but differently formatted” version changes (e.g., 1.01.0.0) that can cause operational mismatches.

Changes:

  • Add a GitHub releases URL parser to detect versions from numeric release tags earlier in the parser chain.
  • Add a version detection spec asserting that the release tag takes precedence over the asset filename.
  • Update the formula auditor to flag stable version “format-only” changes (same comparable version, different string form) and add coverage for it.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
Library/Homebrew/version.rb Adds an early GitHub releases URL parser to prioritize numeric release tag versions.
Library/Homebrew/test/version_spec.rb Adds a regression test ensuring the release tag version is chosen over the asset filename version.
Library/Homebrew/formula_auditor.rb Audits and reports stable version changes that only alter string formatting (e.g., 1.01.0.0).
Library/Homebrew/test/formula_auditor_spec.rb Adds a spec asserting the new “format-only version change” audit behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue Jul 28, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 28, 2026
@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue Jul 28, 2026
Merged via the queue into main with commit b0b5c89 Jul 28, 2026
44 checks passed
@MikeMcQuaid
MikeMcQuaid deleted the fix-version-detection branch July 28, 2026 17:15
tcmulcahy added a commit to block/homebrew-tap that referenced this pull request Jul 28, 2026
By default, setup-homebrew will use the main branch. Specifying `stable:
true` instead uses the latest stable release.

Homebrew/brew#23338 made it so some of our
formula don't pass brew audit. Using `stable: true` mitigates this:
We'll still break when there's a new stable release, but at least we
won't break outside of new releases.

Co-authored-by: Codex <noreply@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

brew version detection change preventing formula installation

3 participants