sourcegraph/cmd
Robert Lin 44e6d0af08
cody-gateway: fix adding validation errors, remove custom Validate() (#55537)
[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
```
2023-08-03 11:18:48 -07:00
..
batcheshelper Move batcheshelper out of enterprise (#54923) 2023-07-13 19:46:09 +02:00
blobstore uploadstore: add method to list all keys (#54682) 2023-07-07 12:39:26 +02:00
cody-gateway cody-gateway: fix adding validation errors, remove custom Validate() (#55537) 2023-08-03 11:18:48 -07:00
frontend updatecheck: make Pub/Sub client an argument instead of global var (#55536) 2023-08-03 13:30:29 -04:00
github-proxy bzl: set version on bins, not lib + add missing (#54030) 2023-06-23 14:06:58 +02:00
gitserver git-debuggability: allow site-admins configure recorded commands on all repositories (#55395) 2023-07-28 09:59:55 +00:00
loadtest bzl: set version on bins, not lib + add missing (#54030) 2023-06-23 14:06:58 +02:00
migrator release: sourcegraph@5.1.5 (#55364) 2023-07-28 08:23:58 +01:00
precise-code-intel-worker Move precise-code-intel-worker out of enterprise (#54926) 2023-07-13 20:09:16 +02:00
repo-updater gitserver: Introduce pool_repo_id and make AddrForRepo stateful (#55001) 2023-07-19 22:34:43 +05:30
searcher gRPC: sanitize utf8 in searcher (#55369) 2023-07-27 22:57:30 -06:00
server app: resolve port :9000 conflicts (change to :49000) (#54466) 2023-07-04 13:06:33 -07:00
sitemap sitemap: fix compile error after update to NewRetryPolicy (#51926) 2023-05-15 12:52:57 +00:00
sourcegraph-oss bzl: set version on bins, not lib + add missing (#54030) 2023-06-23 14:06:58 +02:00
symbols gRPC: fix replacement char encoding (#55327) 2023-07-26 12:17:00 -06:00
worker fix: move licensing checks to worker process (#54854) 2023-07-24 13:38:57 +02:00
README.md Reminder to keep architecture diagram in-sync (#36869) 2022-06-08 19:40:36 -07:00

This directory contains Sourcegraph services and binaries.

When a services is added, removed, or when a service's dependencies change, update our architecture diagram.