Skip to content

Show versions of dependencies in dry-run - #24210

Merged
MikeMcQuaid merged 1 commit into
Homebrew:mainfrom
HaraldNordgren:dry-run-parenthesized-versions
Oct 10, 2026
Merged

MikeMcQuaid merged 1 commit into
Homebrew:mainfrom
HaraldNordgren:dry-run-parenthesized-versions

Conversation

@HaraldNordgren

@HaraldNordgren HaraldNordgren commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

brew install --dry-run lists the dependencies it would install or upgrade by name only, so you cannot see which versions would be installed. brew upgrade --dry-run already shows them.

This shows name version (or name old -> new for upgrades) for those dependencies, aligned in columns. The aligned upgrade summaries also now put download sizes in their own column instead of leaving them glued to the end of the version. The shared formatting moves to Formatter.version_changes, which now takes a new VersionChange value (name, old and new version, size) instead of formatted strings, so nothing has to be parsed back.

Before:

==> Would install 1 formula:
b4 0.16.0_1
==> Would install 20 dependencies for b4:
ca-certificates
certifi
pycparser
mpdecimal

After:

==> Would install 1 formula:
b4 0.16.0_1
==> Would install 20 dependencies for b4:
ca-certificates  2026-09-25
certifi          2026.7.22_1
pycparser        3.1_1
mpdecimal        4.0.1

Upgrade summaries with sizes, before:

sqlite            3.53.1   -> 3.53.2 (2.4MB)
mise              2026.6.0 -> 2026.6.11 (34.8MB)
sdl2              2.32.70 (636.8KB)
opencode-desktop  1.14.48  -> 1.17.9

After:

sqlite            3.53.1   -> 3.53.2     (2.4MB)
mise              2026.6.0 -> 2026.6.11  (34.8MB)
sdl2              2.32.70                (636.8KB)
opencode-desktop  1.14.48  -> 1.17.9

  • 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.

Claude Code (Claude Sonnet 5.5) helped write the change and its specs. I reviewed the output. Typecheck, style on formatter.rb and the install, upgrade, formatter, cask/upgrade, cmd/install and cmd/upgrade specs were run locally.


@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a52c3138-a987-4d57-96bd-9a3a32809d09

📥 Commits

Reviewing files that changed from the base of the PR and between 8ff8245 and 70b8a8f.


📒 Files selected for processing (13)
  • Library/Homebrew/cask/upgrade.rb
  • Library/Homebrew/cmd/install.rb
  • Library/Homebrew/cmd/upgrade.rb
  • Library/Homebrew/install.rb
  • Library/Homebrew/test/cask/upgrade_spec.rb
  • Library/Homebrew/test/cmd/install_spec.rb
  • Library/Homebrew/test/cmd/upgrade_spec.rb
  • Library/Homebrew/test/install_spec.rb
  • Library/Homebrew/test/spec_helper.rb
  • Library/Homebrew/test/upgrade_spec.rb
  • Library/Homebrew/test/utils/formatter_spec.rb
  • Library/Homebrew/upgrade.rb
  • Library/Homebrew/utils/formatter.rb

💤 Files with no reviewable changes (1)
  • Library/Homebrew/test/upgrade_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.


📜 Recent review details
⏰ Context from checks skipped due to timeout. (17)
  • GitHub Check: tests (Linux, 1/2)
  • GitHub Check: tests (no Sorbet)
  • GitHub Check: tests (Linux, 2/2)
  • GitHub Check: tests (online, 2/2)
  • GitHub Check: tests (generic OS, 2/2)
  • GitHub Check: tests (load-only macOS)
  • GitHub Check: tests (load-only Linux)
  • GitHub Check: tests (macOS, 2/2)
  • GitHub Check: tests (generic OS, 1/2)
  • GitHub Check: tests (macOS, 1/2)
  • GitHub Check: tests (online, 1/2)
  • GitHub Check: syntax
  • GitHub Check: docker (x86_64 Ubuntu 26.04)
  • GitHub Check: docker (arm64 Ubuntu 26.04)
  • GitHub Check: docker (x86_64 Ubuntu 24.04)
  • GitHub Check: docker (arm64 Ubuntu 24.04)
  • GitHub Check: docs

🧰 Additional context used
📚 Code guidelines (1)
Generated by CodeRabbit — auto-discovered

📓 Path-based instructions (2)
Test command behavior and its observable effects, including stdout, stderr, exit status, and state changes as relevant.

📄 CodeRabbit inference engine (Generated by CodeRabbit)

