mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 19:21:50 +00:00
[BaseConfig validation is called as part of the service framework we have](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/internal/service/svcmain/svcmain.go?L211:1-223:3), but right now we're not using it correctly, overriding it with our own `Validate` implementation and adding errors incorrectly. After fixing how we're holding this by moving `AddError` to `Load()` and removing our custom `Validate()` implementation (which was overriding the BaseConfig implementation entirely), we now get a bunch of errors emitted from BaseConfig: ``` Running cody-gateway... [ cody-gateway] FATAL sourcegraph svcmain/svcmain.go:220 invalid configuration {"service": "cody-gateway", "error": "3 errors occurred:\n\t* invalid value \"\" for CODY_GATEWAY_BIGQUERY_PROJECT_ID: no value supplied\n\t* invalid value \"\" for CODY_GATEWAY_OTEL_GCP_PROJECT_ID: no value supplied\n\t* invalid value \"\" for CODY_GATEWAY_ACTOR_RATE_LIMIT_NOTIFY_SLACK_WEBHOOK_URL: no value supplied"} -------------------------------------------------------------------------------- Failed to run cody-gateway: Exit code: 1 Standard err: FATAL sourcegraph svcmain/svcmain.go:220 invalid configuration {"service": "cody-gateway", "error": "3 errors occurred:\n\t* invalid value \"\" for CODY_GATEWAY_BIGQUERY_PROJECT_ID: no value supplied\n\t* invalid value \"\" for CODY_GATEWAY_OTEL_GCP_PROJECT_ID: no value supplied\n\t* invalid value \"\" for CODY_GATEWAY_ACTOR_RATE_LIMIT_NOTIFY_SLACK_WEBHOOK_URL: no value supplied"} -------------------------------------------------------------------------------- ❌ failed to run cody-gateway ``` This change also includes some changes to our env variables so that the above variables are no longer required/fatal, which is the behaviour they had up until this fix. ## Test plan ``` sg run cody-gateway ``` |
||
|---|---|---|
| .. | ||
| batcheshelper | ||
| blobstore | ||
| cody-gateway | ||
| frontend | ||
| github-proxy | ||
| gitserver | ||
| loadtest | ||
| migrator | ||
| precise-code-intel-worker | ||
| repo-updater | ||
| searcher | ||
| server | ||
| sitemap | ||
| sourcegraph-oss | ||
| symbols | ||
| worker | ||
| README.md | ||
This directory contains Sourcegraph services and binaries.
When a services is added, removed, or when a service's dependencies change, update our architecture diagram.