Skip to content

NPE correction when informing removed project in the 'listProjectRoles'#13022

Open
Tonitzpp wants to merge 1 commit intoapache:mainfrom
scclouds:npe-in-listprojects
Open

NPE correction when informing removed project in the 'listProjectRoles'#13022
Tonitzpp wants to merge 1 commit intoapache:mainfrom
scclouds:npe-in-listprojects

Conversation

@Tonitzpp
Copy link
Copy Markdown
Contributor

Description

Currently, when using the listProjectRoles API, passing the projectid parameter of a removed project results in an NPE. This PR changes this behavior to return the message Failed to find project by ID instead.

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

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

Before the changes image
After the changes image

How Has This Been Tested?

To perform the tests, a test project was created along with a project role. The project was deleted and the listProjectRoles API was called passing the ID of the project role. This showed the new message.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 14, 2026

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.94%. Comparing base (3bd5410) to head (86e0552).
⚠️ Report is 100 commits behind head on main.

Files with missing lines Patch % Lines
...command/admin/acl/project/ListProjectRolesCmd.java 0.00% 3 Missing ⚠️
.../apache/cloudstack/acl/ProjectRoleManagerImpl.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #13022      +/-   ##
============================================
- Coverage     18.02%   17.94%   -0.08%     
- Complexity    16450    16499      +49     
============================================
  Files          5968     6019      +51     
  Lines        537086   540750    +3664     
  Branches      65961    66255     +294     
============================================
+ Hits          96820    97061     +241     
- Misses       429346   432749    +3403     
- Partials      10920    10940      +20     
Flag Coverage Δ
uitests 3.53% <ø> (-0.01%) ⬇️
unittests 19.10% <0.00%> (-0.10%) ⬇️

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.

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.

1 participant