You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cask/upgrade: fail on named casks that cannot be upgraded - #24512
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 brew benchmark results.
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?
I did not use AI/LLM to create this PR, or I disclosed the tool/model below and reviewed its output; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.
Claude Opus 5.5 prepared all the changes. I reviewed and tested the change locally.
brew upgrade --cask <name> skips a named cask whose installed metadata can't be loaded, warns, and exits 0, so scripts that upgrade specific casks can't tell nothing was upgraded. Unattended upgrades are also now harder to monitor.
This makes that skip an ofail when the cask was named, matching named pinned casks. #21962 changed it from odie to opoo so one broken cask no longer aborts a plain brew upgrade; that is unchanged, and the remaining casks are still upgraded.
Explicitly named casks that cannot be upgraded as-is are skipped with a
warning and exit 0, so callers cannot tell the upgrade didn't happen.
Fail instead, as for named pinned casks; unnamed upgrades still warn.
No actionable comments were generated in the recent review.
Summary
Summary by CodeRabbit
Bug Fixes
During cask upgrades, an unupgradable cask explicitly named in the request now reports the reinstall instruction as an error and marks the upgrade as failed. For casks included in the upgrade without being explicitly named, the instruction remains a warning and does not mark the upgrade as failed. Skipped casks remain skipped.
When an installed cask cannot be loaded, the upgrade path reports a failure if the cask was explicitly supplied. Otherwise, it reports a warning. Tests verify both outcomes and check that skipping an unreadable cask file does not mark Homebrew as failed.
Changes: Cask upgrade reporting
Layer / File(s)
Summary
Unavailable cask reporting and tests Library/Homebrew/cask/upgrade.rb, Library/Homebrew/test/cask/upgrade_spec.rb
The unavailable-cask message uses ofail for explicitly supplied casks and opoo otherwise. Tests check failure status for explicitly supplied casks, warning behaviour for unnamed casks, and failure status after skipping an unreadable cask file.
Merge Risk: Minimal · up to 4f63b
Named failures are reported through the command’s failure status, while unnamed prefetched casks remain warnings. No merge-blocking issue is established.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title describes the change to fail when a named cask cannot be upgraded.
Description check
The description explains the failure for named casks and the preserved warning for unnamed casks.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Tip
🎯 Customize your risk assessments
Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.
✅ Automatic approvals, with your rules
Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 2032dd94-7595-49ad-a43c-dd50cc305e2e
Commits
Reviewing files that changed from the base of the PR and between 2b0e877 and 4f63b22.
Files selected for processing: 2
Library/Homebrew/cask/upgrade.rb
Library/Homebrew/test/cask/upgrade_spec.rb
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: c6dc28ec-ecbb-4772-858f-083c532e7e22
Commits
Reviewing files that changed from the base of the PR and between f101d88 and 2b0e877.
Files selected for processing: 2
Library/Homebrew/cask/upgrade.rb
Library/Homebrew/test/cask/upgrade_spec.rb
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
`brew upgrade` passes its prefetched outdated casks to
`upgrade_casks!` without naming them, so a non-empty list doesn't mean
the user asked for those casks.
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
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
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.
brew benchmarkresults.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?Claude Opus 5.5 prepared all the changes. I reviewed and tested the change locally.
brew upgrade --cask <name>skips a named cask whose installed metadata can't be loaded, warns, and exits 0, so scripts that upgrade specific casks can't tell nothing was upgraded. Unattended upgrades are also now harder to monitor.This makes that skip an
ofailwhen the cask was named, matching named pinned casks. #21962 changed it fromodietoopooso one broken cask no longer aborts a plainbrew upgrade; that is unchanged, and the remaining casks are still upgraded.