Merged
Conversation
- avoid showing repeated quarantine alerts on `brew upgrade` when the app's own updater would usually not prompt again - keep quarantine in place through download and install so Gatekeeper still checks upgraded apps before first launch - only clear quarantine after install when the previous app was already accepted and signed `Identifier` or `TeamIdentifier` values do not change - keep quarantine when approval is missing or signing changes, so upgrades do not silently trust different code or malware - add upgrade and quarantine specs covering approval, signing changes, and partially unset signing metadata
97f3af8 to
b686c83
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to reduce repeated Gatekeeper/quarantine prompts during brew upgrade --cask by keeping quarantine enabled through download/install, then conditionally removing quarantine post-install only when prior user approval exists and the app’s signing identity hasn’t changed.
Changes:
- Add
Cask::Quarantine.user_approved?andCask::Quarantine.signing_identityhelpers (with specs). - Extend
Cask::Upgradewith logic intended to conditionally release quarantine after upgrade based on prior approval + signing identity match. - Add upgrade specs covering approval/signing scenarios.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| Library/Homebrew/cask/upgrade.rb | Adds upgrade-time logic to cache old approval/signing identity and (intended) conditional post-install quarantine release. |
| Library/Homebrew/cask/quarantine.rb | Adds helpers to detect user approval from quarantine xattr and to parse signing identity from codesign. |
| Library/Homebrew/test/cask/upgrade_spec.rb | Adds unit specs for the quarantine-release decision logic and prefetch quarantine behavior. |
| Library/Homebrew/test/cask/quarantine_spec.rb | Adds specs for user_approved? parsing and signing_identity parsing behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bevanjkay
approved these changes
Apr 21, 2026
Member
bevanjkay
left a comment
There was a problem hiding this comment.
Seems to work as intended in my local testing. Thanks!
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.
brew upgradewhen the app's own updater would usually not prompt againIdentifierorTeamIdentifiervalues do not changebrew lgtm(style, typechecking and tests) with your changes locally?Used OpenAI Codex with manual review, editing and testing.