Skip to content

feat(bigquery): add proxy support for API calls#2941

Open
Deeven-Seru wants to merge 1 commit into
googleapis:mainfrom
Deeven-Seru:fix-2766-bq-proxy
Open

feat(bigquery): add proxy support for API calls#2941
Deeven-Seru wants to merge 1 commit into
googleapis:mainfrom
Deeven-Seru:fix-2766-bq-proxy

Conversation

@Deeven-Seru
Copy link
Copy Markdown
Contributor

@Deeven-Seru Deeven-Seru commented Apr 3, 2026

Summary

  • add optional proxy field to BigQuery source config
  • route BigQuery client + REST service through proxy-aware HTTP client (uses
    explicit proxy or HTTP(S)_PROXY)
  • document proxy option in BigQuery source docs

This wasn’t supported yet — BigQuery client creation didn’t wire proxy transports, so HTTPS_PROXY/HTTP_PROXY were ignored.
this PR that adds a proxy field on the BigQuery source config and routes both the client and REST service through a proxy-aware HTTP client (explicit proxy or HTTP(S)_PROXY). Docs updated.

Example:
proxy: "https://proxy.company:8443"

fixes #2766

@Deeven-Seru Deeven-Seru requested review from a team as code owners April 3, 2026 05:11
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for an optional HTTP(S) proxy in the BigQuery source, allowing API calls to be routed through a proxy server. The changes include updates to the configuration struct, documentation, and the initialization logic for BigQuery clients and services. However, the current implementation is incomplete as the proxy configuration is not applied to Dataplex client initialization or service account impersonation calls, which may cause failures in restricted environments. Additionally, the documentation should be generalized to reflect that the proxy affects all outbound API calls from the source, not just BigQuery-specific ones.

Comment thread internal/sources/bigquery/bigquery.go
Comment thread internal/sources/bigquery/bigquery.go Outdated
Comment thread docs/en/integrations/bigquery/source.md Outdated
@Deeven-Seru
Copy link
Copy Markdown
Contributor Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for an optional HTTP(S) proxy in the BigQuery source, allowing API calls to be routed through a proxy server. The changes include updates to the configuration schema, documentation, and the internal client initialization logic for both BigQuery and Dataplex. However, several critical issues were identified in the review: the current implementation creates a new http.Transport for every client request which can lead to resource exhaustion, the proxy configuration is currently ignored for gRPC-based operations (the default for these clients), and the casting of the default transport is brittle and could cause runtime failures if the transport is wrapped by other libraries.

Comment thread internal/sources/bigquery/bigquery.go Outdated
Comment thread internal/sources/bigquery/bigquery.go
Comment thread internal/sources/bigquery/bigquery.go
@Deeven-Seru
Copy link
Copy Markdown
Contributor Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for HTTP(S) proxies in the BigQuery source. It adds a proxy configuration field, updates documentation, and refactors the internal connection logic to use proxy-aware HTTP clients for both BigQuery and Dataplex services. Feedback suggests using http.ProxyFromEnvironment for more robust proxy detection and injecting the proxy-aware client into the context via oauth2.HTTPClient to ensure authentication requests also honor the proxy settings.

Comment thread internal/sources/bigquery/bigquery.go
Comment thread internal/sources/bigquery/bigquery.go
Comment thread internal/sources/bigquery/bigquery.go
@Yuan325 Yuan325 removed their assignment Apr 9, 2026
@Yuan325 Yuan325 added the product: bigquery BigQuery label Apr 9, 2026
@shobsi shobsi requested a review from Genesis929 April 9, 2026 19:21
@shobsi shobsi assigned Genesis929 and unassigned shobsi Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Route BigQuery API calls through a proxy

4 participants