Refactor client initialization for code intel upload#1256
Open
natehessler wants to merge 1 commit intomainfrom
Open
Refactor client initialization for code intel upload#1256natehessler wants to merge 1 commit intomainfrom
natehessler wants to merge 1 commit intomainfrom
Conversation
### 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.
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.
Problem
The
src code-intel uploadcommand does not respect theSRC_PROXYenvironment 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_PROXYenvironment variable works forsrc searchand other commands, but not forsrc code-intel upload.Root Cause
In
cmd/src/code_intel_upload.go:79-82, the API client was constructed directly withapi.NewClient(), passing onlyOutandFlags. This bypassed the global configuration object which contains:SRC_PROXYenvironment variable)Other commands use the
cfg.apiClient()helper method which properly includes all configuration.Fix
Replace the manual
api.NewClient()construction withcfg.apiClient(), ensuring the code-intel upload command uses the same fully-configured client as all other commands.