Skip to content

sourcegraph: Drop DEPLOY_TYPE from every container except worker - #982

Open
marcleblanc2 wants to merge 2 commits into
mainfrom
marc/trim-deploy-type-env
Open

marcleblanc2 wants to merge 2 commits into
mainfrom
marc/trim-deploy-type-env

Conversation

@marcleblanc2

@marcleblanc2 marcleblanc2 commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

#929 added a default DEPLOY_TYPE=helm env var to every application container. Only one of them can tell the difference: worker.

deploy.Type() falls back to kubernetes when the env var is unset, and every consumer in sourcegraph/sourcegraph except one goes through predicates (IsDeployTypeKubernetes, IsDev, IsDeployTypeSingleDockerContainer, …) that put helm and kubernetes in the same bucket. The exception is internal/pings/client.go, which sends the raw string as deploy_type in the update-check ping. Since sourcegraph/sourcegraph@a9ca36a (in 8.0.0 and later, which is what the chart releases pin) that ping is sent by the worker's update-check job, not frontend. frontend also forwards the value to the browser as window.context.deployType, but no code under client/ reads it on main, and the 5.11-era readers only compared it against dev / docker-container.

This PR keeps DEPLOY_TYPE=helm on worker and removes it from frontend, migrator, gitserver, blobstore, searcher, precise-code-intel-worker, syntactic-code-intel-worker, zoekt-webserver, zoekt-indexserver, and syntect-server. The *.env values for those return to their pre-#929 shape ({} or just the other defaults), the helm-docs @default annotations go with them, and the unit tests now assert both that worker has the var and that nothing else does.

Test plan

  • helm unittest charts/sourcegraph: 192 passed; the new negative assertions fail against the pre-change values.yaml
  • helm lint charts/sourcegraph: clean
  • helm template with syntacticCodeIntel.enabled=true renders DEPLOY_TYPE on the worker container and nowhere else
  • ./scripts/helm-docs.sh leaves no uncommitted changes

zoekt-webserver, zoekt-indexserver, and syntect-server are not built from
sourcegraph/sourcegraph and never read DEPLOY_TYPE, so the default added in

Amp-Thread-ID: https://ampcode.com/threads/T-01a16c86-310a-72d8-8a7e-9025e822232c
Co-authored-by: Amp <[email protected]>
#929 is dead config on those containers.
@github-actions

Copy link
Copy Markdown

@marcleblanc2
marcleblanc2 requested a review from eseliger October 27, 2026 00:50
deploy.Type() defaults to kubernetes when DEPLOY_TYPE is unset, and every
consumer except the update-check ping goes through predicates that treat
helm and kubernetes the same. The ping runs in the worker, so that is the
only container where the value is observable.

Amp-Thread-ID: https://ampcode.com/threads/T-01a17ada-cdbc-76ff-992b-901bddd4d0b7
Co-authored-by: Amp <[email protected]>
@marcleblanc2 marcleblanc2 changed the title sourcegraph: Drop DEPLOY_TYPE from zoekt and syntect-server containers sourcegraph: Drop DEPLOY_TYPE from every container except worker Oct 27, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant