Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR trims the Repology-derived distro mapping to reduce noisy/duplicative OSV queries, adds per-formula overrides for skipping unsuitable matches, and filters uncomparable matched advisories out of the client-facing data/advisories.json index so ingest output is more actionable.
Changes:
- Add
RepologyIndex.select_ecosystems,RepologyIndex.skipped_formulae, andRepologyIndex.trim, plus override-driven formula skipping and arake repology:trimtask. - Add
AdvisoryIndex.actionable?and excludesource: matchedadvisories that lackrange_statefrom the concatenated index (while tracking skipped count). - Replace the non-running Minitest file with RSpec coverage and tweak the ingest workflow runtime/verbosity/diagnostics.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/advisory_index_test.rb | Removes unused/non-CI Minitest coverage. |
| spec/advisory_index_spec.rb | Adds RSpec coverage for AdvisoryIndex including the new “actionable” filter and skipped count reporting. |
| lib/advisory_index.rb | Filters out uncomparable matched records from data/advisories.json and reports skipped count. |
| lib/repology_index.rb | Adds ecosystem selection policy, override-driven formula skipping, and an in-place trim mode. |
| spec/repology_index_spec.rb | Adds/updates specs for ecosystem selection, overrides skipping, and trim behavior. |
| spec/fixtures/repology_page2.json | Updates fixture data to include Ubuntu libzstd so preferred-ecosystem behavior is exercised. |
| data/overrides.yml | Introduces skip: true overrides (e.g., linux-headers formulae) to suppress unsuitable matching. |
| Rakefile | Adds repology:trim task for reapplying selection/override policy without re-crawling Repology. |
| .github/workflows/ingest.yml | Adjusts ingest job timeout, adds runner diagnostics, and runs brew advisory-match with --verbose. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
RepologyIndex.select_ecosystems keeps Debian+Ubuntu when present, else one
fallback ecosystem by priority (Alpine > openSUSE > Red Hat > Rocky > Alma >
Mageia > openEuler > FreeBSD). The distro strategy is CVE discovery for cases
git/registry missed; once a CVE id is found it is checked against the formula's
own identity, so one well-covered distro is sufficient. Sampling curl/openssl@3
showed CVEs reachable only via Mageia/Red Hat/openSUSE were srcname collisions
(Jenkins, wget, python-cryptography, PHP) or unresolved distro-native ids; a
random 15/15 sample of dropped records were false positives.
RepologyIndex also reads data/overrides.yml and drops `skip: true` formulae
from the index. linux-headers@{4.4,5.15,6.8} are skipped: the Repology mapping
to distro kernel packages is correct but kernel runtime CVEs do not apply to a
headers-only install. In --all mode Match runs with bulk: true and does not
fall back to live Repology, so a formula absent from the index with no
git/registry identity is skipped.
data/repology.json is retrimmed: 5460 -> 5457 formulae, 54129 -> 16000
srcnames. rake repology:trim reapplies the policy without re-crawling.
AdvisoryIndex.build now excludes source: matched records with no range_state
from data/advisories.json. Those records stay in advisories/ for review but
are not surfaced to brew vulns. On a full local run: 90820 candidates ->
20358 actionable (19247 fixed, 1111 affected) across 625 formulae. The
excluded records are 100% of distro-strategy and 98.7% of git-strategy hits;
registry-strategy records are ~all comparable.
spec/advisory_index_spec.rb replaces test/advisory_index_test.rb, which
required a nonexistent test_helper.rb and was never run in CI.
ingest.yml: --verbose so a failure shows how far it got, free -m/df -h before
the match, timeout 360 -> 180 (local run: 126.4 min, peak RSS 1678 MB).
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.
Makes the
ingest.ymlsweep complete and its output actionable. No brew changes required.RepologyIndex.select_ecosystemskeeps Debian+Ubuntu when present, otherwise one fallback ecosystem by priority. The distro strategy is CVE discovery for cases git/registry missed; once a CVE id is found it is checked against the formula's own identity, so one well-covered distro is sufficient and the rest add duplicate querybatch traffic and@vuln_cacheentries. Sampling curl and openssl@3 showed CVEs reachable only via the dropped ecosystems were srcname collisions (Jenkins, wget, python-cryptography, PHP) or unresolved distro-native ids; a random 15-record sample of dropped output were all false positives (bluez→kernel nilfs2, emacs→ImageMagick, icu4c→Chrome V8, and similar).RepologyIndexalso readsdata/overrides.ymland dropsskip: trueformulae from the index.linux-headers@{4.4,5.15,6.8}are skipped: the Repology mapping to distro kernel packages is correct but kernel runtime CVEs do not apply to a headers-only install, and those three formulae accounted for ~48k of ~122k candidate records in earlier runs. In--allmodeMatchruns withbulk: trueand does not fall back to live Repology, so a formula absent from the index with no git/registry identity is skipped.data/repology.jsonis retrimmed with the new policy: 54129 → 16000 srcnames, 5460 → 5457 formulae.rake repology:trimreapplies without re-crawling.AdvisoryIndex.buildexcludessource: matchedrecords with norange_statefromdata/advisories.json. Those records stay inadvisories/for review but are not surfaced tobrew vulns. On a full local run: 90820 candidates → 20358 actionable (19247 fixed, 1111 affected) across 625 formulae. The excluded set is 100% of distro-strategy and 98.7% of git-strategy hits; registry-strategy records are essentially all comparable. The consequence is that non-registry formulae (openssl@3, ffmpeg, curl, sqlite, go, openjdk, mysql) are absent from the client index untilVulnerability#range_statuscan evaluatetype: GITcommit-SHA ranges; that is the top brew-side follow-up.spec/advisory_index_spec.rbreplacestest/advisory_index_test.rb, which required a nonexistenttest_helper.rband was never run in CI.ingest.yml:--verboseso a failure shows progress,free -m/df -hbefore the match, timeout 360 → 180. Local end-to-end run with this config: 126.4 min, peak RSS 1678 MB, exit 0; git add/commit of the 90820 files ~54s, pack for push 43 MB.