Skip to content

upgrade,reinstall: make resilient to individual failures#21618

Merged
MikeMcQuaid merged 1 commit intoHomebrew:mainfrom
koddsson:upgrade-reinstall-resilient-to-individual-failures
Feb 24, 2026
Merged

upgrade,reinstall: make resilient to individual failures#21618
MikeMcQuaid merged 1 commit intoHomebrew:mainfrom
koddsson:upgrade-reinstall-resilient-to-individual-failures

Conversation

@koddsson
Copy link
Contributor

Summary

  • Follow-up to uninstall: make resilient to individual failures #21617 (uninstall resilience). Applies the same pattern to brew upgrade and brew reinstall: when some named arguments can't be resolved, the valid ones are still processed and unavailable names are reported via ofail at the end.
  • For upgrade, guards against empty resolved lists accidentally triggering the "upgrade all outdated" path when names were given but all failed resolution.
  • Adds per-cask error collection to Cask::Reinstall.reinstall_casks (matching the existing pattern in Cask::Upgrade.upgrade_casks! and Cask::Uninstall.uninstall_casks).

Test plan

  • brew tests --only=cmd/upgrade — all pass
  • brew tests --only=cmd/reinstall — all pass
  • brew tests --only=cask/reinstall — all pass
  • brew style --fix --changed — no offenses
  • New integration test: brew upgrade valid_formula nonexistent upgrades the formula and exits non-zero
  • New integration test: brew reinstall valid_formula nonexistent reinstalls the formula and exits non-zero
  • New unit test: when one cask reinstall raises, remaining casks are still reinstalled

🤖 Generated with Claude Code

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@koddsson Thanks again! One note on tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@koddsson koddsson force-pushed the upgrade-reinstall-resilient-to-individual-failures branch from a16dec2 to 4d2c2c9 Compare February 24, 2026 10:23
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again @koddsson!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Feb 24, 2026
Merged via the queue into Homebrew:main with commit 73daad7 Feb 24, 2026
36 checks passed
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.

2 participants