Prepare combined upgrade planning - #23548
Conversation
|
Thanks for your pull request. This has been closed because it appears to be missing the pull request template, perhaps because this was written by an AI not a human. We require humans to read and fill in these templates. Please edit this pull request to fill in the current pull request template. This workflow will reopen this pull request automatically once the template is complete. Do not open a new pull request for this. |
There was a problem hiding this comment.
Pull request overview
This pull request prepares brew upgrade for combined/batched upgrade planning by making upgrade routines return richer results and by enabling reuse of prefetched installers and download plans across steps.
Changes:
- Refactors formula installer selection for dependents and adds helper APIs to reuse prefetched
FormulaInstallerinstances. - Extends formula upgrades with a
cleanup:switch to allow deferring cleanup until after a batch completes. - Enhances cask upgrades to deduplicate summary output and optionally record upgraded casks / reuse prefetched
Cask::Installerinstances; updates specs accordingly.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Library/Homebrew/upgrade.rb | Refactors dependent formula filtering, adds support for prefetched installers, and introduces deferred cleanup control during upgrades. |
| Library/Homebrew/cask/upgrade.rb | Adds deduped summaries plus plumbing to reuse prefetched cask installers and record upgraded casks. |
| Library/Homebrew/test/upgrade_spec.rb | Adds/adjusts tests for deferred cleanup and prefetched dependent installer behavior. |
| Library/Homebrew/test/cask/upgrade_spec.rb | Updates tests for new cask-upgrade behaviors and installer plumbing. |
Suppressed comments (1)
Library/Homebrew/cask/upgrade.rb:284
- Matching a prefetched installer with
installer.cask.equal?(new_cask)relies on object identity. Ifprefetched_cask_installersis provided by a caller (e.g. from an earlier planning/prefetch step), theCaskinstances may not be the same object even when they represent the same token, causing the prefetched installer not to be reused and potentially re-downloading. Match on a stable identifier (e.g.full_name/token) instead.
upgradable_casks.each_with_index do |(old_cask, new_cask), index|
new_cask_installer = prefetched_cask_installers.find { |installer| installer.cask.equal?(new_cask) }
upgrade_cask(
馃挕 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
| prefetch_download_queue = download_queue || Homebrew.default_download_queue | ||
| begin | ||
| fetchable_cask_installers = [] | ||
| prefetched_cask_installers = [] |
cce3cfc to
18b30e7
Compare
- return successful formula and cask upgrades to callers - retain prefetched installers and dependant download plans - deduplicate package summaries before execution
18b30e7 to
ca64885
Compare
brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?OpenAI Codex 5.6 GPT Sol xhigh with local review and testing.