Repository navigation
docker-compose: Drop redundant PRECISE_CODE_INTEL_UPLOAD_* settings - #1461
Merged
Merged
Conversation
The five services that set PRECISE_CODE_INTEL_UPLOAD_BACKEND=blobstore and PRECISE_CODE_INTEL_UPLOAD_AWS_ENDPOINT=http://blobstore:9000 also load sourcegraph-uploads.env, which is now the single place to configure object storage. Both values are the built-in defaults, and when the legacy backend is blobstore Sourcegraph uses the shared SOURCEGRAPH_UPLOAD_* config anyway. Amp-Thread-ID: https://ampcode.com/threads/T-01a19e33-cddf-73da-ac2f-df86f60de809 Co-authored-by: Robert Lin <robert@sourcegraph.com>
bobheadxi
marked this pull request as ready for review
November 2, 2026 21:44
devdinu
approved these changes
Nov 2, 2026
marcleblanc2
approved these changes
Nov 2, 2026
marcleblanc2
added a commit
to sourcegraph/deploy-sourcegraph-helm
that referenced
this pull request
Nov 4, 2026
The hardcoded PRECISE_CODE_INTEL_UPLOAD_BACKEND=blobstore and PRECISE_CODE_INTEL_UPLOAD_AWS_ENDPOINT=http://blobstore:9000 on frontend, worker, precise-code-intel-worker, and syntactic-code-intel-worker match Sourcegraph's built-in defaults, and the legacy compat shim ignores the endpoint when the backend is blobstore. SOURCEGRAPH_UPLOAD_* in *.env is now the only object storage configuration in the chart. They also rendered after *.env, so with blobstore.enabled they overrode any PRECISE_CODE_INTEL_UPLOAD_* a user set there. Follow-up to sourcegraph/deploy-sourcegraph-docker#1461. Amp-Thread-ID: https://ampcode.com/threads/T-01a19e9e-5e4f-7408-9834-0de841fee3e4 Co-authored-by: Amp <amp@ampcode.com>
marcleblanc2
added a commit
to sourcegraph/deploy-sourcegraph-helm
that referenced
this pull request
Nov 4, 2026
Follow-up to sourcegraph/deploy-sourcegraph-docker#1461, same cleanup for the Helm chart. Four templates still set `PRECISE_CODE_INTEL_UPLOAD_BACKEND=blobstore` and `PRECISE_CODE_INTEL_UPLOAD_AWS_ENDPOINT=http://blobstore:9000` under `{{ if .Values.blobstore.enabled }}`: `frontend`, `worker`, `precise-code-intel-worker`, and `syntactic-code-intel-worker`. A customer reading the templates could reasonably think both `PRECISE_CODE_INTEL_UPLOAD_*` and `SOURCEGRAPH_UPLOAD_*` need changing to move to S3 or GCS. This removes the legacy lines so `SOURCEGRAPH_UPLOAD_*` in `*.env` is the only object storage configuration in the chart, matching the `external-object-storage` examples. The removed values did nothing: - They are the built-in defaults: `PRECISE_CODE_INTEL_UPLOAD_BACKEND` defaults to `blobstore` ([lsifuploadstore/config.go](https://sourcegraph.sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/internal/codeintel/shared/lsifuploadstore/config.go?L31)), and the endpoint defaults to `http://blobstore:9000` outside the single-container deployment ([deploy/endpoints.go](https://sourcegraph.sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/internal/conf/deploy/endpoints.go)). - When the legacy backend is `blobstore`, [`resolveLegacyCompatStorage`](https://sourcegraph.sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/internal/object/sourcegraphobjects/backcompat.go?L20-L44) uses the shared `SOURCEGRAPH_UPLOAD_*` config and keeps only the legacy bucket name, so the legacy endpoint was never read. ## Impact on existing deployments - **Default (bundled blobstore):** no change. The rendered env loses two variables whose values equal the compiled-in defaults, so pods restart on upgrade (env changed) but behave identically: bundled blobstore, `lsif-uploads` bucket. - **`blobstore.enabled: false` with `SOURCEGRAPH_UPLOAD_*` in `*.env` (the documented path):** no change at all. The removed block never rendered for these deployments, so the manifests are byte-identical. - **`blobstore.enabled: true` with `SOURCEGRAPH_UPLOAD_BACKEND=S3|GCS` in `*.env`:** no change. Code-intel uploads already went to the shared bucket under the `lsif-uploads/` prefix via the compat shim, and still do. - **`blobstore.enabled: true` with `PRECISE_CODE_INTEL_UPLOAD_BACKEND=S3|GCS` in `*.env`:** behaviour fix, one upgrade later. The chart's hardcoded `blobstore` rendered *after* `*.env`, and Kubernetes takes the last duplicate env name, so these overrides were silently ignored and uploads went to the bundled blobstore. On the upgrade to this chart, Helm's three-way merge deletes every env entry with those names, the `*.env` override included, so the live Deployments carry neither value and runtime behaviour is unchanged (the deleted values equal the built-in defaults). On the *next* `helm upgrade`, even one with no changes, the override is rendered once, takes effect, and uploads switch to the dedicated bucket the customer configured. Before that second upgrade, make sure the bucket exists and is reachable, or move the settings to `SOURCEGRAPH_UPLOAD_*`, or remove them. Running a second `helm upgrade` straight away makes the switch happen at a known time. Existing uploads in the bundled blobstore are not migrated. Verified on a kind cluster by @bobheadxi's agent, see the comment below. ## Impact on new deployments None beyond less to read. The `external-object-storage` examples already disable blobstore and set only `SOURCEGRAPH_UPLOAD_*`. ## Test plan - `helm lint` and `helm unittest ./charts/sourcegraph` pass (218 tests, 12 snapshots). - `helm template` of `origin/main` vs this branch with default values: the only difference is the two variables removed from the three services that render by default (`syntactic-code-intel-worker` is disabled by default). - `helm template --set frontend.env.PRECISE_CODE_INTEL_UPLOAD_BACKEND.value=S3` on `origin/main` renders `S3` followed by a second `blobstore` entry; on this branch it renders `S3` once. - CI. --------- Co-authored-by: Amp <amp@ampcode.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #1422.
docker-compose.yamlstill setPRECISE_CODE_INTEL_UPLOAD_BACKEND=blobstoreandPRECISE_CODE_INTEL_UPLOAD_AWS_ENDPOINT=http://blobstore:9000on five services that also loadsourcegraph-uploads.env. A customer reading the file could reasonably think both sets of settings need changing to move to S3 or GCS. This removes the legacy lines sosourcegraph-uploads.envis the only object storage configuration in the compose file.The removed values did nothing:
PRECISE_CODE_INTEL_UPLOAD_BACKENDdefaults toblobstore(lsifuploadstore/config.go), and the endpoint defaults tohttp://blobstore:9000outside the single-container deployment (deploy/endpoints.go).blobstore,resolveLegacyCompatStorageuses the sharedSOURCEGRAPH_UPLOAD_*config and keeps only the legacy bucket name, so the legacy endpoint was never used. All code-intel upload store consumers (frontend, precise and syntactic code intel workers, and worker jobs) go through this shim.Resulting behavior is unchanged:
lsif-uploadsbucket, as before.sourcegraph-uploads.envswitched to S3/GCS: code-intel uploads go to the shared bucket under thelsif-uploads/prefix, as before.PRECISE_CODE_INTEL_UPLOAD_BACKEND=S3orGCSin an override keep their dedicated bucket.Search jobs already relied on these defaults; compose never set
SEARCH_JOBS_UPLOAD_*.Test plan
env_file: sourcegraph-uploads.env.