From 7ca66bd4e3252c0d4b8c00daf2808bd49c33e09a Mon Sep 17 00:00:00 2001 From: natehessler Date: Wed, 18 Feb 2026 15:11:02 -0600 Subject: [PATCH 1/2] Refactor client initialization for code intel upload ### Problem The `src code-intel upload` command does not respect the `SRC_PROXY` environment variable, preventing uploads through corporate proxies. This also means standard `HTTP_PROXY`/`HTTPS_PROXY` environment variables are not honored. **Customer Impact**: Dropbox reported they can successfully upload code intelligence indexes from local machines, but uploads fail from their CI system which requires outbound proxy configuration. The `SRC_PROXY` environment variable works for `src search` and other commands, but not for `src code-intel upload`. ### Root Cause In `cmd/src/code_intel_upload.go:79-82`, the API client was constructed directly with `api.NewClient()`, passing only `Out` and `Flags`. This bypassed the global configuration object which contains: - Endpoint - Access token - Additional headers - **Proxy URL and proxy path** (parsed from `SRC_PROXY` environment variable) Other commands use the `cfg.apiClient()` helper method which properly includes all configuration. ### Fix Replace the manual `api.NewClient()` construction with `cfg.apiClient()`, ensuring the code-intel upload command uses the same fully-configured client as all other commands. --- cmd/src/code_intel_upload.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cmd/src/code_intel_upload.go b/cmd/src/code_intel_upload.go index 8030b31a9a..9f6fa107cd 100644 --- a/cmd/src/code_intel_upload.go +++ b/cmd/src/code_intel_upload.go @@ -76,10 +76,7 @@ func handleCodeIntelUpload(args []string) error { return handleUploadError(cfg.AccessToken, err) } - client := api.NewClient(api.ClientOpts{ - Out: io.Discard, - Flags: codeintelUploadFlags.apiFlags, - }) + client := cfg.apiClient(codeintelUploadFlags.apiFlags, io.Discard) uploadOptions := codeintelUploadOptions(out) var uploadID int From 504f5d2601b8732a2f396976d8b28e47054ddc94 Mon Sep 17 00:00:00 2001 From: William Bezuidenhout Date: Thu, 19 Feb 2026 12:13:30 +0200 Subject: [PATCH 2/2] fixup --- cmd/src/code_intel_upload.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/cmd/src/code_intel_upload.go b/cmd/src/code_intel_upload.go index 9f6fa107cd..dfc7a9190e 100644 --- a/cmd/src/code_intel_upload.go +++ b/cmd/src/code_intel_upload.go @@ -18,8 +18,6 @@ import ( "github.com/sourcegraph/sourcegraph/lib/codeintel/upload" "github.com/sourcegraph/sourcegraph/lib/errors" "github.com/sourcegraph/sourcegraph/lib/output" - - "github.com/sourcegraph/src-cli/internal/api" ) func init() {