[PM-37486] Remove IPolicyService and associated dead code#7672
Conversation
…pendency and replace with IPolicyRequirementQuery for policy checks. Update related tests to reflect changes in policy validation logic.
…Service with IPolicyRequirementQuery for policy checks. Update tests accordingly to reflect changes in policy validation logic.
…updating PolicyServiceCollectionExtensions and deleting associated tests. This change streamlines policy management by relying on IPolicyRequirementQuery for policy checks.
…tailsAsync method and associated tests.
…icyDetails and PolicyDetails_ReadByUserId, as they are no longer called in the codebase.
Bitwarden Claude Code ReviewOverall Assessment: APPROVE This PR completes the migration from the legacy Prior reviewer concerns appear addressed: the orphaned Code Review DetailsNo new findings. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7672 +/- ##
==========================================
+ Coverage 59.98% 64.45% +4.47%
==========================================
Files 2133 2130 -3
Lines 93731 93640 -91
Branches 8311 8314 +3
==========================================
+ Hits 56226 60360 +4134
+ Misses 35527 31213 -4314
- Partials 1978 2067 +89 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…es, as they are no longer needed in the codebase.
…licyRequirementQuery for SSO validation checks. Update related test logic to ensure accurate policy validation outcomes. Clean up unused test fixtures in PolicyFixtures.cs to streamline the codebase.
…ability by storing policy requirement results in local variables before returning values. This change enhances code clarity while maintaining existing functionality.
…of the policy requirement query in a local variable before returning the enforced options. This change enhances code readability while preserving existing functionality.
| -- OrganizationUser_ReadByUserIdWithPolicyDetails was used by PolicyService (now deleted). | ||
| -- PolicyDetails_ReadByUserId was never called anywhere. | ||
|
|
||
| DROP PROCEDURE IF EXISTS [dbo].[OrganizationUser_ReadByUserIdWithPolicyDetails]; |
There was a problem hiding this comment.
It looks like the C# code that calls this proc is being removed in this PR. If the deployment requires a server code rollback, this DROP would cause issues since DB changes are not reverted. This DROP should be moved to another PR to be done at a later date once this server deployment is hardened.
There was a problem hiding this comment.
Thanks for calling this out! I have reverted the SQL changes in this branch. I will create a separate task to drop the stored procedures in a future release.
…dWithPolicyDetails and PolicyDetails_ReadByUserId, as they are no longer called in the codebase." This reverts commit 0f4fdca.
|



🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-37486
📔 Objective
Migrate remaining
IPolicyServicecallers to useIPolicyRequirementQueryand subsequently deleteIPolicyServiceand no longer used stored procedures.