Fix account deletion blocked by deleted project admin mappings#12607
Fix account deletion blocked by deleted project admin mappings#12607SURYAS1306 wants to merge 2 commits intoapache:mainfrom
Conversation
2cb8b40 to
836f84a
Compare
| } | ||
| } | ||
|
|
||
|
|
There was a problem hiding this comment.
check indentation ^^^
|
@Imvedansh a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress. |
|
UI build: ✔️ |
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #12607 +/- ##
=============================================
- Coverage 17.90% 3.67% -14.23%
=============================================
Files 5937 453 -5484
Lines 532841 38447 -494394
Branches 65190 7115 -58075
=============================================
- Hits 95397 1414 -93983
+ Misses 426766 36846 -389920
+ Partials 10678 187 -10491
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:
|
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
Description
When attempting to delete an account, CloudStack currently blocks the deletion if the
account is listed as an administrator of any project, even when those projects have
already been deleted (i.e.
removedis not null).This leads to a misleading error and prevents valid account deletion for accounts that
only manage already-deleted projects.
This PR improves the account deletion flow by ensuring that only active projects
are considered when checking whether an account manages projects. Deleted projects are
ignored, allowing the account deletion to proceed correctly.
A unit test has been added to validate this behavior and prevent regressions.
Fixes #12601
Expected behavior
An account should be deletable if it only manages projects that have already been deleted.
Actual behavior
Account deletion fails with an error indicating that the account manages projects,
even when all associated projects are already deleted.
Types of changes
Bug Severity
How Has This Been Tested?
AccountManagerImplTestto verify that an account managingonly deleted projects does not cause account deletion to fail.
account manages active projects.
How did you try to break this feature and the system with this change?
and correctly blocked otherwise.