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 <[email protected]>
@codecov
Copy link

codecov bot commented Nov 7, 2025

Codecov Report

❌ Patch coverage is 71.29841% with 126 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.70%. Comparing base (8c86f24) to head (94ccecb).

Files with missing lines Patch % Lines
...g/apache/cloudstack/mom/webhook/WebhookFilter.java 32.72% 26 Missing and 11 partials ⚠️
...che/cloudstack/mom/webhook/vo/WebhookFilterVO.java 38.33% 36 Missing and 1 partial ⚠️
.../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 ⚠️
...ava/com/cloud/upgrade/dao/Upgrade42200to42300.java 57.14% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #12023      +/-   ##
============================================
+ Coverage     17.55%   17.70%   +0.15%     
- Complexity    15543    15727     +184     
============================================
  Files          5910     5919       +9     
  Lines        529334   529827     +493     
  Branches      64654    64736      +82     
============================================
+ Hits          92944    93830     +886     
+ Misses       425933   425469     -464     
- Partials      10457    10528      +71     
Flag Coverage Δ
uitests 3.57% <ø> (-0.02%) ⬇️
unittests 18.79% <71.29%> (+0.16%) ⬆️

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 <[email protected]>
Signed-off-by: Abhishek Kumar <[email protected]>
Signed-off-by: Abhishek Kumar <[email protected]>
Signed-off-by: Abhishek Kumar <[email protected]>
Signed-off-by: Abhishek Kumar <[email protected]>
Signed-off-by: Abhishek Kumar <[email protected]>
Signed-off-by: Abhishek Kumar <[email protected]>
@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

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