Files:

  • Library/Homebrew/test/cmd/install_spec.rb
  • Library/Homebrew/test/cmd/upgrade_spec.rb

Implement CLI commands as `Homebrew::Cmd` classes inheriting from `AbstractCommand`; declare help text and argument metadata in `cmd_args`, and put command behavior in `run`.

📄 CodeRabbit inference engine (Generated by CodeRabbit)

Files:

  • Library/Homebrew/cmd/install.rb
  • Library/Homebrew/cmd/upgrade.rb


📝 Summary

Summary by CodeRabbit

  • Improvements
    • Upgrade and installation summaries align package names, version changes, and available download sizes consistently.
    • Dependency plans display package versions, making planned changes easier to review.

Walkthrough

Upgrade and install summary paths now store version changes as structured VersionChange values. Formatter.version_changes formats formula, cask, and dependency summaries, including version transitions and optional download sizes.

Changes

Structured version summaries

Layer / File(s) Summary
VersionChange model and formatter
Library/Homebrew/version_change.rb, Library/Homebrew/utils/formatter.rb, Library/Homebrew/test/version_change_spec.rb, Library/Homebrew/test/utils/formatter_spec.rb, Library/Homebrew/test/support/helper/version_change.rb, Library/Homebrew/test/spec_helper.rb, Library/Homebrew/sorbet/rbi/shims/rspec.rbi
VersionChange stores package names, old and new versions, and optional sizes. Formatter.version_changes aligns these values for display. Tests cover formatting and value equality.
Formula and dependency summaries
Library/Homebrew/upgrade.rb, Library/Homebrew/install.rb, Library/Homebrew/test/upgrade_spec.rb, Library/Homebrew/test/install_spec.rb, Library/Homebrew/test/cmd/install_spec.rb
Formula and dependency install, upgrade, and dry-run summaries use VersionChange values. Formula download sizes remain separate values. Dependency output expectations include versions.
Upgrade and cask summary integration
Library/Homebrew/cmd/upgrade.rb, Library/Homebrew/cmd/install.rb, Library/Homebrew/cask/upgrade.rb, Library/Homebrew/test/cmd/upgrade_spec.rb, Library/Homebrew/test/cmd/install_spec.rb, Library/Homebrew/test/cask/upgrade_spec.rb
Upgrade recording, preview, final-summary, pinned-cask, and prefetch paths use VersionChange values. Specs now expect structured summary entries.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Suggested reviewers: mikemcquaid


Merge Risk | ⚪ Minimal · up to 70b8a

Merge Risk: ⚪ Minimal · up to 70b8a

The supplied evidence identifies no remaining issue that would prevent merging after normal checks.

Security Architecture Review

Security architecture risk: ⚪ Minimal · up to 70b8a

The structured summaries remain separate from package installation authority. The reviewed changes preserve confirmation, upgrade eligibility, dry-run exits, and success/failure handling. No material security risk introduced or worsened by this PR was established.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — In the traced paths, the change propagates across local formula and cask summaries without expanding installer targets or execution authority. The public-entrypoint and fanout signals resolve to a shared representation change rather than a new privileged boundary.

Trust Boundaries and Controls

  • observed — Confirmation previews now obtain package identity directly from VersionChange.name instead of splitting display text. Existing prompt checks and the post-confirmation summary reset remain in place. Cask eligibility checks and installer arguments remain separate from summary values.

Resilience and Maintainability Implications

  • observed — The inspected migration preserves existing failure containment: failed formula upgrades remain unsuccessful, cask failures follow existing rescue handling, and success summaries remain tied to execution results rather than prefetched display metadata.

Pre-merge checks | Passed 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly describes the main change: showing dependency versions during dry-run operations.
Description check Passed The description accurately explains the dry-run version display, aligned formatting, download-size changes, implementation approach, tests, and validation performed.
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.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@HaraldNordgren
HaraldNordgren force-pushed the dry-run-parenthesized-versions branch 3 times, most recently from f638049 to b846a4f Compare October 9, 2026 22:53
@HaraldNordgren HaraldNordgren changed the title Show versions in dry-run and upgrade summaries Parenthesise versions in upgrade summaries Oct 9, 2026
@HaraldNordgren
HaraldNordgren force-pushed the dry-run-parenthesized-versions branch 4 times, most recently from 53f5e31 to 6fc4def Compare October 9, 2026 23:11
@HaraldNordgren
HaraldNordgren marked this pull request as ready for review October 10, 2026 07:04

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1c202911-7b21-4ec3-b3bd-b6c2fe91b281
📥 Commits

