- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.2k
Change internal ID to UUID in user disable event #11824
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
base: main
Are you sure you want to change the base?
Conversation
| Codecov Report❌ Patch coverage is  
 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     
 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
 | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clgtm
There was a problem hiding this 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.
| @blueorangutan package | 
| @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()); | 
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
have the method getId() be replaced by a method getUuid() that takes care of it, for instance. We are sure to have to do a lot of replacements so I have no real preference, but having three dots (.), two method calls and a type passing seems not as generic as we can make it. I do not think we should perse do it in one of these two PRs, this and #11649) but let’s think about it. We are sure to have more occurrences like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think we should perse do it in one of these two PRs, this and #11649) but let’s think about it. We are sure to have more occurrences like this.
Sure. Then, I will map an issue to handle this properly and try to work on it later.
| Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✖️ debian ✔️ suse15. SL-JID 15432 | 
| @blueorangutan test | 
| @DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests | 
| [SF] Trillian test result (tid-14701) 
 | 
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
Feature/Enhancement Scale or Bug Severity
Bug Severity
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
userin theadminaccount, 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?