Skip to content

Added events for snapshots, vmsnapshots, internalLB operations #11230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: 4.19
Choose a base branch
from

Conversation

harikrishna-patnala
Copy link
Contributor

@harikrishna-patnala harikrishna-patnala commented Jul 17, 2025

Description

This PR adds few fixes/improvements for events for few operations on snapshots, vmsnapshots, internalLB.

This addresses few items in the issue #8771

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)

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

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

Copy link

codecov bot commented Jul 17, 2025

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 15.17%. Comparing base (06c80cd) to head (230fd25).
Report is 5 commits behind head on 4.19.

Files with missing lines Patch % Lines
...user/snapshot/CreateSnapshotFromVMSnapshotCmd.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.19   #11230      +/-   ##
============================================
- Coverage     15.18%   15.17%   -0.01%     
+ Complexity    11364    11359       -5     
============================================
  Files          5415     5415              
  Lines        475888   475909      +21     
  Branches      58094    58096       +2     
============================================
- Hits          72256    72226      -30     
- Misses       395546   395602      +56     
+ Partials       8086     8081       -5     
Flag Coverage Δ
uitests 4.28% <ø> (+<0.01%) ⬆️
unittests 15.90% <0.00%> (-0.01%) ⬇️

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.

Co-authored-by: Suresh Kumar Anaparti <sureshkumar.anaparti@gmail.com>
@sureshanaparti sureshanaparti requested a review from Copilot July 22, 2025 06:45
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.

clgtm

Copy link

@Copilot 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 event logging and annotations for snapshot, VM snapshot, and internal load balancer operations to improve system auditing and monitoring. The changes focus on adding ActionEvent annotations to existing methods and updating event handling.

  • Adds ActionEvent annotations to snapshot creation, host maintenance, and internal LB operations
  • Removes manual event logging in favor of annotation-based approach for host maintenance
  • Updates test infrastructure to mock ActionEventUtils for internal LB tests

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
SnapshotManagerImpl.java Adds event annotation for snapshot creation from VM snapshot
ResourceManagerImpl.java Adds event annotations for host maintenance and reconnect operations, removes manual event call
InternalLoadBalancerVMManagerImpl.java Adds event annotations for internal LB VM start and stop operations
InternalLBVMServiceTest.java Updates test to mock ActionEventUtils static calls
CreateSnapshotFromVMSnapshotCmd.java Adds getApiResourceId method for proper resource identification

import org.apache.cloudstack.context.CallContext;
import org.apache.cloudstack.network.lb.InternalLoadBalancerVMService;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.BDDMockito;
import org.mockito.Matchers;
Copy link
Preview

Copilot AI Jul 22, 2025

Choose a reason for hiding this comment

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

The import 'org.mockito.Matchers' is deprecated. Use 'org.mockito.ArgumentMatchers' instead, which is already imported.

Suggested change
import org.mockito.Matchers;

Copilot uses AI. Check for mistakes.

Copy link
Contributor

Choose a reason for hiding this comment

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

@harikrishna-patnala , does this make sense?
it requires line 116 to have a simple adjustment as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@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 14291

@harikrishna-patnala harikrishna-patnala force-pushed the AddedFewEventsImprovements branch from 3fbb7f7 to c620018 Compare July 24, 2025 08:12
@harikrishna-patnala
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@harikrishna-patnala 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.

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.

anyLong() is already statically imported, so no need for importing ArgumentMatchers.

@blueorangutan
Copy link

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

harikrishna-patnala and others added 2 commits July 25, 2025 12:17
Co-authored-by: dahn <daan.hoogland@gmail.com>
Co-authored-by: dahn <daan.hoogland@gmail.com>
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 added this to the 4.19.4 milestone Jul 25, 2025
@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@DaanHoogland 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 14364

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.

Events not generating for BaseCmd classes
4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy