Skip to content

Add minimum version gating#22359

Merged
MikeMcQuaid merged 1 commit into
mainfrom
season-talk
May 21, 2026
Merged

Add minimum version gating#22359
MikeMcQuaid merged 1 commit into
mainfrom
season-talk

Conversation

@MikeMcQuaid
Copy link
Copy Markdown
Member

  • Let automation ask whether named packages are below a fleet policy floor without needing the tap's latest version to carry that meaning.
  • Keep the threshold tied to explicit names so an empty or unresolved request cannot unexpectedly report or upgrade everything installed.
  • Share comparison logic across outdated and upgrade so formulae and casks use Homebrew's version semantics consistently.
  • Expose --min-version beside --minimum-version because existing callers may need the shorter spelling during rollout.

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you written new tests (excluding integration tests) for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes. Non-maintainers may only have one AI-assisted/generated PR open at a time.

OpenAI Codex 5.5 xhigh with local review and testing.


Copilot AI review requested due to automatic review settings May 20, 2026 18:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a --minimum-version/--min-version floor mechanism to brew outdated and brew upgrade so automation can check (and selectively upgrade) named formulae/casks that are installed below a policy threshold, using Homebrew’s version comparison semantics.

Changes:

  • Introduces Homebrew::MinimumVersion shared logic for determining formula kegs below a minimum and casks installed below a minimum.
  • Adds --minimum-version/--min-version flags to brew outdated and brew upgrade, including guardrails requiring explicit named args.
  • Adds integration/spec coverage and updates Sorbet RBIs for the new CLI arg accessors.

Reviewed changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Library/Homebrew/cmd/upgrade.rb Adds --minimum-version flag and minimum-version filtering for formula/cask upgrade paths.
Library/Homebrew/cmd/outdated.rb Adds --minimum-version flag and minimum-version selection/output/JSON behavior for named args.
Library/Homebrew/minimum_version.rb New shared comparison utilities for formula kegs and casks vs a minimum version.
Library/Homebrew/test/cmd/upgrade_spec.rb Adds integration/spec coverage for minimum-version behavior in brew upgrade.
Library/Homebrew/test/cmd/outdated_spec.rb Adds integration/spec coverage for minimum-version behavior in brew outdated (incl. JSON v2).
Library/Homebrew/sorbet/rbi/dsl/homebrew/cmd/upgrade_cmd.rbi Adds min_version/minimum_version arg accessors.
Library/Homebrew/sorbet/rbi/dsl/homebrew/cmd/outdated.rbi Adds min_version/minimum_version arg accessors.
Files not reviewed (2)
  • Library/Homebrew/sorbet/rbi/dsl/homebrew/cmd/outdated.rbi: Language not supported
  • Library/Homebrew/sorbet/rbi/dsl/homebrew/cmd/upgrade_cmd.rbi: Language not supported

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

Comment thread Library/Homebrew/cmd/upgrade.rb
Comment thread Library/Homebrew/minimum_version.rb
- Let automation ask whether one named package is below a fleet policy
  floor without needing the tap's latest version to carry that meaning.
- Keep the threshold tied to exactly one explicit name so ambiguous
  package sets cannot share a policy value by accident.
- Share comparison logic across `outdated` and `upgrade` so formulae
  and casks use Homebrew's version semantics consistently.
- Report minimum-version skips distinctly from truly current formulae
  so policy-gated upgrades do not imply latest is installed.
- Reject invalid cask minimum versions because silent skips would hide
  automation configuration mistakes.
- Expose `--min-version` beside `--minimum-version` because existing
  callers may need the shorter spelling during rollout.
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue May 21, 2026
Merged via the queue into main with commit ab351a0 May 21, 2026
36 checks passed
@MikeMcQuaid MikeMcQuaid deleted the season-talk branch May 21, 2026 06:58
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.

3 participants