Reviewing files that changed from the base of the PR and between 7a8f775 and 6fc4def.

📒 Files selected for processing (11)
  • Library/Homebrew/cask/upgrade.rb
  • Library/Homebrew/cmd/upgrade.rb
  • Library/Homebrew/install.rb
  • Library/Homebrew/test/cask/upgrade_spec.rb
  • Library/Homebrew/test/cmd/install_spec.rb
  • Library/Homebrew/test/cmd/upgrade_spec.rb
  • Library/Homebrew/test/install_spec.rb
  • Library/Homebrew/test/upgrade_spec.rb
  • Library/Homebrew/test/utils/formatter_spec.rb
  • Library/Homebrew/upgrade.rb
  • Library/Homebrew/utils/formatter.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.

📜 Review details
🧰 Additional context used
📚 Code guidelines (1)
Generated by CodeRabbit — auto-discovered
📓 Path-based instructions (2)
Test command behavior and its observable effects, including stdout, stderr, exit status, and state changes as relevant.

📄 CodeRabbit inference engine (Generated by CodeRabbit)

Files:

  • Library/Homebrew/test/cmd/install_spec.rb
  • Library/Homebrew/test/cmd/upgrade_spec.rb
Implement CLI commands as `Homebrew::Cmd` classes inheriting from `AbstractCommand`; declare help text and argument metadata in `cmd_args`, and put command behavior in `run`.

📄 CodeRabbit inference engine (Generated by CodeRabbit)

Files:

  • Library/Homebrew/cmd/upgrade.rb

Comment thread Library/Homebrew/utils/formatter.rb Outdated

@MikeMcQuaid MikeMcQuaid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry, not a fan. If the goal is to be more consistent, let's discuss deparenthesising some other cases.

@HaraldNordgren
HaraldNordgren force-pushed the dry-run-parenthesized-versions branch from 6fc4def to fa04d7e Compare October 10, 2026 09:16
@HaraldNordgren HaraldNordgren changed the title Parenthesise versions in upgrade summaries Show dependency versions in install dry-run Oct 10, 2026
@HaraldNordgren
HaraldNordgren force-pushed the dry-run-parenthesized-versions branch from fa04d7e to 8f07cd9 Compare October 10, 2026 09:20
@HaraldNordgren HaraldNordgren changed the title Show dependency versions in install dry-run Show versions of dependencies in dry-run Oct 10, 2026
@HaraldNordgren

Copy link
Copy Markdown
Contributor Author

@MikeMcQuaid Makes sense, removed the parantheses but kept the other changes.

@MikeMcQuaid MikeMcQuaid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, looks nice! Maybe just do the TODO now?

Comment thread Library/Homebrew/utils/formatter.rb Outdated
@HaraldNordgren

HaraldNordgren commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks, looks nice! Maybe just do the TODO now?

Sure, I don't mind!

But to do it properly I would like to touch every place on the code that passes pkg strings and parses like this. That might be a bigger change.

@HaraldNordgren
HaraldNordgren force-pushed the dry-run-parenthesized-versions branch from 8f07cd9 to 95efba9 Compare October 10, 2026 12:02
@HaraldNordgren

Copy link
Copy Markdown
Contributor Author

@MikeMcQuaid Done!

@MikeMcQuaid MikeMcQuaid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Much nicer! One more small tweak then good to go.

Comment thread Library/Homebrew/utils/formatter.rb Outdated
@HaraldNordgren
HaraldNordgren force-pushed the dry-run-parenthesized-versions branch 3 times, most recently from 8ff8245 to 0668c7a Compare October 10, 2026 16:08
- `brew install --dry-run` listed dependencies by name only; show the
  version to install or `old -> new` as `brew upgrade --dry-run` does.
- Pass `VersionChange` values to `Formatter.version_changes` instead of
  formatting and re-parsing strings.
- Align download sizes in their own column in upgrade summaries.
@HaraldNordgren
HaraldNordgren force-pushed the dry-run-parenthesized-versions branch from 0668c7a to 70b8a8f Compare October 10, 2026 16:09

@MikeMcQuaid MikeMcQuaid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@MikeMcQuaid
MikeMcQuaid enabled auto-merge October 10, 2026 16:58
@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue Oct 10, 2026
Merged via the queue into Homebrew:main with commit 3f794ba Oct 10, 2026
53 checks passed
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