Skip to content

Commit 743c79e

Browse files
authored
Merge branch 'master' into πŸ“₯❌🐍
2 parents 4f60368 + d6f19ae commit 743c79e

21 files changed

Lines changed: 1292 additions & 380 deletions

β€ŽCONTRIBUTING.mdβ€Ž

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ poetry self add poetry-plugin-shell
6868
poetry shell
6969
```
7070

71-
### Running tests
71+
### Backend development
72+
73+
#### Running tests
7274

7375
Certain tests require you to auth with the Google Cloud SDK and to install the
7476
Firestore Emulator:
@@ -93,7 +95,7 @@ By default, this skips long tests, enable them by setting the `LONG_TESTS` varia
9395
LONG_TESTS=1 make api-server-tests
9496
```
9597

96-
#### Test result generation
98+
##### Test result generation
9799

98100
Many tests are written using a
99101
[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:
109111
TESTS_GENERATE=1 make all-tests
110112
```
111113

112-
### Linting and formatting
114+
#### Running a local API instance (maintainers only)
113115

114-
To lint your code, run
116+
Running a local instance of the API server requires the path to application
117+
default credentials. This is required so that the ESP container has credentials
118+
to download API configuration.
115119

116120
```shell
117-
make lint
121+
gcloud auth login --update-adc
122+
make run-api-server
118123
```
119124

120-
To format your code, run
125+
#### API E2E Snapshots
126+
127+
If you have made any changes to the API, please update the API query snapshots with
128+
121129
```shell
122-
yapf -i <file>.py
130+
gcloud auth login --update-adc
131+
make update-api-snapshots
123132
```
124133

125-
### Running local UI and API instances (maintainers only)
134+
and check the git diff to see if the API result changes are expected.
135+
136+
### Frontend development
126137

127-
#### UI
138+
#### Running a local UI instance (maintainers only)
128139

129140
```shell
130141
gcloud auth login --update-adc
131142
make run-website
132143
```
133144

134-
#### API
145+
#### Running a local UI instance
135146

136-
Running a local instance of the API server requires the path to application
137-
default credentials. The is required so that the ESP container has credentials
138-
to download API configuration.
147+
For contributors without access to the GCP project, you can use the website emulator which does
148+
not require Google Cloud project access. This emulator uses a local datastore
149+
and loads data from a local directory.
139150

140151
```shell
141-
gcloud auth login --update-adc
142-
make run-api-server
152+
make run-website-emulator
143153
```
144154

145-
#### API E2E Snapshots
155+
You can add testcase records to `gcp/website/testdata/osv/` to test odd cases.
156+
See [gcp/website/testdata/osv/README.md](gcp/website/testdata/osv/README.md)
157+
for more information on the format of these records.
146158

147-
If you have made any changes to the API, please update the API query snapshots with
159+
### Linting and formatting
160+
161+
To lint your code, run
148162

149163
```shell
150-
gcloud auth login --update-adc
151-
make update-api-snapshots
164+
make lint
152165
```
153166

154-
and check the git diff to see if the API result changes are expected.
167+
To format your code, run
168+
```shell
169+
yapf -i <file>.py
170+
```
155171

156172
### Making commits
157173

β€Žgcp/indexer/go.modβ€Ž

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ require (
6060
go.opentelemetry.io/contrib/detectors/gcp v1.38.0 // indirect
6161
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 // indirect
6262
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect
63-
go.opentelemetry.io/otel v1.39.0 // indirect
64-
go.opentelemetry.io/otel/metric v1.39.0 // indirect
65-
go.opentelemetry.io/otel/sdk v1.39.0 // indirect
66-
go.opentelemetry.io/otel/sdk/metric v1.39.0 // indirect
67-
go.opentelemetry.io/otel/trace v1.39.0 // indirect
63+
go.opentelemetry.io/otel v1.40.0 // indirect
64+
go.opentelemetry.io/otel/metric v1.40.0 // indirect
65+
go.opentelemetry.io/otel/sdk v1.40.0 // indirect
66+
go.opentelemetry.io/otel/sdk/metric v1.40.0 // indirect
67+
go.opentelemetry.io/otel/trace v1.40.0 // indirect
6868
golang.org/x/crypto v0.47.0 // indirect
6969
golang.org/x/net v0.49.0 // indirect
7070
golang.org/x/oauth2 v0.35.0 // indirect

β€Žgcp/indexer/go.sumβ€Ž

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,16 +194,26 @@ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 h1:F7Jx+6h
194194
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0/go.mod h1:UHB22Z8QsdRDrnAtX4PntOl36ajSxcdUMt1sF7Y6E7Q=
195195
go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48=
196196
go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8=
197+
go.opentelemetry.io/otel v1.40.0 h1:oA5YeOcpRTXq6NN7frwmwFR0Cn3RhTVZvXsP4duvCms=
198+
go.opentelemetry.io/otel v1.40.0/go.mod h1:IMb+uXZUKkMXdPddhwAHm6UfOwJyh4ct1ybIlV14J0g=
197199
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.39.0 h1:5gn2urDL/FBnK8OkCfD1j3/ER79rUuTYmCvlXBKeYL8=
198200
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.39.0/go.mod h1:0fBG6ZJxhqByfFZDwSwpZGzJU671HkwpWaNe2t4VUPI=
199201
go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0=
200202
go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs=
203+
go.opentelemetry.io/otel/metric v1.40.0 h1:rcZe317KPftE2rstWIBitCdVp89A2HqjkxR3c11+p9g=
204+
go.opentelemetry.io/otel/metric v1.40.0/go.mod h1:ib/crwQH7N3r5kfiBZQbwrTge743UDc7DTFVZrrXnqc=
201205
go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18=
202206
go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE=
207+
go.opentelemetry.io/otel/sdk v1.40.0 h1:KHW/jUzgo6wsPh9At46+h4upjtccTmuZCFAc9OJ71f8=
208+
go.opentelemetry.io/otel/sdk v1.40.0/go.mod h1:Ph7EFdYvxq72Y8Li9q8KebuYUr2KoeyHx0DRMKrYBUE=
203209
go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8=
204210
go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew=
211+
go.opentelemetry.io/otel/sdk/metric v1.40.0 h1:mtmdVqgQkeRxHgRv4qhyJduP3fYJRMX4AtAlbuWdCYw=
212+
go.opentelemetry.io/otel/sdk/metric v1.40.0/go.mod h1:4Z2bGMf0KSK3uRjlczMOeMhKU2rhUqdWNoKcYrtcBPg=
205213
go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI=
206214
go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA=
215+
go.opentelemetry.io/otel/trace v1.40.0 h1:WA4etStDttCSYuhwvEa8OP8I5EWu24lkOzp+ZYblVjw=
216+
go.opentelemetry.io/otel/trace v1.40.0/go.mod h1:zeAhriXecNGP/s2SEG3+Y8X9ujcJOTqQ5RgdEJcawiA=
207217
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
208218
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
209219
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=

0 commit comments

Comments
Β (0)