Skip to content

Improve updates of auto_updates casks#21962

Merged
MikeMcQuaid merged 1 commit intomainfrom
improve_auto_update_casks_upgrades
Apr 9, 2026
Merged

Improve updates of auto_updates casks#21962
MikeMcQuaid merged 1 commit intomainfrom
improve_auto_update_casks_upgrades

Conversation

@MikeMcQuaid
Copy link
Copy Markdown
Member

  • Add HOMEBREW_NO_UPGRADE_AUTO_UPDATES_CASKS enviroment variable to disable this behaviour entirely
  • Output this (and other relevant variables and flags) as environment hints with the usual option to disable their output
  • Detect and provide workaround instructions for casks with broken metadata directories during the upgrade process rather than blowing it up

Improves changed behaviour from #21882
Closes #21961
Fixes #21951
Fixes #21958


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

Hand coded.


Copilot AI review requested due to automatic review settings April 9, 2026 10:17
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 Homebrew Cask upgrade behavior around auto_updates true casks by adding an opt-out environment variable, surfacing relevant environment “hints” during upgrades, and attempting to avoid hard failures when installed cask metadata can’t be loaded.

Changes:

  • Add HOMEBREW_NO_UPGRADE_AUTO_UPDATES_CASKS EnvConfig entry and Sorbet RBI for disabling auto-updates bundle staleness upgrades.
  • Update cask upgrade messaging to print environment/flag hints (with HOMEBREW_NO_ENV_HINTS suppression).
  • Change upgrade flow to skip (with guidance) casks whose installed caskfile can’t be loaded, instead of aborting the entire upgrade.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 5 comments.

File Description
Library/Homebrew/sorbet/rbi/dsl/homebrew/env_config.rbi Adds Sorbet signatures for new env config accessors (but currently includes an extra accessor without runtime backing).
Library/Homebrew/env_config.rb Registers HOMEBREW_NO_UPGRADE_AUTO_UPDATES_CASKS in EnvConfig.
Library/Homebrew/cask/upgrade.rb Prints new env hints and changes handling of invalid/unloadable installed cask metadata during upgrade.
Library/Homebrew/cask/cask.rb Uses the new env var to short-circuit auto_updates_bundle_outdated?.
Files not reviewed (1)
  • Library/Homebrew/sorbet/rbi/dsl/homebrew/env_config.rbi: Language not supported

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

- Add `HOMEBREW_NO_UPGRADE_AUTO_UPDATES_CASKS` enviroment variable to disable
  this behaviour entirely
- Output this (and other relevant variables and flags) as environment hints with
  the usual option to disable their output
- Detect and provide workaround instructions for casks with broken metadata
  directories during the upgrade process rather than blowing it up
@MikeMcQuaid MikeMcQuaid force-pushed the improve_auto_update_casks_upgrades branch from 709a980 to 1ee8869 Compare April 9, 2026 11:07
@MikeMcQuaid MikeMcQuaid enabled auto-merge April 9, 2026 11:08
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Apr 9, 2026
@MikeMcQuaid
Copy link
Copy Markdown
Member Author

@yudgnahk Please slow down. You've opened 2 PRs and posted 3 nearly identical comments. Will review a follow-up PR to add 2 non-integration tests, thanks, as long as you've reviewed your AI output first.

@yudgnahk
Copy link
Copy Markdown

yudgnahk commented Apr 9, 2026

Sorry @MikeMcQuaid, it's a mistake.

Merged via the queue into main with commit 2ef4d83 Apr 9, 2026
38 checks passed
@MikeMcQuaid MikeMcQuaid deleted the improve_auto_update_casks_upgrades branch April 9, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants