Skip to content

bundle: upgrade remaining package types - #24445

Merged
MikeMcQuaid merged 1 commit into
mainfrom
bundle-package-upgrades
Nov 5, 2026
Merged

MikeMcQuaid merged 1 commit into
mainfrom
bundle-package-upgrades

Conversation

@MikeMcQuaid

Copy link
Copy Markdown
Member
  • Check Go, Cargo, uv, Krew, Flatpak and WinGet for available upgrades.
  • Request targeted VS Code upgrades.
  • Respect --no-upgrade and retain package sources and requirements.

  • 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 brew benchmark results.
  • 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.

Codex with GPT 6 Astra at High effort, with local review and testing.


@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features
    • brew bundle upgrade now checks for and upgrades outdated Cargo, Flatpak, Go, Krew, uv and WinGet packages, as well as installed VS Code extensions.
    • Up-to-date packages are skipped, and no_upgrade continues to prevent upgrades.
  • Bug Fixes
    • Installed packages with available updates can now proceed through the upgrade process instead of being skipped.
    • Status messages distinguish packages that need upgrading from those that need installing.
  • Documentation
    • Brew Bundle guidance now reflects version checks for Go, Cargo and uv packages.

Brew Bundle now checks supported installed packages and extensions for available upgrades. When upgrades are enabled, outdated entries proceed to package-manager-specific upgrade commands. Specs cover upgrade detection and installation behaviour across the affected extensions.

Changes: Brew Bundle package upgrades

Layer / File(s) Summary
Shared upgrade lifecycle
Library/Homebrew/bundle/extensions/extension.rb, Library/Homebrew/test/bundle/shared_examples/upgradable_extension.rb, docs/Brew-Bundle-and-Brewfile.md
The base extension checks upgrade status when deciding whether an installed package is up to date or should proceed to installation. Shared examples cover these cases. The documentation no longer states that Go, Cargo, and uv packages are not checked for newer versions.
Version and source upgrade checks
Library/Homebrew/bundle/extensions/cargo.rb, Library/Homebrew/bundle/extensions/go.rb, Library/Homebrew/bundle/extensions/krew.rb, Library/Homebrew/test/bundle/cargo_spec.rb, Library/Homebrew/test/bundle/go_spec.rb, Library/Homebrew/test/bundle/krew_spec.rb
Cargo, Go, and Krew compare installed package information with available versions or revisions. Their install paths use package-manager-specific upgrade commands. Specs cover comparisons, invalid or missing metadata, and upgrade scheduling.
Flatpak and uv upgrades
Library/Homebrew/bundle/extensions/flatpak.rb, Library/Homebrew/bundle/extensions/uv.rb, Library/Homebrew/test/bundle/flatpak_spec.rb, Library/Homebrew/test/bundle/uv_spec.rb
Flatpak checks its application update list and updates installed applications in individual and batch installs. uv uses a dry-run upgrade plan and the tool environment’s Python for upgrades. Specs cover checks, commands, and upgrade behaviour.
VS Code and WinGet upgrades
Library/Homebrew/bundle/extensions/vscode_extension.rb, Library/Homebrew/bundle/extensions/winget.rb, Library/Homebrew/test/bundle/vscode_extension_spec.rb, Library/Homebrew/test/bundle/winget_spec.rb, Library/Homebrew/test/cmd/bundle/exec_subcommand_spec.rb
VS Code uses forced installs for installed extensions and reports upgrade-check status. WinGet checks for available upgrades by package ID and selects its upgrade command for installed packages. Specs cover detection, command options, the no-upgrade setting, and execution with an installed extension.
Merge Risk: Moderate · up to d2a12

Upgrade checks may still fail or wait on remote lookups, and Go upgrades may be missed for pseudo-versions. Resolve these uncertainties before merging.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title clearly and concisely summarises the main change: adding upgrade support for the remaining package types.
Description check Passed The description directly relates to the changeset and identifies upgrade checks, targeted VS Code upgrades, --no-upgrade handling, source and requirement preservation, and testing.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bcf7a069-39ca-4469-96d6-14c5ff4c85ee
Commits

Reviewing files that changed from the base of the PR and between b6fee85 and d2a1246.

Files selected for processing: 2

  • Library/Homebrew/bundle/extensions/cargo.rb
  • Library/Homebrew/test/bundle/cargo_spec.rb

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@MikeMcQuaid
MikeMcQuaid force-pushed the bundle-package-upgrades branch from 1a1b207 to 1300c9d Compare November 2, 2026 15:20
@MikeMcQuaid
MikeMcQuaid enabled auto-merge November 2, 2026 16:52

@p-linnane p-linnane 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.

brew bundle check now fails for installed VS Code extensions, even immediately after a successful install. This also blocks brew bundle exec --check.

@MikeMcQuaid
MikeMcQuaid force-pushed the bundle-package-upgrades branch from 1300c9d to 8c8bda2 Compare November 3, 2026 09:25
@MikeMcQuaid

Copy link
Copy Markdown
Member Author

@p-linnane good catch, should be fixed now, can you take a look?

@MikeMcQuaid
MikeMcQuaid requested a review from p-linnane November 3, 2026 09:26

@coderabbitai coderabbitai Bot 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.

Follow-up Comments

Outside diff Skip the registry check for crates installed from a local path.

169-175: Major · Functional Correctness · Quick win

Skip the registry check for crates installed from a local path.

A Brewfile entry without source: matches a crate installed from a local path. The outdated check then queries crates.io with cargo info NAME. Two failures follow:

  • If the name is not on crates.io, cargo info exits non-zero. SystemCommand.run! raises, so the bundle check or upgrade aborts.
  • If crates.io has a newer crate with the same name, cargo install --locked NAME runs. Cargo does not overwrite the existing binary without --force, so the install can fail on the collision.

Return false when the installed record has a non-registry origin. The registry comparison does not apply to that record.

Suggested fix
         else
+          return false if installed[:origin].present?
+
           version_line = SystemCommand.run!(cargo, args: ["info", "--color=never", name],

Open the source location

Outside diff Preserve the installed uv requirement during upgrade detection and execution.

140-147: Minor · Functional Correctness · Quick win

Preserve the installed uv requirement during upgrade detection and execution.

The parser discards non-source requirements before the new upgrade path uses the installed tool metadata. The dry-run can therefore report an upgrade for a bare package name, and uv tool install --upgrade can replace the environment with a version outside the installed tool's upper bound. Retain the parsed requirement and pass it to both commands. Keep source requirements in the existing name @ source form.

Open the source location

Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d60b4241-af69-424a-9ea7-9a7995ffd16a
Commits

Reviewing files that changed from the base of the PR and between 1300c9d and 8c8bda2.

Files selected for processing: 2
  • Library/Homebrew/test/bundle/vscode_extension_spec.rb
  • Library/Homebrew/test/cmd/bundle/exec_subcommand_spec.rb

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@MikeMcQuaid
MikeMcQuaid force-pushed the bundle-package-upgrades branch from 8c8bda2 to 6d053df Compare November 3, 2026 10:38
@MikeMcQuaid
MikeMcQuaid force-pushed the bundle-package-upgrades branch from 6d053df to 2d302b7 Compare November 3, 2026 11:27
@MikeMcQuaid
MikeMcQuaid force-pushed the bundle-package-upgrades branch from 2d302b7 to 3f28fcd Compare November 4, 2026 08:32

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 79f8b15c-592c-4524-8952-ab6f4eddaf12
Commits

Reviewing files that changed from the base of the PR and between 2d302b7 and 3f28fcd.

Files selected for processing: 2
  • Library/Homebrew/bundle/extensions/go.rb
  • Library/Homebrew/test/bundle/go_spec.rb

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@MikeMcQuaid
MikeMcQuaid force-pushed the bundle-package-upgrades branch from 3f28fcd to be1321a Compare November 4, 2026 10:11

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (2)

Minor · Do not let a failed Krew index refresh abort the check. · krew.rb:82-84

Library/Homebrew/bundle/extensions/krew.rb:82-84
Minor · Stability & Availability · Quick win

Do not let a failed Krew index refresh abort the check.

When an index is unreachable, Krew returns a non-zero status and command_output raises before the receipt and local krew info lookup run. This can make the Krew check fail.

Continue with the local index after a refresh failure:

Suggested fix
             unless @indexes_updated
-              command_output(krew, args: ["update"])
+              begin
+                command_output(krew, args: ["update"])
+              rescue ErrorDuringExecution
+                nil
+              end
               @indexes_updated = true
             end
Minor · Rescue failed uv source resolution in package_outdated?. · uv.rb:140-147

Library/Homebrew/bundle/extensions/uv.rb:140-147
Minor · Stability & Availability · Quick win

Rescue failed uv source resolution in package_outdated?.

When an installed tool uses a supported remote source: URL that becomes unavailable, uv pip install --dry-run --upgrade can exit non-zero. SystemCommand.run! then raises ErrorDuringExecution, which escapes brew bundle check and brew bundle exec --check before either command reports its normal status or checks later entries. brew bundle check --no-upgrade avoids the lookup, but exec --check forces no_upgrade: false.

Suggested fix
           raise "Invalid uv upgrade plan for #{name}: #{output.inspect}"
         end
+      rescue ErrorDuringExecution
+        true
Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2957df68-00e1-4445-874e-9be8612f0c6e
Commits

Reviewing files that changed from the base of the PR and between 3f28fcd and be1321a.

Files selected for processing: 2
  • Library/Homebrew/bundle/extensions/go.rb
  • Library/Homebrew/test/bundle/go_spec.rb

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@MikeMcQuaid
MikeMcQuaid force-pushed the bundle-package-upgrades branch from be1321a to e481719 Compare November 4, 2026 11:03

@p-linnane p-linnane 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.

Both earlier comments are fixed. Two non-blocking notes inline.

@MikeMcQuaid
MikeMcQuaid force-pushed the bundle-package-upgrades branch from e481719 to b6fee85 Compare November 5, 2026 08:28

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e2752af2-706f-4053-a221-9d9c693a7c41
Commits

Reviewing files that changed from the base of the PR and between e481719 and b6fee85.

Files selected for processing: 6

  • Library/Homebrew/bundle/extensions/cargo.rb
  • Library/Homebrew/bundle/extensions/go.rb
  • Library/Homebrew/bundle/extensions/vscode_extension.rb
  • Library/Homebrew/test/bundle/cargo_spec.rb
  • Library/Homebrew/test/bundle/go_spec.rb
  • Library/Homebrew/test/bundle/vscode_extension_spec.rb

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

- Check Go, Cargo, uv, Krew, Flatpak and WinGet for available upgrades.
- Request targeted VS Code upgrades without failing installed checks.
- Respect `--no-upgrade` and retain package sources and requirements.
- Cache Go binary discovery between resets to avoid repeated scans.
- Preserve installed uv constraints and skip local Cargo crates.
- Warn and keep installed Go and Cargo packages on lookup failures.
- Run Go version lookups outside projects with vendored modules.
- Use SemVer precedence for Go pseudo-versions and prereleases.
- Disable Git terminal prompts when checking Cargo sources.
@MikeMcQuaid
MikeMcQuaid force-pushed the bundle-package-upgrades branch from b6fee85 to d2a1246 Compare November 5, 2026 09:03
@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit 3cea970 Nov 5, 2026
54 checks passed
@MikeMcQuaid
MikeMcQuaid deleted the bundle-package-upgrades branch November 5, 2026 09:43
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

⌂ 换网址