From 473a22268a7cfbdad61f60224be5a0dd7b8c5450 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 01:58:35 +0000 Subject: [PATCH 1/4] docs: update CONTRIBUTING.md to split frontend/backend and add emulator info - Split "Contributing code" into "Backend development" and "Frontend development". - Add instructions for non-internal contributors to use `make run-website-emulator`. - Mention adding testcase records to `gcp/website/testdata/osv/` for testing edge cases. - Fix a minor typo in the API server section. Co-authored-by: jess-lowe <86962800+jess-lowe@users.noreply.github.com> --- CONTRIBUTING.md | 56 +++++++++++++++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e6efd4f909f..c9dcdcf7fb7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -68,7 +68,9 @@ poetry self add poetry-plugin-shell poetry shell ``` -### Running tests +### Backend development + +#### Running tests Certain tests require you to auth with the Google Cloud SDK and to install the Firestore Emulator: @@ -93,7 +95,7 @@ By default, this skips long tests, enable them by setting the `LONG_TESTS` varia LONG_TESTS=1 make api-server-tests ``` -#### Test result generation +##### Test result generation Many tests are written using a [simple framework](https://github.com/google/osv.dev/blob/a4b682a32575cc3314a5ef83c8e91b70c60f7b77/osv/tests.py#L32) @@ -109,49 +111,63 @@ the environment variable `TESTS_GENERATE=1` and run the tests: TESTS_GENERATE=1 make all-tests ``` -### Linting and formatting +#### Running a local API instance (maintainers only) -To lint your code, run +Running a local instance of the API server requires the path to application +default credentials. This is required so that the ESP container has credentials +to download API configuration. ```shell -make lint +gcloud auth login --update-adc +make run-api-server ``` -To format your code, run +#### API E2E Snapshots + +If you have made any changes to the API, please update the API query snapshots with + ```shell -yapf -i .py +gcloud auth login --update-adc +make update-api-snapshots ``` -### Running local UI and API instances (maintainers only) +and check the git diff to see if the API result changes are expected. + +### Frontend development -#### UI +#### Running a local UI instance (maintainers only) ```shell gcloud auth login --update-adc make run-website ``` -#### API +#### Running a local UI instance (non-internal contributors) -Running a local instance of the API server requires the path to application -default credentials. The is required so that the ESP container has credentials -to download API configuration. +For non-internal contributors, you can use the website emulator which does +not require Google Cloud project access. This emulator uses a local datastore +and loads data from a local directory. ```shell -gcloud auth login --update-adc -make run-api-server +make run-website-emulator ``` -#### API E2E Snapshots +You can add testcase records to `gcp/website/testdata/osv/` to test odd cases. +See [gcp/website/testdata/osv/README.md](gcp/website/testdata/osv/README.md) +for more information on the format of these records. -If you have made any changes to the API, please update the API query snapshots with +### Linting and formatting + +To lint your code, run ```shell -gcloud auth login --update-adc -make update-api-snapshots +make lint ``` -and check the git diff to see if the API result changes are expected. +To format your code, run +```shell +yapf -i .py +``` ### Making commits From 0ae7aed40a95b5252491e68c4928c1bd244c48b6 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 02:00:40 +0000 Subject: [PATCH 2/4] docs: update CONTRIBUTING.md to split frontend/backend and add emulator info - Split "Contributing code" into "Backend development" and "Frontend development". - Add instructions for non-internal contributors to use `make run-website-emulator`. - Mention adding testcase records to `gcp/website/testdata/osv/` for testing edge cases. - Fix a minor typo in the API server section. Co-authored-by: jess-lowe <86962800+jess-lowe@users.noreply.github.com> From 56382b0c9d583e458e14bfe30c3a53187a032a20 Mon Sep 17 00:00:00 2001 From: Jess Lowe <86962800+jess-lowe@users.noreply.github.com> Date: Mon, 23 Feb 2026 13:57:12 +1100 Subject: [PATCH 3/4] Apply suggestion from @jess-lowe --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c9dcdcf7fb7..e0c29c266b2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -142,7 +142,7 @@ gcloud auth login --update-adc make run-website ``` -#### Running a local UI instance (non-internal contributors) +#### Running a local UI instance For non-internal contributors, you can use the website emulator which does not require Google Cloud project access. This emulator uses a local datastore From fedcbb0e63b0005169a8d7ad3f3070f6bb9c9a28 Mon Sep 17 00:00:00 2001 From: Jess Lowe <86962800+jess-lowe@users.noreply.github.com> Date: Mon, 23 Feb 2026 13:59:03 +1100 Subject: [PATCH 4/4] Apply suggestion from @jess-lowe --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e0c29c266b2..6254815a6b0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -144,7 +144,7 @@ make run-website #### Running a local UI instance -For non-internal contributors, you can use the website emulator which does +For contributors without access to the GCP project, you can use the website emulator which does not require Google Cloud project access. This emulator uses a local datastore and loads data from a local directory.