Fix cask upgrade env conflict#22423
Merged
Merged
Conversation
- Avoid treating the developer default as an explicit `HOMEBREW_UPGRADE_AUTO_UPDATES_CASKS` opt-in. - Preserve the existing error when users explicitly set both `HOMEBREW_UPGRADE_AUTO_UPDATES_CASKS` and `HOMEBREW_NO_UPGRADE_AUTO_UPDATES_CASKS` outside developer mode.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts cask upgrade environment-variable conflict handling so developer-mode defaults don’t incorrectly trigger a mutual-exclusion error, while keeping the existing error for non-developer users who explicitly set both variables.
Changes:
- In
Cask::Upgrade.outdated_casks, only raise onHOMEBREW_UPGRADE_AUTO_UPDATES_CASKS+HOMEBREW_NO_UPGRADE_AUTO_UPDATES_CASKSconflicts when not in developer mode. - Add an RSpec example covering the developer-mode case where both variables are set (to reflect
brew.shexporting the default).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Library/Homebrew/cask/upgrade.rb | Skips the env-var conflict error in developer mode to allow opt-out to override the developer default. |
| Library/Homebrew/test/cask/upgrade_spec.rb | Adds a regression spec for the developer-mode env-var interaction. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
p-linnane
approved these changes
May 27, 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.
HOMEBREW_UPGRADE_AUTO_UPDATES_CASKSopt-in.HOMEBREW_UPGRADE_AUTO_UPDATES_CASKSandHOMEBREW_NO_UPGRADE_AUTO_UPDATES_CASKSoutside developer mode.brew lgtm(style, typechecking and tests) with your changes locally?OpenAI 5.5 xhigh with local testing and review.