vulns: read the advisory index from formulae.brew.sh - #23555
Merged
Conversation
The index is now generated from Homebrew/advisory-database's reviewed main and published by the formulae.brew.sh site build, so the client no longer depends on a generated file being committed to that repository. Feed downloads also request compressed transfer: the index is 67 MB raw and 14 MB gzip-encoded, and curl falls back to identity for hosts that do not compress. Signed-off-by: Patrick Linnane <patrick@linnane.io>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates brew vulns feed handling to consume the Homebrew advisory index from the formulae.brew.sh API instead of the advisory-database repository鈥檚 committed JSON, aligning the client with the published API artifact and reducing transfer size via HTTP compression.
Changes:
- Switch
Homebrew::Vulns::AdvisoryDatabaseto download fromhttps://formulae.brew.sh/api/advisories.json. - Enable compressed HTTP transfer for all
CachedFeeddownloads by adding--compressedto the curl invocation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| Library/Homebrew/vulns/cached_feed.rb | Adds --compressed to cached feed downloads to prefer gzip-encoded transfer where available. |
| Library/Homebrew/vulns/advisory_database.rb | Updates advisory index source URL and adjusts documentation comment to match the new publisher/location. |
馃挕 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
brew vulnsnow reads the advisory index from https://formulae.brew.sh/api/advisories.json, which the site build generates from Homebrew/advisory-database's reviewed main. The published file is byte-identical to the committeddata/advisories.jsonit replaces (SHA-256 verified), so this is a URL change only.Feed downloads also request compressed transfer: the index is 67 MB raw and 14 MB gzip-encoded, and curl falls back to identity for hosts that do not compress.
Once this reaches a stable tag, Homebrew/advisory-database stops committing the generated index; the raw URL keeps working until then.
brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?