-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Get dependencies from internal API #21049
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Follow-up from 0d0a1da to actually use the dependencies now included from the new internal JSON API.
There was a problem hiding this 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
dependenciesfield toFormulaStubstruct 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.
15a5e69 to
36438d2
Compare
There was a problem hiding this 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.
36438d2 to
9ca7d5e
Compare
There was a problem hiding this 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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
Pull request was converted to draft
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.