config file override fixes + improvements
Created by: slimsag
This PR:
- Fixes a deadlock that was introduced when specifying
EXTSVC_CONFIG_FILE
(caught by our deadlock detector in dev environments https://github.com/sourcegraph/sourcegraph/issues/4123). - Removes an incorrect "Dev" label applied to
EXTSVC_CONFIG_FILE
-created services - Fixes the previously extremely poor behavior of
EXTSVC_CONFIG_FILE
where it would do nothing if you have external services already (see https://github.com/sourcegraph/sourcegraph/commit/d3a714eb8d35ffb6df949eeeed34b0a8e7246e75 for why this sucked particularly bad in dev environments, too). - Improves error messages returned by config override files.
- Prevents updates to extsvc/site/critical configs when they are loaded from a file (the latter requires setting an env var on the management console). This does not apply in dev mode.
My intent is to cherry-pick for release in 3.4.1.
Supercedes #4126 (in particular the first commit b46bc7d does) Fixes #4123 Fixes #4108
Test plan: manual (very difficult to test automatically currently)
Merge request reports
Activity
Created by: codecov[bot]
Codecov Report
Merging #4154 into master will decrease coverage by
0.01%
. The diff coverage is0%
.Impacted Files Coverage Δ cmd/frontend/internal/cli/config.go 20.63% <0%> (-0.17%)
cmd/frontend/internal/cli/serve_cmd.go 2.12% <0%> (-0.02%)
cmd/management-console/shared/main.go 10.32% <0%> (-0.28%)
cmd/frontend/graphqlbackend/site.go 3.33% <0%> (-0.08%)
cmd/frontend/graphqlbackend/external_services.go 0% <0%> (ø)
cmd/frontend/db/external_services.go 10.28% <0%> (ø)
Created by: keegancsmith
We run migrations on the external services in repo-updater at startup. How will this work in the world where the external service configurations are immutable?
At a technical level repo-updater will update the DB. But if frontend restarts it will then overwrite the migrations. This can lead us into a weird state. However, if the configuration passes our schema validation then the weird state is acceptable / the migrations will (currently) not run again.