Skip to content

Conversation

@shwstppr
Copy link
Contributor

Description

This change allows listing events by a particular state - Created, Scheduled, Started, Completed.
A new parameter - state has been added to the listEvents API and corresponding changes have been added in the UI.

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?

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

This change allows listing events by a particular state - Created, Scheduled, Started, Completed.
A new parameter - state has been added to the listEvents API and corresponding changes have been added in the UI.

Signed-off-by: Abhishek Kumar <[email protected]>
@codecov
Copy link

codecov bot commented Jul 31, 2025

Codecov Report

❌ Patch coverage is 25.00000% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.35%. Comparing base (76cfcb4) to head (8a8bbd9).
⚠️ Report is 87 commits behind head on main.

Files with missing lines Patch % Lines
...ain/java/com/cloud/api/query/QueryManagerImpl.java 33.33% 4 Missing and 2 partials ⚠️
...oudstack/api/command/user/event/ListEventsCmd.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #11355      +/-   ##
============================================
+ Coverage     17.17%   17.35%   +0.17%     
- Complexity    14993    15189     +196     
============================================
  Files          5869     5883      +14     
  Lines        521728   524514    +2786     
  Branches      63506    64007     +501     
============================================
+ Hits          89604    91009    +1405     
- Misses       422053   423219    +1166     
- Partials      10071    10286     +215     
Flag Coverage Δ
uitests 3.63% <ø> (-0.13%) ⬇️
unittests 18.39% <25.00%> (+0.23%) ⬆️

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.

Copy link
Contributor

@sureshanaparti sureshanaparti left a comment

Choose a reason for hiding this comment

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

code lgtm

eventSearchBuilder.and("createDateB", eventSearchBuilder.entity().getCreateDate(), SearchCriteria.Op.BETWEEN);
eventSearchBuilder.and("createDateG", eventSearchBuilder.entity().getCreateDate(), SearchCriteria.Op.GTEQ);
eventSearchBuilder.and("createDateL", eventSearchBuilder.entity().getCreateDate(), SearchCriteria.Op.LTEQ);
eventSearchBuilder.and("state", eventSearchBuilder.entity().getState(), SearchCriteria.Op.NEQ);
Copy link
Contributor

Choose a reason for hiding this comment

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

hm, are we sure we never depend on a search for states except for…? It seems strange just reversing the condition.

Copy link
Collaborator

Choose a reason for hiding this comment

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

"state" was not being used in the search criteria before this. So I think it is fine to do so.

Copy link
Collaborator

@abh1sar abh1sar left a comment

Choose a reason for hiding this comment

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

LGTM

@sureshanaparti
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti 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 14489

@sureshanaparti
Copy link
Contributor

Verified the Events filter by state.

CMK:

(localcloud) 🐱 > list events state=Test
🙈 Error: (HTTP 431, error code 4350) Invalid state specified: Test
(localcloud) 🐱 >

(localcloud) 🐱 > list events state=Started
{
  "count": 32,
  "event": [
    {
      "account": "admin",
      "created": "2025-07-31T13:15:53+0000",
      "description": "Creating Physical Network. Physical Network Id: 200",
      "domain": "ROOT",
      "domainid": "263a0f00-6e0e-11f0-87e1-1e0006000436",
      "domainpath": "/",
      "id": "502ca824-1de3-4d4e-ada9-3694f9ddcbbe",
      "level": "INFO",
      "parentid": "e81252b6-6840-49fb-bf6d-3f247925abf7",
      "resourceid": "a9a6d9f9-84c8-43c6-9549-32dcd40a47ec",
      "resourcename": "Physical Network Mgmt",
      "resourcetype": "PhysicalNetwork",
      "state": "Started",
      "type": "PHYSICAL.NETWORK.CREATE",
      "username": "admin"
    },
    {
      "account": "admin",
      "created": "2025-07-31T13:15:56+0000",
      "description": "Creating Physical Network. Physical Network Id: 201",
      "domain": "ROOT",
      "domainid": "263a0f00-6e0e-11f0-87e1-1e0006000436",
      "domainpath": "/",
      "id": "9c367f27-8972-457e-967f-ad553d0098ab",
      "level": "INFO",
      "parentid": "b3e6c45f-163d-4252-9465-74bf0b31cda0",
      "resourceid": "2e264248-b4b9-49f4-9c64-98d7b130d8e0",
      "resourcename": "Physical Network Guest Public",
      "resourcetype": "PhysicalNetwork",
      "state": "Started",
      "type": "PHYSICAL.NETWORK.CREATE",
      "username": "admin"
    },
    ...
    (localcloud) 🐱 > list events state=Completed
{
  "count": 46,
  "event": [
    {
      "account": "admin",
      "created": "2025-07-31T13:15:53+0000",
      "description": "Successfully completed creating zone. Zone Name: pr11355-t13989-kvm-ol8",
      "domain": "ROOT",
      "domainid": "263a0f00-6e0e-11f0-87e1-1e0006000436",
      "domainpath": "/",
      "id": "d619e622-c266-4076-a153-38c56784c115",
      "level": "INFO",
      "resourceid": "a1c72c9c-dec2-4959-b494-6ed47d2638af",
      "resourcename": "pr11355-t13989-kvm-ol8",
      "resourcetype": "Zone",
      "state": "Completed",
      "type": "ZONE.CREATE",
      "username": "admin"
    },
    {
      "account": "admin",
      "created": "2025-07-31T13:15:53+0000",
      "description": "Successfully completed Creating Physical Network. Physical Network Id: 200",
      "domain": "ROOT",
      "domainid": "263a0f00-6e0e-11f0-87e1-1e0006000436",
      "domainpath": "/",
      "id": "fa1b343e-d26d-45f2-8149-bd41a29f7036",
      "level": "INFO",
      "parentid": "e81252b6-6840-49fb-bf6d-3f247925abf7",
      "resourceid": "a9a6d9f9-84c8-43c6-9549-32dcd40a47ec",
      "resourcename": "Physical Network Mgmt",
      "resourcetype": "PhysicalNetwork",
      "state": "Completed",
      "type": "PHYSICAL.NETWORK.CREATE",
      "username": "admin"
    },
...

GUI:

  • List Events, Filters
01-Events-Filters
  • List Events, Created Filter
02-Events-CreatedFilter 02-Events-CreatedFilterApplied
  • List Events, Scheduled Filter
03-Events-ScheduledFilter
  • List Events, Started Filter
04-Events-StartedFilter
  • List Events, Completed Filter
05-Events-CompletedFilter
  • List Events, No Filters
06-Events-NoFilter

@sureshanaparti sureshanaparti merged commit a60c8ca into apache:main Jul 31, 2025
24 of 26 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Apache CloudStack 4.21.0 Jul 31, 2025
@DaanHoogland DaanHoogland deleted the allow-listevents-state branch July 31, 2025 14:06
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Aug 6, 2025
* api,server,ui: allow listing events by state

This change allows listing events by a particular state - Created, Scheduled, Started, Completed.
A new parameter - state has been added to the listEvents API and corresponding changes have been added in the UI.

Signed-off-by: Abhishek Kumar <[email protected]>

* Update api/src/main/java/org/apache/cloudstack/api/command/user/event/ListEventsCmd.java

---------

Signed-off-by: Abhishek Kumar <[email protected]>
Co-authored-by: Suresh Kumar Anaparti <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants