Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

New data source: Homebrew

未关闭
#5,659 2 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
68/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
冷清
技术栈
go, python

调研方向

先从 purl_helpers.py 和 _ecosystems.py 开始,然后检查 issue 中引用的现有生态系统和版本比较实现。按照指定的 pkg:brew 映射和顺序添加 Homebrew API 支持,并检查 source_test.yaml 和 source.yaml 中的导入条目。完成标准是可以查询和导入 Homebrew advisories;go/osv/ecosystem/ 和 go/purl/ 中的 Go 条目是可选的。

由索引模型根据 Issue 内容生成。

描述

datasource

Homebrew publishes OSV-format advisory records at https://github.com/Homebrew/advisory-database under the Homebrew ecosystem with BREW- ids and pkg:brew purls. This issue tracks onboarding it as an osv.dev data source.

  • Prepare your data — records validate against the OSV schema (checked on every push in the source repo)
  • Create a PR to reserve an ID prefix and define a new ecosystem — ossf/osv-schema#576 (merged); URLs and version-ordering language in ossf/osv-schema#580
  • Prepare and publish your records via a Git repository — https://github.com/Homebrew/advisory-database (advisories/*.json)
  • To support API querying, please create a PR to extend purl_helpers.py and create a new ecosystem in _ecosystems.py — see below
  • Create a PR to start importing into source_test.yaml
  • Create a PR to start importing into source.yaml

For the ecosystem/purl PR: pkg:brew maps to Homebrew with no namespace (EcosystemPURL('brew', None)). Version comparison is Homebrew's PkgVersion: an upstream version segment ordered by Homebrew's Version class, then a numeric _N revision suffix (e.g. 1.81.6_5 < 1.81.6_6 < 1.82.0). There isn't a Homebrew comparator in third_party/univers or osv-scalibr/semantic today so this needs a small new implementation; the _sort_key shape is (version_tokens, revision_int). Happy to also add the Go-side entries in go/osv/ecosystem/ and go/purl/ in the same PR if that's preferred over Python-only.

Proposed source_test.yaml entry:

- name: homebrew
  type: 0
  repo_url: https://github.com/Homebrew/advisory-database
  db_prefix: [BREW]
  accepted_ecosystems: [Homebrew]
  human_link: https://github.com/Homebrew/advisory-database/blob/main/advisories/
  link: https://raw.githubusercontent.com/Homebrew/advisory-database/main/advisories/
  directory_path: advisories
  extension: '.json'

Background: https://github.com/orgs/Homebrew/discussions/6869. pkg:brew was registered in package-url/purl-spec#796.

主要语言
Go
星标
3k
派生
382
平均合并
1 天 10 小时
30 天内合并 PR
130

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

google/osv.dev 的其他 Issue

查看 google/osv.dev 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。