Skip to content

Commit d671870

Browse files
authored
docs: Update contributing doc with some detailed steps (#396)
Also updates the update-ecosystem-lists.py script to copy the schema.json file over to the linter. (This avoids people having to run go generate on the linter as an extra step) Signed-off-by: Rex P <[email protected]>
1 parent bfdba29 commit d671870

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

CONTRIBUTING.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,22 @@ All submissions, including submissions by project members, require review. We
2121
use GitHub pull requests for this purpose. Consult
2222
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
2323
information on using pull requests.
24+
25+
## Adding a new ecosystem
26+
27+
To add a new ecosystem, follow these steps:
28+
29+
1. **`ecosystems.json`**: Add an entry for the new ecosystem and it's description.
30+
* If your ecosystem has multiple separate release, please include how releases are specified.
31+
32+
2. **Database-specific prefix**: Generally a new ecosystem will introduce a new database-specific ID prefix (e.g., `GHSA` for GitHub Security Advisories), please add it to:
33+
* The "Database-specific prefixes" table in `docs/schema.md`.
34+
* The `prefix` pattern within `validation/schema.json`.
35+
36+
3. **`README.md`**: Add the new ecosystem to the list of data exporters in the README.
37+
38+
4. **Run update script**: Finally, run `python3 ./scripts/update-ecosystems-lists.py`. This script will automatically update the following files based on your changes to `ecosystems.json`:
39+
* `bindings/go/osvschema/constants.go`
40+
* The main ecosystem table in `docs/schema.md`
41+
* The ecosystem enum in `validation/schema.json`
42+
* Make a copy of the `validation/schema.json` for the linter in `tools/osv-linter/internal/checks/schema_generated.json`

scripts/update-ecosystems-lists.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python3
22

33
import json
4+
import shutil
45

56
MARKDOWN_TABLE_MARKER_START = '<!-- begin auto-generated ecosystems list -->'
67
MARKDOWN_TABLE_MARKER_END = '<!-- end auto-generated ecosystems list -->'
@@ -141,5 +142,5 @@ def update_go_constants():
141142

142143
update_go_constants()
143144
update_json_schema('validation/schema.json')
144-
update_json_schema('tools/osv-linter/internal/checks/schema_generated.json')
145+
shutil.copy('validation/schema.json', 'tools/osv-linter/internal/checks/schema_generated.json')
145146
update_schema_md()

0 commit comments

Comments
 (0)