Skip to content

feat: add first-class HTTP proxy support for importer - #100

Merged
mrrajan merged 2 commits into
guacsec:mainfrom
mrrajan:TC-5174-proxy-support
Jul 16, 2026
Merged

feat: add first-class HTTP proxy support for importer#100
mrrajan merged 2 commits into
guacsec:mainfrom
mrrajan:TC-5174-proxy-support

Conversation

@mrrajan

@mrrajan mrrajan commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Add top-level proxy configuration (httpProxy, httpsProxy, noProxy) that injects HTTP_PROXY, HTTPS_PROXY, and NO_PROXY env vars into the importer container. Required for environments where direct egress to github.com is blocked and git operations must route through a proxy.

Summary by Sourcery

Add configurable HTTP proxy support for the importer by introducing a top-level proxy configuration that maps to standard proxy environment variables.

New Features:

  • Introduce a ProxyConfig values section to configure HTTP, HTTPS, and no-proxy settings for the importer.
  • Inject HTTP_PROXY, HTTPS_PROXY, and NO_PROXY environment variables into the importer deployment when proxy values are provided.

Tests:

  • Add Helm unit tests to verify proxy environment variables are injected or omitted in the importer deployment based on proxy configuration.

Add top-level proxy configuration (httpProxy, httpsProxy, noProxy) that
injects HTTP_PROXY, HTTPS_PROXY, and NO_PROXY env vars into the importer
container. Required for environments where direct egress to github.com
is blocked and git operations must route through a proxy.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mrrajan
mrrajan requested a review from ctron July 16, 2026 06:58
@sourcery-ai

sourcery-ai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds configurable HTTP proxy support to the importer by introducing a top-level proxy configuration and wiring it into the Helm chart so HTTP(S)/NO proxy environment variables are conditionally injected, plus tests and helper template to verify behavior.

File-Level Changes

Change Details Files
Introduce a typed top-level proxy configuration in chart values to control HTTP(S) proxy and no-proxy settings.
  • Add proxy property to the main values schema referencing a new ProxyConfig definition.
  • Define ProxyConfig object with httpProxy, httpsProxy, and noProxy fields, disallowing additional properties and documenting corresponding env vars.
  • Expose an empty proxy object in default values.yaml to enable configuration via Helm values.
charts/trustify/values.schema.yaml
charts/trustify/values.yaml
Wire proxy configuration into the importer Deployment so proxy settings become container environment variables when configured.
  • Include a new helper template call in the importer Deployment env section to render proxy-related env vars.
  • Implement a proxy env var helper that conditionally emits HTTP_PROXY, HTTPS_PROXY, and NO_PROXY based on the presence of httpProxy, httpsProxy, and noProxy in values.proxy, using quoted string values.
charts/trustify/templates/services/importer/030-Deployment.yaml
charts/trustify/templates/helpers/_proxy.tpl
Add Helm chart unit tests to validate proxy env var injection behavior for the importer.
  • Create a new importer_deployment_test.yaml test suite that loads base values and validates env var rendering.
  • Add tests covering full proxy configuration, empty proxy configuration (no env vars), and partial configuration with only httpProxy set.
charts/trustify/tests/importer_deployment_test.yaml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • The helper trustification.application.proxy.envVars expects a dict with a root key, but the importer deployment passes $mod directly—double-check that $mod has the expected shape (including .root) or adjust the helper/usage for consistency with other helpers.
  • Many tools respect lowercase proxy variables (http_proxy, https_proxy, no_proxy) in addition to the uppercase forms; consider optionally injecting these as well to match common proxy environments.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The helper `trustification.application.proxy.envVars` expects a `dict` with a `root` key, but the importer deployment passes `$mod` directly—double-check that `$mod` has the expected shape (including `.root`) or adjust the helper/usage for consistency with other helpers.
- Many tools respect lowercase proxy variables (`http_proxy`, `https_proxy`, `no_proxy`) in addition to the uppercase forms; consider optionally injecting these as well to match common proxy environments.

## Individual Comments

### Comment 1
<location path="charts/trustify/templates/helpers/_proxy.tpl" line_range="10-18" />
<code_context>
+{{- define "trustification.application.proxy.envVars" -}}
+{{- with .root.Values.proxy }}
+{{- with .httpProxy }}
+- name: HTTP_PROXY
+  value: {{ . | quote }}
+{{- end }}
+{{- with .httpsProxy }}
+- name: HTTPS_PROXY
+  value: {{ . | quote }}
+{{- end }}
+{{- with .noProxy }}
+- name: NO_PROXY
+  value: {{ . | quote }}
+{{- end }}
</code_context>
<issue_to_address>
**suggestion:** Consider setting lowercase proxy env vars alongside the uppercase ones.

Some clients only honor lowercase proxy variables (`http_proxy`, `https_proxy`, `no_proxy`). Emitting the lowercase variants alongside the uppercase ones would make this helper more robust and avoid proxy misconfigurations for those tools.

Suggested implementation:

```
{{/*
Proxy env-vars for containers that need HTTP proxy support.

Arguments (dict):
  * root - .
*/}}
{{- define "trustification.application.proxy.envVars" -}}
{{- with .root.Values.proxy }}
{{- with .httpProxy }}
- name: HTTP_PROXY
  value: {{ . | quote }}
- name: http_proxy
  value: {{ . | quote }}
{{- end }}
{{- with .httpsProxy }}
- name: HTTPS_PROXY
  value: {{ . | quote }}
- name: https_proxy
  value: {{ . | quote }}
{{- end }}
{{- with .noProxy }}
- name: NO_PROXY
  value: {{ . | quote }}
- name: no_proxy
  value: {{ . | quote }}
{{- end }}
{{- end }}
{{- end }}

```

None required; this change is self-contained in the Helm helper and will emit both upper- and lower-case proxy environment variables wherever `trustification.application.proxy.envVars` is used.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread charts/trustify/templates/helpers/_proxy.tpl
@ctron

ctron commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

I think AI is right, we might just want to set those too.

Some clients only honor lowercase proxy variables (http_proxy,
https_proxy, no_proxy). Emit both variants for broader compatibility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mrrajan

mrrajan commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

I think AI is right, we might just want to set those too.

Agree on that too - Updated the helm :)

@mrrajan
mrrajan merged commit 5d111ca into guacsec:main Jul 16, 2026
3 checks passed
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.

2 participants