Skip to content

Conversation

erikbocks
Copy link
Contributor

Description

During the user disablement process, created events contain the user internal ID instead of the user UUID. Therefore, this PR fixes this behaviour by changing the internal ID in the event descriptions to the user's UUID.

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

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

I built the packages with the changes and applied them to my local environment. In Apache CloudStack, I created a new user user in the admin account, then disabled it. In the events, I validated that the user's UUID were shown instead of the user's internal ID.

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

Copy link

codecov bot commented Oct 13, 2025

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.56%. Comparing base (ec533cd) to head (b775848).
⚠️ Report is 51 commits behind head on main.

Files with missing lines Patch % Lines
...udstack/api/command/admin/user/DisableUserCmd.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #11824      +/-   ##
============================================
+ Coverage     17.42%   17.56%   +0.13%     
- Complexity    15336    15498     +162     
============================================
  Files          5892     5899       +7     
  Lines        526521   527793    +1272     
  Branches      64293    64479     +186     
============================================
+ Hits          91767    92703     +936     
- Misses       424401   424666     +265     
- Partials      10353    10424      +71     
Flag Coverage Δ
uitests 3.59% <ø> (-0.02%) ⬇️
unittests 18.62% <0.00%> (+0.14%) ⬆️

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

@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

Copy link
Member

@vishesh92 vishesh92 left a comment

Choose a reason for hiding this comment

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

clgtm. didn't test.

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

@Override
public String getEventDescription() {
return "disabling user: " + getId();
return "disabling user: " + this._uuidMgr.getUuid(User.class, getId());
Copy link
Contributor

Choose a reason for hiding this comment

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

@erikbocks , can we make
this._uuidMgr.getUuid(User.class, getId()); a more generic event utility? It also concerns https://github.com/apache/cloudstack/pull/11649/files though it was not changed there. I am pretty sure we can find more places. cc @vishesh92 @bernardodemarco

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@DaanHoogland, I did not understand what "more generic event utility" means. For me, the UUIDManager.getUUID() method is as generic as it can be. Could you try to explain a little more of what is your idea?

Copy link
Member

Choose a reason for hiding this comment

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

it is a good idea and good start
can you expand this PR to support other resources, for example user (besides disable), account, domain, vm ,network, volume, etc ?
@erikbocks

@blueorangutan
Copy link

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

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.

5 participants