Skip to content

Refactor client initialization for code intel upload#1256

Open
natehessler wants to merge 1 commit intomainfrom
natehessler-patch-1
Open

Refactor client initialization for code intel upload#1256
natehessler wants to merge 1 commit intomainfrom
natehessler-patch-1

Conversation

@natehessler
Copy link

@natehessler natehessler commented Feb 18, 2026

Problem

The src code-intel upload command does not respect the SRC_PROXY environment variable, preventing uploads through corporate proxies.

Customer Impact: customer 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.

### 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.
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

Comments