Skip to content
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

Introduce Method to Retrieve User Roles of a Shared User #6308

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

BimsaraBodaragama
Copy link
Member

Proposed changes in this pull request

  • Introduced getRoleIdListOfSharedUser to fetch role IDs for shared users.
  • Refactored getRoleIdListOfUser to reuse common logic via a private method getRoleIdsOfUser.
  • Updated SQL query handling to differentiate between shared and regular users.

When should this PR be merged

  • This PR can be merged after a review and successful validation of the changes.

Follow up actions

  • Validate the functionality in relevant test scenarios to ensure correct behavior. (Can verify with the user sharing feature)

Related Issue

Introduce Method to Retrieve User Roles of a Shared User

@BimsaraBodaragama
Copy link
Member Author

[Quality Gate failed]
This error comes from code duplication in the RoleManegementService and RoleDAO since they share the same code. Yet, this is not only because of my new code but also because of the overall.

Copy link

codecov bot commented Jan 20, 2025

Codecov Report

Attention: Patch coverage is 67.64706% with 11 lines in your changes missing coverage. Please review.

Project coverage is 46.38%. Comparing base (368134f) to head (57644ca).
Report is 32 commits behind head on master.

Files with missing lines Patch % Lines
...bon/identity/role/v2/mgt/core/dao/RoleDAOImpl.java 74.19% 4 Missing and 4 partials ⚠️
...entity/role/v2/mgt/core/RoleManagementService.java 0.00% 1 Missing ⚠️
...ty/role/v2/mgt/core/RoleManagementServiceImpl.java 0.00% 1 Missing ⚠️
.../carbon/identity/role/v2/mgt/core/dao/RoleDAO.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6308      +/-   ##
============================================
+ Coverage     45.91%   46.38%   +0.47%     
- Complexity    14481    14598     +117     
============================================
  Files          1672     1676       +4     
  Lines        103141   103109      -32     
  Branches      18010    18027      +17     
============================================
+ Hits          47360    47832     +472     
+ Misses        48970    48431     -539     
- Partials       6811     6846      +35     
Flag Coverage Δ
unit 29.58% <67.64%> (+0.40%) ⬆️

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.

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
47.5% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@BimsaraBodaragama
Copy link
Member Author

[Quality Gate failed]
This error comes from code duplication in the RoleManegementService, RoleDAO and RoleDAOImpl since they share the same code. Yet, this is not only because of my new code but also because of the overall.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants