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.52778% with 123 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.72%. Comparing base (dc8f465) to head (3e0bd24).
⚠️ Report is 4 commits behind head on main.

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 ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #12023      +/-   ##
============================================
+ Coverage     17.56%   17.72%   +0.15%     
- Complexity    15539    15730     +191     
============================================
  Files          5911     5919       +8     
  Lines        529359   529844     +485     
  Branches      64655    64737      +82     
============================================
+ Hits          92979    93906     +927     
+ Misses       425922   425408     -514     
- Partials      10458    10530      +72     
Flag Coverage Δ
uitests 3.57% <ø> (-0.02%) ⬇️
unittests 18.80% <71.52%> (+0.17%) ⬆️

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.

@blueorangutan
Copy link

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

@shwstppr shwstppr requested a review from Copilot November 13, 2025 14:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds webhook filter functionality to allow filtering webhook deliveries by event types, along with various fixes and enhancements. The implementation includes both UI and backend components with comprehensive test coverage.

Key Changes:

  • Added webhook filter functionality with Include/Exclude modes and multiple match types (Exact, Prefix, Suffix, Contains)
  • Implemented caching for webhooks and filters to improve performance
  • Added comprehensive unit tests for DAO and service layers
  • Fixed Python integration test and various API command issues

Reviewed Changes

Copilot reviewed 38 out of 38 changed files in this pull request and generated no comments.

Show a summary per file
File Description
ui/src/config/section/tools.js Added filters tab to webhook configuration
ui/src/components/view/WebhookFiltersTab.vue New Vue component for managing webhook filters
ui/src/components/view/ListView.vue Added webhook filter support to list view
ui/public/locales/en.json Added localization strings for filter feature
engine/schema/src/main/resources/META-INF/db/schema-42200to42300.sql Created webhook_filter table schema
plugins/event-bus/webhook/src/main/java/.../WebhookFilter.java Filter interface with conflict detection logic
plugins/event-bus/webhook/src/main/java/.../WebhookFilterVO.java Filter value object implementation
plugins/event-bus/webhook/src/main/java/.../dao/WebhookFilterDao*.java DAO for webhook filter operations
plugins/event-bus/webhook/src/main/java/.../WebhookServiceImpl.java Added filter matching logic and cache
plugins/event-bus/webhook/src/main/java/.../WebhookApiServiceImpl.java API service implementation for filters
plugins/event-bus/webhook/src/main/java/.../api/command/user/*.java Added filter command classes
plugins/event-bus/webhook/src/test/java/.../*Test.java Comprehensive unit tests for all components
test/integration/smoke/test_webhook_lifecycle.py Fixed integration test response handling

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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>
@DaanHoogland
Copy link
Contributor

DaanHoogland commented Nov 14, 2025

--tnx @shwstppr , let’s merge the upgrade path first/separately (lgtm so far)—

ignore, totally confusing PRs.

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