Repository navigation
[Brew] Uninstall a tap's packages before removing it on every Homebrew version - #31853
Conversation
- Merge branch \'contributions/merge-1790979343010\' into feature/third-party-taps - Pull contributions - Merge branch \'fix/untap-uninstall\' of /Users/messina/Developer/GitHub/chrismessina/brew into feature/third-party-taps - fix(taps): uninstall a tap\'s packages explicitly before untapping
|
Thank you for your contribution! 🎉 🔔 @nhojb @Aayush9029 @mathieudutour @urwrstkn8mare @ashokbaruaakas @MillerApps @pernielsentikaer @jfkisafk @vpukhanov @j3lte @alexander-cato @ViGeng @ridemountainpig @clins1994 @alexibuild you might want to have a look. You can use this guide to learn how to check out the Pull Request locally in order to test it. 📋 Quick checkout commandsBRANCH="ext/brew"
FORK_URL="https://github.com/chrismessina/extensions.git"
EXTENSION_NAME="brew"
REPO_NAME="extensions"
git clone -n --depth=1 --filter=tree:0 -b $BRANCH $FORK_URL
cd $REPO_NAME
git sparse-checkout set --no-cone "extensions/$EXTENSION_NAME"
git checkout
cd "extensions/$EXTENSION_NAME"
npm install && npm run devWe're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 15 business days. |
- Merge branch \'fix/untap-uninstall\' of /Users/messina/Developer/GitHub/chrismessina/brew into feature/third-party-taps - fix: progress toast overwriting its own result; untap without autoremove
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d2315ee. Configure here.
- Merge branch \'fix/untap-uninstall\' of /Users/messina/Developer/GitHub/chrismessina/brew into feature/third-party-taps - fix(toast): ignore Cancel once the action has finished
|
This comment has been minimized.
This comment has been minimized.
- Merge branch \'fix/untap-uninstall\' of /Users/messina/Developer/GitHub/chrismessina/brew into feature/third-party-taps - fix(taps): refresh the list after any attempted add or remove
|
@greptile Fixed in |
|
The fix addresses the retry path. After a successful cask uninstall followed by a formula failure, |
- Merge branch \'fix/untap-uninstall\' of /Users/messina/Developer/GitHub/chrismessina/brew into feature/third-party-taps - fix(toast): send hides at once, never after the settle gap
- Merge branch \'fix/untap-uninstall\' of /Users/messina/Developer/GitHub/chrismessina/brew into feature/third-party-taps - revert(toast): take the settle-gap toast changes out of this PR
|
Published to the Raycast Store: |
|
🎉 🎉 🎉 We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag. |
| @@ -1,5 +1,10 @@ | |||
| # Brew Changelog | |||
|
|
|||
| ## [Remove Tap fix] - 2026-10-04 | |||
There was a problem hiding this comment.
The new CHANGELOG.md heading uses 2026-10-04 instead of the required {PR_MERGE_DATE}. The merge workflow skips entries without that placeholder. If this PR merges on another day, users will see the wrong release date. Restore the placeholder before merging.
| ## [Remove Tap fix] - 2026-10-04 | |
| ## [Remove Tap fix] - {PR_MERGE_DATE} |
Rule Used: What: Changelog entries must use {PR_MERGE_DATE} placeholder in titles, be placed at the top of the file, and maintain descending version order. Why: Standardized placeholders and consistent ordering ensure changelogs are maintainable and merge da... (source)
Knowledge Base Used: Contributor validation tooling
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/brew/CHANGELOG.md
Line: 3
Comment:
**Release date stays fixed**
The new `CHANGELOG.md` heading uses `2026-10-04` instead of the required `{PR_MERGE_DATE}`. The merge workflow skips entries without that placeholder. If this PR merges on another day, users will see the wrong release date. Restore the placeholder before merging.
```suggestion
## [Remove Tap fix] - {PR_MERGE_DATE}
```
**Rule Used:** What: Changelog entries must use `{PR_MERGE_DATE}` placeholder in titles, be placed at the top of the file, and maintain descending version order. Why: Standardized placeholders and consistent ordering ensure changelogs are maintainable and merge da... ([source](https://app.greptile.com/raycast/-/custom-context?memory=c2214c11-df56-490a-b1c0-09a385df481a))
**Knowledge Base Used:** [Contributor validation tooling](https://app.greptile.com/raycast/-/custom-context/knowledge-base/raycast/extensions/-/docs/contributor-validation-tooling.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Description
Fixes Remove Tap on older Homebrew 6 releases (reported by Cursor Bugbot on #31820), plus two follow-ups Bugbot and Greptile found in the fix itself.
When a tap still has installed packages, Remove Tap confirms that they will be uninstalled first, and it ran
brew untap --force. That flag uninstalls the tap's formulae and casks first only from Homebrew 6.0.13 (Homebrew commitc1feb84ef4, 2026-07-23,cmd/untap.rb). On 6.0.0–6.0.12, which this extension still supports,--forcemeant "untap even though packages are installed" and left them behind with no tap.Remove Tap now runs the steps itself, the same on every version:
HOMEBREW_NO_AUTOREMOVE=1 brew uninstall --cask <user/repo/token…>(casks first, since a cask can depend on a formula)HOMEBREW_NO_AUTOREMOVE=1 brew uninstall --formula <user/repo/name…>brew untap <user/repo>, with no--forceThe run stops at the first failure, so if Homebrew refuses to uninstall a package (another package depends on it, say), the tap is kept and the failure toast says why. The confirmation text is unchanged and is now true on every version.
Autoremove is off for the uninstalls, as it is inside
untap --force(neithercmd/untap.rbnoruninstall.rbautoremoves). Left on, uninstalling the casks removes the tap's formulae that were installed only as their dependencies, the formula step then fails on a package already gone, and the tap stays (Bugbot, below).untapCommandsinsrc/utils/brew/taps.tsbuilds the commands and has five new unit tests. The behavior and the version boundary are written up inAGENTS.md.After a Remove Tap that stops partway (the casks uninstalled, a formula then refused), the list now refreshes whenever a command ran, not only on full success, so trying again starts at the step that failed instead of the casks that are already gone (Greptile, below).
A progress-toast fix was in an earlier revision of this PR and has been taken out; it will come back separately. 417 unit tests;
tsc,ray lintandray buildare clean.Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare placed outside of themetadatafolderNote
Medium Risk
Changes destructive Remove Tap behavior across Homebrew versions; logic is explicit and tested, but failed or partial uninstalls still affect real packages and tap state.
Overview
Remove Tap no longer relies on
brew untap --force, which on Homebrew 6.0.0–6.0.12 could remove the tap while leaving its packages installed despite the confirmation text. It now runs an explicit sequence via newuntapCommands: uninstall tap casks, then formulae (withHOMEBREW_NO_AUTOREMOVE=1), then a plainbrew untap, stopping on the first failure so a refused uninstall keeps the tap.Manage Taps tracks installed tap packages as
TapInstalls(formulae vs casks) for that flow, uses multi-step labeling (stepNoun), and refreshes the list after any started run (Add Tap and Remove Tap), not only full success—so a partial remove can be retried without re-attempting already removed casks.Adds unit tests for
untapCommandsand updates AGENTS.md, CHANGELOG, and TODO.md (documents the toast finish-in-place follow-up separately from this fix).Reviewed by Cursor Bugbot for commit 89cf641. Bugbot is set up for automated code reviews on this repo. Configure here.