Skip to content

feat: introduce proxy for webhook requests#2671

Merged
wilsonrivera merged 9 commits intomainfrom
wilson/eng-9247-update-controlplane-to-use-the-proxy-when-sending-webhooks
Mar 30, 2026
Merged

feat: introduce proxy for webhook requests#2671
wilsonrivera merged 9 commits intomainfrom
wilson/eng-9247-update-controlplane-to-use-the-proxy-when-sending-webhooks

Conversation

@wilsonrivera
Copy link
Copy Markdown
Contributor

@wilsonrivera wilsonrivera commented Mar 19, 2026

Summary by CodeRabbit

  • New Features

    • Added optional webhook proxy support: configure an HTTPS proxy URL for outgoing webhooks via WEBHOOK_PROXY_URL or Helm value.
  • Chores

    • Runtime now accepts and forwards the proxy setting to webhook delivery components.
    • Helm chart values, Secret, deployment templates, and README updated to expose/document the proxy option.
    • Added HTTPS proxy runtime dependency.

Checklist

  • I have discussed my proposed changes in an issue and have received approval to proceed.
  • I have followed the coding standards of the project.
  • Tests or benchmarks have been added or updated.
  • Documentation has been updated on https://github.com/wundergraph/docs-website.
  • I have read the Contributors Guide.

Open Source AI Manifesto

This project follows the principles of the Open Source AI Manifesto. Please ensure your contribution aligns with its principles.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 19, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds optional HTTPS proxy support for outgoing webhooks: new dependency, env var and Helm values, config/routing wiring, webhook services accept a proxy URL (create HttpsProxyAgent), and many handlers now forward the proxy URL into OrganizationWebhookService.

Changes

