Skip to content

formulary: map resolves information from API#23114

Merged
Bo98 merged 1 commit into
mainfrom
api-resolves
Jul 15, 2026
Merged

formulary: map resolves information from API#23114
Bo98 merged 1 commit into
mainfrom
api-resolves

Conversation

@Bo98

@Bo98 Bo98 commented Jul 14, 2026

Copy link
Copy Markdown
Member

This fixes false positives with brew vulns when using the API


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

  • AI was used to generate or assist with generating this PR.

Copilot AI review requested due to automatic review settings July 14, 2026 20:33

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 PR updates Homebrew’s API-backed formula loading to preserve patch “resolves” metadata from the formula API JSON, which helps brew vulns avoid false positives when formulas are sourced from the API rather than from Ruby files.

Changes:

  • Map patches[].resolves[].id entries from API JSON into the in-memory patch resource when constructing formulas from API structs.
  • Extend the formulary spec to assert that ExternalPatch#resolves includes IDs provided by the API (e.g., CVE + issue URL).

Reviewed changes

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

File Description
Library/Homebrew/formulary.rb When building patches from API structs, passes API resolves IDs into the patch DSL via resolves(...).
Library/Homebrew/test/formulary_spec.rb Adds coverage asserting that patch resolves IDs from API JSON are reflected on the resulting ExternalPatch.

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

@Bo98
Bo98 added this pull request to the merge queue Jul 14, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 14, 2026
@Bo98
Bo98 added this pull request to the merge queue Jul 15, 2026
Merged via the queue into main with commit 62e6faa Jul 15, 2026
46 checks passed
@Bo98
Bo98 deleted the api-resolves branch July 15, 2026 01:17
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