Skip to content

Prepare combined upgrade planning - #23548

Open
MikeMcQuaid wants to merge 1 commit into
batched-install-primitivesfrom
upgrade-install-planning
Open

Prepare combined upgrade planning#23548
MikeMcQuaid wants to merge 1 commit into
batched-install-primitivesfrom
upgrade-install-planning

Conversation

@MikeMcQuaid

@MikeMcQuaid MikeMcQuaid commented Aug 17, 2026

Copy link
Copy Markdown
Member
  • return successful formula and cask upgrades to callers
  • retain prefetched installers and dependant download plans
  • deduplicate package summaries before execution

  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • Have you explained what your changes do? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • I did not use AI/LLM to create this PR, or I disclosed the tool/model below and reviewed its output; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.

OpenAI Codex 5.6 GPT Sol xhigh with local review and testing.


@github-actions

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot closed this Aug 17, 2026
@MikeMcQuaid MikeMcQuaid reopened this Aug 17, 2026
@MikeMcQuaid
MikeMcQuaid requested a lite review from Copilot August 17, 2026 16:20
@MikeMcQuaid
MikeMcQuaid marked this pull request as ready for review August 17, 2026 16:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 FormulaInstaller instances.
  • 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::Installer instances; 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. If prefetched_cask_installers is provided by a caller (e.g. from an earlier planning/prefetch step), the Cask instances 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.

Comment thread Library/Homebrew/cask/upgrade.rb Outdated
prefetch_download_queue = download_queue || Homebrew.default_download_queue
begin
fetchable_cask_installers = []
prefetched_cask_installers = []
@MikeMcQuaid
MikeMcQuaid force-pushed the upgrade-install-planning branch from cce3cfc to 18b30e7 Compare August 17, 2026 19:24
- return successful formula and cask upgrades to callers
- retain prefetched installers and dependant download plans
- deduplicate package summaries before execution
@MikeMcQuaid
MikeMcQuaid force-pushed the upgrade-install-planning branch from 18b30e7 to ca64885 Compare August 17, 2026 19:46
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