Add minimum version gating#22359
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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::MinimumVersionshared logic for determining formula kegs below a minimum and casks installed below a minimum. - Adds
--minimum-version/--min-versionflags tobrew outdatedandbrew 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.
- 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.
p-linnane
approved these changes
May 21, 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.
outdatedandupgradeso formulae and casks use Homebrew's version semantics consistently.--min-versionbeside--minimum-versionbecause existing callers may need the shorter spelling during rollout.brew lgtm(style, typechecking and tests) with your changes locally?OpenAI Codex 5.5 xhigh with local review and testing.