Skip to content

Skip empty upgrade ask prompt#22333

Merged
MikeMcQuaid merged 1 commit into
mainfrom
fix-upgrade-ask-noop
May 18, 2026
Merged

Skip empty upgrade ask prompt#22333
MikeMcQuaid merged 1 commit into
mainfrom
fix-upgrade-ask-noop

Conversation

@MikeMcQuaid
Copy link
Copy Markdown
Member

  • Avoid prompting for brew upgrade --ask when the dry-run plan has no version changes.
  • Keep the ask-flow regression explicit so the prompt still appears when there are upgrades.

  • 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 manual review and testing.


- Avoid prompting for `brew upgrade --ask` when the dry-run plan
  has no version changes.
- Keep the ask-flow regression explicit so the prompt still appears
  when there are upgrades.
Copilot AI review requested due to automatic review settings May 18, 2026 07:26
@MikeMcQuaid MikeMcQuaid enabled auto-merge May 18, 2026 07:27
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 updates brew upgrade --ask so it only prompts for confirmation when the dry-run upgrade summary contains actual version changes.

Changes:

  • Gates the upgrade confirmation prompt on final_upgrade_summary.version_changes.
  • Updates ask-flow tests to cover both upgrade-present and no-upgrade cases.

Reviewed changes

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

File Description
Library/Homebrew/cmd/upgrade.rb Skips Install.ask when the dry-run plan has no upgrade version changes.
Library/Homebrew/test/cmd/upgrade_spec.rb Adjusts and adds regression tests for --ask prompt 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 May 18, 2026
Merged via the queue into main with commit 24605f6 May 18, 2026
41 checks passed
@MikeMcQuaid MikeMcQuaid deleted the fix-upgrade-ask-noop branch May 18, 2026 08:30
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