Skip to content

Avoid duplicate upgrade warnings#22805

Merged
MikeMcQuaid merged 1 commit into
mainfrom
fix-upgrade-duplicate-warning
Jun 19, 2026
Merged

Avoid duplicate upgrade warnings#22805
MikeMcQuaid merged 1 commit into
mainfrom
fix-upgrade-duplicate-warning

Conversation

@MikeMcQuaid

Copy link
Copy Markdown
Member

Fixes #22801

  • Suppress ask-mode preview warnings for named packages that are checked again during the actual upgrade pass.
  • Add coverage so up-to-date formula upgrades only warn once.

  • 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.5 high with local review and testing.


Copilot AI review requested due to automatic review settings June 19, 2026 07:46

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 PR addresses duplicate “already installed / not upgrading” warnings shown by brew upgrade when running in ask-mode (preview dry-run followed by the actual pass), by suppressing the preview-pass warnings for named items that will be evaluated again during the real upgrade.

Changes:

  • Suppress “already installed”/minimum-version warning output during the ask-mode preview pass for named formulae.
  • Apply the same “preview quiet” behavior to cask upgrading and minimum-version filtering.
  • Add a spec ensuring up-to-date named formula upgrades warn only once.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
Library/Homebrew/cmd/upgrade.rb Introduces a derived quiet for ask-mode preview passes to prevent duplicate warnings for named formulae/casks.
Library/Homebrew/test/cmd/upgrade_spec.rb Adds coverage for the “warn once for already up-to-date named formula” behavior.

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

Comment thread Library/Homebrew/test/cmd/upgrade_spec.rb
@MikeMcQuaid MikeMcQuaid force-pushed the fix-upgrade-duplicate-warning branch from 2c13d87 to 5edc38a Compare June 19, 2026 08:01
@MikeMcQuaid MikeMcQuaid enabled auto-merge June 19, 2026 08:04
Comment thread Library/Homebrew/test/cmd/upgrade_spec.rb
- Suppress ask-mode preview warnings for named packages that are
  checked again during the actual upgrade pass.
- Add coverage so up-to-date formula and cask upgrades only warn once.
@MikeMcQuaid MikeMcQuaid force-pushed the fix-upgrade-duplicate-warning branch from 5edc38a to 30719dd Compare June 19, 2026 18:07
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Jun 19, 2026
Merged via the queue into main with commit 28788eb Jun 19, 2026
41 checks passed
@MikeMcQuaid MikeMcQuaid deleted the fix-upgrade-duplicate-warning branch June 19, 2026 18:43
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 upgrade shows double-warning for already up-to-date packages now

3 participants