fix(progress): show bytes/speed/ETA during formula installs#97
Merged
Conversation
Formula installs only rendered "[n/N] pkg" in the bottom status line while casks showed "[n/N] pkg 12M/189M · 7M/s · ~24s" — the head split was the visible inconsistency users noticed during longer formula downloads like vhs. Parameterize CacheTracker by CacheKind (cask|formula) so it queries `brew --cache --formula <name>` for bottles, wire a tracker into the formula install loop the same way installCasksWithProgress does, and collapse formatFormulaHead / formatCaskHead into a single formatHead. SetPhase stays — it still gates the per-package byte-state reset.
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
runSerialInstallWithProgressnow starts aCacheTrackerper formula and pumpsSetCurrentBytes— mirroringinstallCasksWithProgress. Formula installs in a Tart VM showed only[1/5] vhs 2%while casks showed12M/189M · 7M/s · ~24s; the head now matches.CacheTrackeris parameterized byCacheKind(cask|formula) so it resolves the right cache path viabrew --cache --formula <name>for bottles. Same.incomplete → renamepolling works for both.formatFormulaHeadandformatCaskHeadcollapse into oneformatHead.SetPhasestays — it still does the per-package byte-state reset on phase transition.Test plan
go vet ./...make test-unit(L1 — archtest baseline regen included sincebrewInstallCmdshifted from line 400 → 433; same exec.Command call site)NewCacheTrackertable-test for both kinds;formatHeadshows bytes/speed/ETA for both phases and falls back to— · — · —when data is missingopenboot install(the original repro environment)