Skip to content

Conversation

@shwstppr
Copy link
Contributor

@shwstppr shwstppr commented Nov 7, 2025

Description

  • Adds filter functionality for webhooks. Currently, event type filter is supported
  • Assorted fixes

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

image

How Has This Been Tested?

Added filters and checked if delivery for certain events is skipped

Filters:

> list webhookfilters webhookid=818eb2b1-2ceb-4a5d-933b-3d7d0fb791d5 (test)
{
  "count": 2,
  "webhookfilter": [
    {
      "created": "2025-11-07T22:31:44+0530",
      "id": "4508acb7-7099-4d25-a0a9-142dd0921e69",
      "matchtype": "Exact",
      "mode": "Exclude",
      "type": "EventType",
      "value": "VOLUME.CREATE",
      "webhookid": "818eb2b1-2ceb-4a5d-933b-3d7d0fb791d5",
      "webhookname": "test"
    },
    {
      "created": "2025-11-07T16:15:51+0530",
      "id": "cfd6eb26-34a9-44b2-a908-6e69498a86c0",
      "matchtype": "Prefix",
      "mode": "Include",
      "type": "EventType",
      "value": "VM.",
      "webhookid": "818eb2b1-2ceb-4a5d-933b-3d7d0fb791d5",
      "webhookname": "test"
    }
  ]
}

Logs:

2025-11-07 22:43:34,519 DEBUG [o.a.c.m.w.WebhookServiceImpl] (qtp1830014317-30:[ctx-8ca428ad]) (logid:e295aaac) Skipping delivering event Event {"description":"{\"eventDateTime\":\"2025-11-07 22:43:34 +0530\",\"entityuuid\":\"27c1d50c-a514-11f0-ade4-a02942fcdd70\",\"description\":\"user has logged in from IP Address \/127.0.0.1\",\"event\":\"USER.LOGIN\",\"user\":\"27c1d50c-a514-11f0-ade4-a02942fcdd70\",\"account\":\"27c1382d-a514-11f0-ade4-a02942fcdd70\",\"entity\":\"User\",\"status\":\"Completed\"}","eventId":1774,"eventType":"USER.LOGIN","eventUuid":"4853fe04-995c-41c9-a670-ad93f42c2812","resourceType":"User","resourceUUID":"27c1d50c-a514-11f0-ade4-a02942fcdd70"} to webhook Webhook {"id":1,"name":"test","payloadUrl":"https:\/\/smee.io\/C9LPa7Ei3iB6Qj2","uuid":"818eb2b1-2ceb-4a5d-933b-3d7d0fb791d5"} as it doesn't match filters

How did you try to break this feature and the system with this change?

- Adds filter functionality for webhooks. Currently, event type filter
  is supported
- Assorted fixes

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@codecov
Copy link

codecov bot commented Nov 7, 2025

Codecov Report

❌ Patch coverage is 71.86047% with 121 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.76%. Comparing base (5bf869c) to head (6b5f2c2).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
...che/cloudstack/mom/webhook/vo/WebhookFilterVO.java 38.33% 36 Missing and 1 partial ⚠️
...g/apache/cloudstack/mom/webhook/WebhookFilter.java 35.18% 22 Missing and 13 partials ⚠️
.../cloudstack/mom/webhook/WebhookApiServiceImpl.java 86.04% 6 Missing and 12 partials ⚠️
...che/cloudstack/mom/webhook/WebhookServiceImpl.java 80.59% 4 Missing and 9 partials ⚠️
.../webhook/api/command/user/AddWebhookFilterCmd.java 80.00% 6 Missing ⚠️
...bhook/api/command/user/DeleteWebhookFilterCmd.java 68.42% 6 Missing ⚠️
...oudstack/mom/webhook/dao/WebhookFilterDaoImpl.java 81.25% 0 Missing and 6 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #12023      +/-   ##
============================================
+ Coverage     17.51%   17.76%   +0.25%     
- Complexity    15585    15858     +273     
============================================
  Files          5914     5923       +9     
  Lines        529867   530451     +584     
  Branches      64722    64815      +93     
