Refresh brew tap before upgrading in kernel upgrade#208
Merged
Conversation
brew upgrade doesn't refresh the tap, so right after a release the new
formula is invisible and the upgrade silently no-ops ("already installed")
while kernel upgrade reports a new version is available. Run brew update
first, and update the suggested-upgrade hint to match.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
masnwilliams
marked this pull request as ready for review
July 20, 2026 19:16
jarugupj
approved these changes
Jul 20, 2026
jarugupj
left a comment
Contributor
There was a problem hiding this comment.
LGTM
non blocking: for cmd/upgrade.go:103 - could we add a small unit test confirming brew update runs before brew upgrade?
Assert brew update runs before brew upgrade, and cover the command args and display string per install method. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Author
|
Added |
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.
Summary
kernel upgradedetects a newer version from GitHub releases, then shells out tobrew upgrade kernel/tap/kernel. Butbrew upgradedoesn't refresh the tap on its own, and Homebrew throttles its auto-update — so right after a release the local tap is stale, brew still sees the old formula, and the upgrade silently no-ops with "already installed" (exit 0). The user seeskernel upgradeannounce a new version and then nothing changes.Repro: release a new version, then on a machine whose tap hasn't refreshed run
kernel upgrade→ "New version available: X → Y" followed by "Warning: kernel/tap/kernel X already installed", no upgrade.Fix
kernel upgradenow runsbrew updatebeforebrew upgrade kernel/tap/kernel(brew method only; npm/pnpm/bun already pull@latest).executeUpgrade/upgradeCommandArgsrefactored to run an ordered list of commands so the brew path can do two steps; stderr from all steps is still captured for the existing old-tap error diagnosis.brew update && brew upgrade kernel/tap/kernelfor the same reason.Testing
go build ./...,go vet,gofmt, andgo test ./pkg/update/...all pass (suggestion-string test updated).Note
Low Risk
CLI-only change to upgrade command sequencing and user-facing hints; no auth, data, or core runtime behavior beyond fixing stale-tap brew upgrades.
Overview
Fixes Homebrew upgrades silently doing nothing right after a release when the local tap is stale:
kernel upgradenow runsbrew updatebeforebrew upgrade kernel/tap/kernelfor the brew install path only.Upgrade execution is refactored so each install method returns an ordered list of shell commands (
[][]string).executeUpgraderuns them sequentially and still aggregates stderr across steps for the existing old-tap error handling. Dry-run / displayed commands usebrew update && brew upgrade kernel/tap/kernel.Passive upgrade hints in
SuggestUpgradeCommand(brew and unknown-method fallback) use the same two-step brew string. Tests cover brew command ordering and the updated suggestion text.Reviewed by Cursor Bugbot for commit 1332054. Bugbot is set up for automated code reviews on this repo. Configure here.