Skip to content

fix(brew): remove silent cask-to-formula fallback in retry path#104

Merged
fullstackjam merged 1 commit into
mainfrom
fix/remove-silent-cask-formula-fallback
May 25, 2026
Merged

fix(brew): remove silent cask-to-formula fallback in retry path#104
fullstackjam merged 1 commit into
mainfrom
fix/remove-silent-cask-formula-fallback

Conversation

@fullstackjam
Copy link
Copy Markdown
Collaborator

Summary

  • Bug: installSmartCaskWithError silently tried brew install <pkg> (formula) when brew install --cask <pkg> failed. If the formula install succeeded, the function returned success and the caller appended the package to installedCasks — the user never knew a different package type was installed (e.g. docker CLI instead of Docker Desktop).
  • Fix: Removed the unconditional formula fallback. Cask failures are now reported as failures, with retry logic preserved for transient errors (timeouts, connection refused, etc.).
  • The hint-based reverse fallback in installFormulaWithError (where brew itself suggests "try again using --cask") is left intact — that one is correct.

Test plan

  • TestInstallSmartCask_NeverFallsBackToFormula — cask failure returns an error, does not silently succeed
  • TestInstallSmartCask_RetriesOnTransientError — transient errors still retry up to 3 times, succeed when the error clears
  • Full L1 suite passes (go test ./internal/...)
  • Archtest baselines regenerated for shifted line numbers

installSmartCaskWithError silently tried `brew install <pkg>` (formula)
when `brew install --cask <pkg>` failed. If the formula succeeded the
caller reported "retry succeeded" and appended to installedCasks — the
user never knew a different package type was installed.

Remove the formula fallback so a cask failure is reported as a failure.
The hint-based fallback in installFormulaWithError (where brew itself
says "try again using --cask") is left intact.
@github-actions github-actions Bot added brew Homebrew related tests Tests only labels May 25, 2026
@fullstackjam fullstackjam merged commit 0fd6cd6 into main May 25, 2026
12 checks passed
@fullstackjam fullstackjam deleted the fix/remove-silent-cask-formula-fallback branch May 25, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

brew Homebrew related tests Tests only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant