Skip to content

Add backing implementation for [apim.webhooks.http] enable = false - #14259

Open
ashanhr wants to merge 2 commits into
wso2:masterfrom
ashanhr:fix/17871-webhook-http-enable
Open

Add backing implementation for [apim.webhooks.http] enable = false#14259
ashanhr wants to merge 2 commits into
wso2:masterfrom
ashanhr:fix/17871-webhook-http-enable

Conversation

@ashanhr

@ashanhr ashanhr commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Registers apim.webhooks.http.enable (default: true) in default.json for both the all-in-one-apim and gateway distributions.
  • Adds WebhookServer.xml.j2 templates (in apim-synapse-config/ and synapse-configs/default/inbound-endpoints/) that render the suspend attribute from the config key.

When [apim.webhooks.http] enable = false is set in deployment.toml, the config mapper now renders WebhookServer.xml with suspend="true", which prevents Synapse from binding port 9021 at startup. Previously this config key was silently ignored because there was no default.json entry and no j2 template.

This follows the same pattern already established for the HTTPS webhook (apim.webhooks.https.enable + SecureWebhookServer.xml.j2).

Dev Test

Tested against a 4.1.0 pack (patching the template and default.json files directly):

  1. Set [apim.webhooks.http] enable = false in deployment.toml
  2. Started the server — WebhookServer.xml rendered with suspend="true"
  3. Verified port 9021 is not bound (lsof -i :9021 returns nothing)
  4. Verified port 8021 (HTTPS webhook) remains open — unaffected

Related issue

wso2/api-manager#5141

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 19fe510c-c765-4343-bb57-65416b1963d0

📥 Commits

Reviewing files that changed from the base of the PR and between e45a460 and 9fd35b3.

📒 Files selected for processing (6)
  • all-in-one-apim/modules/distribution/product/src/main/resources/conf/default.json
  • all-in-one-apim/modules/distribution/product/src/main/resources/conf/templates/repository/deployment/server/synapse-configs/default/inbound-endpoints/WebhookServer.xml.j2
  • all-in-one-apim/modules/distribution/product/src/main/resources/conf/templates/repository/resources/apim-synapse-config/WebhookServer.xml.j2
  • gateway/modules/distribution/product/src/main/resources/conf/default.json
  • gateway/modules/distribution/product/src/main/resources/conf/templates/repository/deployment/server/synapse-configs/default/inbound-endpoints/WebhookServer.xml.j2
  • gateway/modules/distribution/product/src/main/resources/conf/templates/repository/resources/apim-synapse-config/WebhookServer.xml.j2
🚧 Files skipped from review as they are similar to previous changes (6)
  • all-in-one-apim/modules/distribution/product/src/main/resources/conf/default.json
  • gateway/modules/distribution/product/src/main/resources/conf/templates/repository/deployment/server/synapse-configs/default/inbound-endpoints/WebhookServer.xml.j2
  • gateway/modules/distribution/product/src/main/resources/conf/templates/repository/resources/apim-synapse-config/WebhookServer.xml.j2
  • all-in-one-apim/modules/distribution/product/src/main/resources/conf/templates/repository/resources/apim-synapse-config/WebhookServer.xml.j2
  • gateway/modules/distribution/product/src/main/resources/conf/default.json
  • all-in-one-apim/modules/distribution/product/src/main/resources/conf/templates/repository/deployment/server/synapse-configs/default/inbound-endpoints/WebhookServer.xml.j2

📝 Walkthrough

Walkthrough

Adds HTTP webhook enablement to both product distributions. The change adds matching Synapse WebhookServer templates that use the main sequence, HTTP port 9021, and configuration-controlled suspension.

Changes

HTTP webhook enablement

Layer / File(s) Summary
Webhook endpoint configuration
all-in-one-apim/.../conf/default.json, all-in-one-apim/.../WebhookServer.xml.j2, gateway/.../conf/default.json, gateway/.../WebhookServer.xml.j2
Both distributions set apim.webhooks.http.enable to true. The templates define the WebhookServer HTTP inbound endpoint on port 9021 and set suspension from the configuration property.

Estimated code review effort: 2 (Simple) | ~10 minutes

Mergeability Score: ⚪ Minimal · up to 9fd35

The PR adds the HTTP webhook enable/disable configuration and renders the corresponding suspend behavior in both distributions; no actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: anugayan, arshardh, chamilaadhi

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the configuration, template changes, expected behavior, testing, and related issue.
Title check ✅ Passed The title clearly identifies the backing implementation for disabling HTTP webhooks through the apim.webhooks.http setting.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 17, 2026
Registers apim.webhooks.http.enable in default.json (default: true) and
adds WebhookServer.xml.j2 templates for both all-in-one and gateway
distributions. The config mapper now renders WebhookServer.xml with
suspend="true" when the key is set to false, which prevents Synapse from
binding port 9021 on startup.

Fixes: wso2/api-manager#5141

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.77%. Comparing base (f7f82e8) to head (9fd35b3).
⚠️ Report is 10 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master   #14259   +/-   ##
=========================================
  Coverage     62.77%   62.77%           
  Complexity      161      161           
=========================================
  Files            25       25           
  Lines           454      454           
  Branches         11       11           
=========================================
  Hits            285      285           
  Misses          163      163           
  Partials          6        6           
Flag Coverage Δ
integration-v2_tests 62.77% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

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