Skip to content

Fix cask upgrade env conflict#22423

Merged
p-linnane merged 1 commit into
mainfrom
fix-cask-auto-updates-env-conflict
May 27, 2026
Merged

Fix cask upgrade env conflict#22423
p-linnane merged 1 commit into
mainfrom
fix-cask-auto-updates-env-conflict

Conversation

@MikeMcQuaid
Copy link
Copy Markdown
Member

@MikeMcQuaid MikeMcQuaid commented May 26, 2026

  • 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.

  • 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.

OpenAI 5.5 xhigh with local testing and review.


- 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.
Copilot AI review requested due to automatic review settings May 26, 2026 17:00
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 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 on HOMEBREW_UPGRADE_AUTO_UPDATES_CASKS + HOMEBREW_NO_UPGRADE_AUTO_UPDATES_CASKS conflicts when not in developer mode.
  • Add an RSpec example covering the developer-mode case where both variables are set (to reflect brew.sh exporting 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.

Comment thread Library/Homebrew/test/cask/upgrade_spec.rb
@p-linnane p-linnane added this pull request to the merge queue May 27, 2026
Merged via the queue into main with commit 63bab50 May 27, 2026
78 of 82 checks passed
@p-linnane p-linnane deleted the fix-cask-auto-updates-env-conflict branch May 27, 2026 02:17
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