Uh oh!
There was an error while loading. Please reload this page.
fix(server): brew upgrade the installed formula, not the configured one - #4910
fix(server): brew upgrade the installed formula, not the configured one#4910LacombeLouis wants to merge 1 commit into
Conversation
- derive the Homebrew package name from the binary's Cellar/Caskroom path so versioned siblings (e.g. `tool@latest`) upgrade the package that is actually installed - keep any tap prefix from the configured formula when swapping in the installed package name - fall back to the configured formula when no Homebrew path segment is found
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Approved 84d4dec Straightforward bug fix ensuring Homebrew upgrades target the actually-installed package name (derived from binary path) rather than the configured formula. Limited scope with good test coverage and simple string manipulation logic. You can customize Macroscope's approvability policy. Learn more. |
closing in favor of #6247, the newer implementation of the same Homebrew upgrade fix in the same production and test files. |
What Changed
tool@latest) upgrade the package that is actually installedWhy
Would not automatically update otherwis.
Checklist
Note
Low Risk
Localized change to Homebrew upgrade command selection in provider maintenance, with fallback to the previous formula name and added test coverage.
Overview
Homebrew provider updates now target the package name taken from the binary’s Cellar/Caskroom path (e.g.
package-tool@latest), instead of always using the configured formula (e.g.package-tool). That fixes one-click upgrades when Homebrew ships versioned siblings as separate packages.Tap-prefixed formulas still keep their tap segment; only the final package segment is replaced with the installed name. If no Cellar/Caskroom segment is found, behavior falls back to the configured formula.
Tests cover direct Caskroom/Cellar paths, tap prefixes, and resolution through a
binsymlink to Caskroom.Reviewed by Cursor Bugbot for commit 84d4dec. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix
brew upgradeto target the installed formula, not the configured onebrew upgradecommand was using the configured formula name rather than the actual installed package (e.g. from Cellar/Caskroom paths).extractHomebrewPackageNamein providerMaintenance.ts to detect the real package name from the binary's resolved path by looking forcellarorcaskroomsegments.resolveHomebrewPackageNameto replace only the package name segment of the configured formula, preserving any tap prefix (e.g.org/tap/package-tool@2→org/tap/scoped-package-tool@2).brew upgradearguments now use the installed package name derived from the binary path when available, rather than always using the configured formula.Macroscope summarized 84d4dec.