============================================
+ Hits          92782    94228    +1446     
+ Misses       426635   425682     -953     
- Partials      10450    10541      +91     
Flag Coverage Δ
uitests 3.57% <ø> (-0.02%) ⬇️
unittests 18.85% <71.86%> (+0.27%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@apache apache deleted a comment from blueorangutan Nov 10, 2025
@apache apache deleted a comment from blueorangutan Nov 10, 2025
@shwstppr
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15699

@DaanHoogland
Copy link
Contributor

@shwstppr , I understand you need it for your work, but shall we separate out the upgrade code to another PR?

@shwstppr
Copy link
Contributor Author

@DaanHoogland yes, I just added a direct 4220to4230 path here for testing but we may need 4220to4221 and 4221to4230 upgrade paths. Will discuss and create a separate PR for upgrade paths

@shwstppr
Copy link
Contributor Author

@blueorangutan test

@blueorangutan
Copy link

@shwstppr a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-14809)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 51249 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr12023-t14809-kvm-ol8.zip
Smoke tests completed. 149 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@shwstppr shwstppr marked this pull request as ready for review November 13, 2025 03:59
@github-actions
Copy link

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@shwstppr
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@github-actions
Copy link

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@shwstppr
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✖️ el9 ✔️ debian ✖️ suse15. SL-JID 15781

@github-actions
Copy link

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@shwstppr
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✖️ debian ✔️ suse15. SL-JID 15847

@github-actions
Copy link

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@shwstppr
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16206

Copy link
Contributor

@kiranchavala kiranchavala left a comment

Choose a reason for hiding this comment

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

Hi @shwstppr

As discussed could you please add checks for conflicting rules , currently we are allowing them

Screenshot 2025-12-30 at 4 32 08 PM

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@shwstppr
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16218

@shwstppr
Copy link
Contributor Author

@kiranchavala conflicting rules issue should be addressed with the latest commit

Copy link
Contributor

@kiranchavala kiranchavala left a comment

Choose a reason for hiding this comment

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

LGTM

Conflicting rules are addressed with a error message

Screenshot 2026-01-05 at 11 22 31 AM

Existing Filters for a webhook is checked before the webhook is delivered

2026-01-05 05:34:32,882 DEBUG [o.a.c.m.w.WebhookServiceImpl] (qtp253011924-20:[ctx-3586a40b, ctx-27425efe]) (logid:9eaf936f) Skipping delivering Event {"description":"{\"eventDateTime\":\"2026-01-05 05:34:32 +0000\",\"DataCenter\":\"b33b4f35-75ab-48db-a3e1-6c964d13c0d6\",\"entityuuid\":\"239d1c74-7078-4ea1-9aab-26f9980fe9b0\",\"NetworkOffering\":\"dadc4f8a-2111-4883-ae05-129e743d4db4\",\"Network\":\"239d1c74-7078-4ea1-9aab-26f9980fe9b0\",\"description\":\"Successfully completed creating network. Network Id: 204\",\"event\":\"NETWORK.CREATE\",\"Domain\":\"08ae40b9-e9f4-11f0-98c5-1e004000041c\",\"user\":\"588f4873-e9f4-11f0-98c5-1e004000041c\",\"account\":\"588e6b04-e9f4-11f0-98c5-1e004000041c\",\"entity\":\"Network\",\"status\":\"Completed\"}","eventId":140,"eventType":"NETWORK.CREATE","eventUuid":"c0c03d48-d2b7-4c4e-978a-0ff4f503985d","resourceType":"Network","resourceUUID":"239d1c74-7078-4ea1-9aab-26f9980fe9b0"} to Webhook {"id":1,"name":"kiran-webhook","payloadUrl":"http:\/\/10.0.33.232:8080","uuid":"dc42575a-f261-468d-975b-782db0b92212"} as it doesn't match filters

If there are no filters for a webhook then the events are delivered successfully


2026-01-05 05:42:08,075 DEBUG [o.a.c.m.w.WebhookDeliveryThread] (Webhook-Job-Executor-4:[]) (logid:) Delivering event: VOLUME.CREATE for Webhook {"id":1,"name":"kiran-webhook","payloadUrl":"http:\/\/10.0.33.232:8080","uuid":"dc42575a-f261-468d-975b-782db0b92212"}

@DaanHoogland DaanHoogland added this to the 4.23.0 milestone Jan 5, 2026
Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

clgtm

@DaanHoogland DaanHoogland merged commit cd55796 into apache:main Jan 5, 2026
28 checks passed
@DaanHoogland DaanHoogland deleted the webhook-improv-filter branch January 5, 2026 08:12
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.

4 participants