-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Remove user from project before deletion #10008
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
Remove user from project before deletion #10008
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.19 #10008 +/- ##
============================================
+ Coverage 15.10% 15.12% +0.01%
- Complexity 11225 11256 +31
============================================
Files 5404 5408 +4
Lines 473502 473838 +336
Branches 57733 57770 +37
============================================
+ Hits 71543 71672 +129
- Misses 393961 394168 +207
Partials 7998 7998
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
DaanHoogland
left a comment
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
engine/schema/src/main/java/com/cloud/projects/dao/ProjectAccountDaoImpl.java
Outdated
Show resolved
Hide resolved
engine/schema/src/main/java/com/cloud/projects/dao/ProjectAccountDaoImpl.java
Outdated
Show resolved
Hide resolved
sureshanaparti
left a comment
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.
minor comments, overall clgtm
Co-authored-by: Suresh Kumar Anaparti <[email protected]>
Co-authored-by: Suresh Kumar Anaparti <[email protected]>
|
@blueorangutan package |
|
@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. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11657 |
rajujith
left a comment
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.
LGTM.
Tested, this PR fixed the reported issue.
|
@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-11835)
|
* 4.20: UI: Fix userdata and load balancer selection (#10016) Prevent password updates for SAML and LDAP users (#9999) cloudstack-migrate-databases: sql AND added (#10033) engine/schema: move SQLs to 4.20.0 to 4.20.1 upgrade (#10018) Remove user from project before deletion (#10008) Simplify validation for creating volume templates via UI (#9828)
Co-authored-by: Suresh Kumar Anaparti <[email protected]>
* 4.20: UI: Fix userdata and load balancer selection (apache#10016) Prevent password updates for SAML and LDAP users (apache#9999) cloudstack-migrate-databases: sql AND added (apache#10033) engine/schema: move SQLs to 4.20.0 to 4.20.1 upgrade (apache#10018) Remove user from project before deletion (apache#10008) Simplify validation for creating volume templates via UI (apache#9828)
Description
If a user that is associated to a project gets deleted, other users become unable to see who belongs to the project via
listProjectAccountsdue to a NPE. This happens because the removed user is still associated with the project.This PR fixes the issue by removing the user from all projects before deleting it (as we already do with accounts). To normalize environments that are affected by the bug, the following script will be executed during the upgrade in order to delete project-user associations for users that were removed.
Fixes #9974
Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
How Has This Been Tested?
User clean-up on deletion
After step 3, I would become unable to list accounts/users that belong to the project via
listProjectAccountsbefore the changes. With the changes, I was able to list them normally.Normalization of affected environments
Before applying the patch, I created some broken projects by deleting their users. Then, I executed the upgrade script and verified that I was able to list their accounts/users normally.