Cohort / File(s) Summary
Dependency & Env
controlplane/package.json, controlplane/src/core/env.schema.ts
Add https-proxy-agent dependency and new WEBHOOK_PROXY_URL Zod env variable.
Webhook Service Core
controlplane/src/core/webhooks/OrganizationWebhookService.ts, controlplane/src/core/webhooks/PlatformWebhookService.ts
Constructors accept optional proxyUrl; attempt to create HttpsProxyAgent and set Axios httpAgent/httpsAgent; errors are caught and logged.
Webhook Utils
controlplane/src/core/webhooks/utils.ts
Removed unused imports (AxiosError, pino).
Config & Routing
controlplane/src/core/build-server.ts, controlplane/src/core/routes.ts, controlplane/src/index.ts
Expose and thread webhook.proxyUrl through BuildConfig/RouterOptions/runtime options and pass it to PlatformWebhookService and route options.
Handlers — Feature Flags
controlplane/src/core/bufservices/feature-flag/*
Multiple feature-flag handlers updated to forward opts.webhookProxyUrl into OrganizationWebhookService.
Handlers — Federated Graph
controlplane/src/core/bufservices/federated-graph/*
Federated-graph handlers updated to forward opts.webhookProxyUrl into OrganizationWebhookService.
Handlers — Monograph & Composition
controlplane/src/core/bufservices/monograph/*, controlplane/src/core/bufservices/graph/recomposeGraph.ts
Monograph and recompose handlers now pass opts.webhookProxyUrl into OrganizationWebhookService.
Handlers — Subgraph
controlplane/src/core/bufservices/subgraph/*
Subgraph handlers updated to pass opts.webhookProxyUrl into OrganizationWebhookService.
Handlers — Proposal & Contract
controlplane/src/core/bufservices/proposal/*, controlplane/src/core/bufservices/contract/updateContract.ts
Proposal and contract handlers updated to pass opts.webhookProxyUrl into OrganizationWebhookService (some handlers construct the service in multiple spots).
Helm chart & Secrets
helm/cosmo/charts/controlplane/templates/deployment.yaml, .../secret.yaml, .../values.yaml, .../README.md
Add WEBHOOK_PROXY_URL env var (Secret-backed), include webhookProxyUrl secret key and configuration.webhookProxyUrl value; update README values table.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: introduce proxy for webhook requests' directly and clearly summarizes the main change - adding proxy support for webhook requests across the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 19, 2026

Codecov Report

❌ Patch coverage is 69.23077% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.92%. Comparing base (f2860f8) to head (5c56af7).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ne/src/core/webhooks/OrganizationWebhookService.ts 45.45% 6 Missing ⚠️
...lplane/src/core/webhooks/PlatformWebhookService.ts 45.45% 6 Missing ⚠️
controlplane/src/index.ts 0.00% 2 Missing ⚠️
...e/bufservices/federated-graph/migrateFromApollo.ts 0.00% 1 Missing ⚠️
controlplane/src/core/env.schema.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2671       +/-   ##
===========================================
- Coverage   63.11%   46.92%   -16.19%     
===========================================
  Files         249     1052      +803     
  Lines       26643   143322   +116679     
  Branches        0     9612     +9612     
===========================================
+ Hits        16816    67257    +50441     
- Misses       8451    74319    +65868     
- Partials     1376     1746      +370     
Files with missing lines Coverage Δ
...ne/src/core/bufservices/contract/updateContract.ts 78.03% <100.00%> (ø)
...core/bufservices/feature-flag/createFeatureFlag.ts 82.25% <100.00%> (ø)
...core/bufservices/feature-flag/deleteFeatureFlag.ts 82.92% <100.00%> (ø)
...core/bufservices/feature-flag/enableFeatureFlag.ts 76.33% <100.00%> (ø)
...core/bufservices/feature-flag/updateFeatureFlag.ts 81.37% <100.00%> (ø)
...ufservices/federated-graph/createFederatedGraph.ts 72.42% <100.00%> (ø)
.../bufservices/federated-graph/moveFederatedGraph.ts 84.95% <100.00%> (ø)
...ufservices/federated-graph/updateFederatedGraph.ts 84.61% <100.00%> (ø)
...plane/src/core/bufservices/graph/recomposeGraph.ts 80.45% <100.00%> (ø)
...src/core/bufservices/monograph/publishMonograph.ts 62.50% <100.00%> (ø)
... and 16 more

... and 788 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 19, 2026

Router-nonroot image scan passed

✅ No security vulnerabilities found in image:

ghcr.io/wundergraph/cosmo/router:sha-f39f4c7981ca0a66efed1d2759f05624fefcd52e-nonroot

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
controlplane/src/core/bufservices/federated-graph/createFederatedGraph.ts (1)

38-44: Consider centralizing webhook service construction to reduce callsite drift.

This change is correct. Since the same constructor arguments are repeated in many handlers, a small factory/helper in one place would make future signature changes safer.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@controlplane/src/core/bufservices/federated-graph/createFederatedGraph.ts`
around lines 38 - 44, Multiple callsites construct OrganizationWebhookService
with the same argument list (opts.db, authContext.organizationId, opts.logger,
opts.billingDefaultPlanId, opts.webhookProxyUrl), which will drift if the
constructor changes; factor this into a single factory function (e.g.,
makeOrganizationWebhookService or OrganizationWebhookServiceFactory) that
accepts the minimal inputs (opts and authContext) and returns new
OrganizationWebhookService(...). Replace direct new
OrganizationWebhookService(...) usages (including the one in
createFederatedGraph and other handlers) with calls to the factory so future
constructor signature changes only need one update.
helm/cosmo/charts/controlplane/values.yaml (1)

177-179: Consider adding a documentation comment for consistency.

Other configuration fields in this file have descriptive comments (e.g., lines 164, 188-189, 200). Adding a comment for webhookProxyUrl would improve clarity for operators deploying this chart.

📝 Suggested documentation comment
   webhookUrl: ''
   webhookSecret: ''
+  # -- The proxy URL to use for outgoing webhook requests (optional)
   webhookProxyUrl: ''
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@helm/cosmo/charts/controlplane/values.yaml` around lines 177 - 179, Add a
descriptive documentation comment above the webhookProxyUrl entry in values.yaml
(next to existing comments for webhookUrl and webhookSecret) that explains its
purpose (e.g., an optional HTTP(S) proxy URL used when sending webhook
requests), expected format (scheme://host:port), and that it defaults to empty
when not used; update the comment to match the style and tone of surrounding
comments so operators understand when and how to set webhookProxyUrl.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@helm/cosmo/charts/controlplane/templates/deployment.yaml`:
- Around line 191-195: The WEBHOOK_PROXY_URL environment variable is
unconditionally referenced which can cause missing-secret or empty-string
issues; wrap the WEBHOOK_PROXY_URL block in the same conditional pattern used
for SLACK_APP_CLIENT_SECRET/S3_STORAGE_URL by guarding it with {{- if
.Values.configuration.webhookProxyUrl }} so the secretKeyRef (name: {{ include
"controlplane.secretName" . }}, key: webhookProxyUrl) is only added when
.Values.configuration.webhookProxyUrl is set; remove the block when the value is
not provided to avoid pod startup and Zod .url() validation failures.

---

Nitpick comments:
In `@controlplane/src/core/bufservices/federated-graph/createFederatedGraph.ts`:
- Around line 38-44: Multiple callsites construct OrganizationWebhookService
with the same argument list (opts.db, authContext.organizationId, opts.logger,
opts.billingDefaultPlanId, opts.webhookProxyUrl), which will drift if the
constructor changes; factor this into a single factory function (e.g.,
makeOrganizationWebhookService or OrganizationWebhookServiceFactory) that
accepts the minimal inputs (opts and authContext) and returns new
OrganizationWebhookService(...). Replace direct new
OrganizationWebhookService(...) usages (including the one in
createFederatedGraph and other handlers) with calls to the factory so future
constructor signature changes only need one update.

In `@helm/cosmo/charts/controlplane/values.yaml`:
- Around line 177-179: Add a descriptive documentation comment above the
webhookProxyUrl entry in values.yaml (next to existing comments for webhookUrl
and webhookSecret) that explains its purpose (e.g., an optional HTTP(S) proxy
URL used when sending webhook requests), expected format (scheme://host:port),
and that it defaults to empty when not used; update the comment to match the
style and tone of surrounding comments so operators understand when and how to
set webhookProxyUrl.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e9f6b498-7efc-467c-beab-9c5ffef8645d

📥 Commits

Reviewing files that changed from the base of the PR and between 6936d4d and 36c5e49.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (30)
  • controlplane/package.json
  • controlplane/src/core/bufservices/contract/updateContract.ts
  • controlplane/src/core/bufservices/feature-flag/createFeatureFlag.ts
  • controlplane/src/core/bufservices/feature-flag/deleteFeatureFlag.ts
  • controlplane/src/core/bufservices/feature-flag/enableFeatureFlag.ts
  • controlplane/src/core/bufservices/feature-flag/updateFeatureFlag.ts
  • controlplane/src/core/bufservices/federated-graph/createFederatedGraph.ts
  • controlplane/src/core/bufservices/federated-graph/migrateFromApollo.ts
  • controlplane/src/core/bufservices/federated-graph/moveFederatedGraph.ts
  • controlplane/src/core/bufservices/federated-graph/updateFederatedGraph.ts
  • controlplane/src/core/bufservices/graph/recomposeGraph.ts
  • controlplane/src/core/bufservices/monograph/publishMonograph.ts
  • controlplane/src/core/bufservices/monograph/updateMonograph.ts
  • controlplane/src/core/bufservices/proposal/createProposal.ts
  • controlplane/src/core/bufservices/proposal/updateProposal.ts
  • controlplane/src/core/bufservices/subgraph/checkSubgraphSchema.ts
  • controlplane/src/core/bufservices/subgraph/deleteFederatedSubgraph.ts
  • controlplane/src/core/bufservices/subgraph/moveSubgraph.ts
  • controlplane/src/core/bufservices/subgraph/publishFederatedSubgraph.ts
  • controlplane/src/core/bufservices/subgraph/updateSubgraph.ts
  • controlplane/src/core/build-server.ts
  • controlplane/src/core/env.schema.ts
  • controlplane/src/core/routes.ts
  • controlplane/src/core/webhooks/OrganizationWebhookService.ts
  • controlplane/src/core/webhooks/PlatformWebhookService.ts
  • controlplane/src/core/webhooks/utils.ts
  • controlplane/src/index.ts
  • helm/cosmo/charts/controlplane/templates/deployment.yaml
  • helm/cosmo/charts/controlplane/templates/secret.yaml
  • helm/cosmo/charts/controlplane/values.yaml

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@helm/cosmo/charts/controlplane/README.md`:
- Line 44: Update the README description for configuration.prometheus.host to
correct the spelling error: replace "defautls" with "defaults" in the
user-facing sentence so the line reads that the host "defaults to 127.0.0.1 to
avoid opening the metrics endpoint by default" (locate the text under
configuration.prometheus.host in the README).
- Line 55: Update the README table cell for configuration.s3ForcePathStyle to
use the standard technical casing "path-style URLs" (hyphenated and with "URLs"
uppercase). Locate the table row referencing configuration.s3ForcePathStyle in
helm/cosmo/charts/controlplane/README.md and replace the phrase "path style
urls" (or similar) with "path-style URLs" while preserving the rest of the
description and formatting.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 75e8ab6b-33d0-4e43-973f-4626e21fe12f

📥 Commits

Reviewing files that changed from the base of the PR and between 36c5e49 and 82cd9b6.

📒 Files selected for processing (2)
  • helm/cosmo/charts/controlplane/README.md
  • helm/cosmo/charts/controlplane/templates/deployment.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • helm/cosmo/charts/controlplane/templates/deployment.yaml

@wilsonrivera wilsonrivera merged commit dc4388d into main Mar 30, 2026
57 checks passed
@wilsonrivera wilsonrivera deleted the wilson/eng-9247-update-controlplane-to-use-the-proxy-when-sending-webhooks branch March 30, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants