Skip to content
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

feat: create dedicated ecosystem name enum with all ecosystems #296

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 47 additions & 3 deletions validation/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"type": "object",
"properties": {
"ecosystem": {
"$ref": "#/$defs/ecosystem"
"$ref": "#/$defs/ecosystemWithSuffix"
},
"name": {
"type": "string"
Expand Down Expand Up @@ -296,11 +296,55 @@
"modified"
],
"$defs": {
"ecosystem": {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if changing this ecosystem name will break anyone's workflow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about that, but figured the likelihood anyone is depending on the name specifically right now is pretty low especially given no one seems to have caught how out of date this field actually is 😅

(the name should only matter if you're extending the schema in some way - if you're just using it for validating JSON files then at most it should result in a slightly different error message which shouldn't be depended on anyway)

"ecosystemName": {
"type": "string",
"title": "Currently supported ecosystems",
"description": "These ecosystems are also documented at https://ossf.github.io/osv-schema/#affectedpackage-field",
"pattern": "^(AlmaLinux|Alpine|Android|Bioconductor|Bitnami|Chainguard|ConanCenter|CRAN|crates.io|Debian|GHC|GitHub Actions|GIT|Go|Hackage|Hex|Linux|Maven|npm|NuGet|openSUSE|OSS-Fuzz|Packagist|Photon OS|Pub|PyPI|Red Hat|Rocky Linux|RubyGems|SUSE|SwiftURL|Ubuntu|Wolfi)(:[0-9]+)?"
"enum": [
"AlmaLinux",
"Alpine",
"Android",
"Bioconductor",
"Bitnami",
"Chainguard",
"ConanCenter",
"CRAN",
"crates.io",
"Debian",
"GHC",
"GitHub Actions",
"Go",
"Hackage",
"Hex",
"Linux",
"Mageia",
"Maven",
"npm",
"NuGet",
"OSS-Fuzz",
"openSUSE",
"Packagist",
"Photon OS",
"Pub",
"PyPI",
"Red Hat",
"Rocky Linux",
"RubyGems",
"SUSE",
"SwiftURL",
"Ubuntu",
"Wolfi"
]
},
"ecosystemSuffix": {
"type": "string",
"pattern": ":.+"
},
"ecosystemWithSuffix": {
"type": "string",
"title": "Currently supported ecosystems",
"description": "These ecosystems are also documented at https://ossf.github.io/osv-schema/#affectedpackage-field",
"pattern": "^(AlmaLinux|Alpine|Android|Bioconductor|Bitnami|Chainguard|ConanCenter|CRAN|crates\\.io|Debian|GHC|GitHub Actions|Go|Hackage|Hex|Linux|Mageia|Maven|npm|NuGet|OSS-Fuzz|openSUSE|Packagist|Photon OS|Pub|PyPI|Red Hat|Rocky Linux|RubyGems|SUSE|SwiftURL|Ubuntu|Wolfi|GIT)(:.+)?$"
},
"prefix": {
"type": "string",
Expand Down
Loading