Skip to content

Conversation

@MikeMcQuaid
Copy link
Member

@MikeMcQuaid MikeMcQuaid commented Nov 13, 2025

Follow-up from #21042 to actually use the dependencies now included from the new internal JSON API.

While we're here, use this in a few cases to demonstrate it works.

Follow-up from 0d0a1da to actually use the dependencies now included
from the new internal JSON API.
Copilot AI review requested due to automatic review settings November 13, 2025 09:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements the consumption of dependency data from the internal JSON API for formulae, following up on PR #21042 which added the field to the API response. The changes enable Homebrew to retrieve and store formula dependency information directly from the API.

Key Changes

  • Added dependencies field to FormulaStub struct to store formula dependencies
  • Updated API internal module to extract dependencies from the JSON response array
  • Modified test fixtures to include dependency data for proper test coverage

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
Library/Homebrew/formula_stub.rb Added dependencies field as an array of strings with empty array default, and included it in equality comparison
Library/Homebrew/api/internal.rb Extracted dependencies from API response at index 4 and updated type signature for formula_arrays return type
Library/Homebrew/test/api/internal_spec.rb Updated test fixtures with dependency arrays for all test formulae and adjusted stub generation to destructure dependencies

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MikeMcQuaid MikeMcQuaid force-pushed the internal_api_dependencies branch from 36438d2 to 9ca7d5e Compare November 13, 2025 12:56
Copilot AI review requested due to automatic review settings November 14, 2025 02:45
Copy link
Member

@Rylan12 Rylan12 left a comment

Choose a reason for hiding this comment

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

This is looking really good!

I pushed a change to Formulary to add depends_on lines for the newly available dependencies

outdated -= pinned
formulae_to_install = outdated.map do |f|
f_latest = f.latest_formula
f_latest = f.latest_formula(prefer_stub: true)
Copy link
Member

Choose a reason for hiding this comment

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

I think we need the full formula here, since this is what we're going to end up installing.

Even if we have dependency info in the minimal API, we'll also need things like pour_bottle?, license, and other data to do proper install checks

Copy link
Member Author

Choose a reason for hiding this comment

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

@Rylan12 I think we need to rethink the approach here then. We probably need to get a list of stub formulae to install and then convert to full formulae later. The experience of running brew upgrade and seeing it download a JSON file for more than it'll then go to download a bottle manifest for and then an archive is pretty bad, particularly when it's not parallelised.

If we can't switch the pre-upgrade to be able to entirely use a stub I think we'll need to instead move to downloading manifests and doing so in a download queue (avoiding redownload later).

This is maybe where #21050 comes in.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MikeMcQuaid MikeMcQuaid marked this pull request as draft November 14, 2025 12:03
auto-merge was automatically disabled November 14, 2025 12:03

Pull request was converted to draft

@p-linnane p-linnane deleted the internal_api_dependencies branch November 28, 2025 06:18
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.

3 participants