Skip to content

[PM-44990] refactor: Add SDK record mapper for policies - #24086

Merged
eliykat merged 5 commits into
mainfrom
ac/pm-44990/sdk-policy-record-mapper
Nov 3, 2026
Merged

eliykat merged 5 commits into
mainfrom
ac/pm-44990/sdk-policy-record-mapper

Conversation

@eliykat

@eliykat eliykat commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-44990

📔 Objective

Add PolicyRecordMapper so the SDK can read and write policy state through a client-managed repository. Registering it in initializeClientManagedState is done in #24209.

Also:

🤖 AI-assisted review

Local code review (Standard, code-review-local): APPROVE, no findings, nothing deferred. This review covered the original unsplit change. The fromSdkPolicy wrapper was added afterwards.

@eliykat eliykat added ai-review Request a Claude code review t:tech-debt Change Type - Tech debt labels Oct 23, 2026
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

This PR adds PolicyRecordMapper over POLICIES_NEW and makes it the single place SDK policies are mapped. Policy.fromSdkPolicy is now a thin wrapper around the mapper, and InternalNewPolicyService.policies$ emits PolicyData[], which DefaultPolicyService converts to Policy itself. The latest commit changes the mapper spec's empty-data fixture to data: undefined, so it now matches the mapper's output. That resolves the earlier finding on policy-sdk-mapper.spec.ts. No new issues were found.

@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.61%. Comparing base (de6c9f6) to head (335267a).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...c/admin-console/models/domain/policy-sdk-mapper.ts 70.00% 2 Missing and 1 partial ⚠️
...s/common/src/admin-console/models/domain/policy.ts 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #24086   +/-   ##
=======================================
  Coverage   61.61%   61.61%           
=======================================
  Files        4892     4893    +1     
  Lines      157691   157693    +2     
  Branches    25265    25263    -2     
=======================================
+ Hits        97164    97168    +4     
+ Misses      53836    53835    -1     
+ Partials     6691     6690    -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@eliykat

eliykat commented Oct 28, 2026

Copy link
Copy Markdown
Member Author

Other teams' changes have been split to stacked PRs.

@eliykat
eliykat force-pushed the ac/pm-44990/sdk-policy-record-mapper branch 2 times, most recently from 8800f83 to 1e7d710 Compare October 29, 2026 20:53
Base automatically changed from ac/pm-44990/sdk-policy-consumers-auth to main October 29, 2026 21:21
@eliykat
eliykat force-pushed the ac/pm-44990/sdk-policy-record-mapper branch from 1e7d710 to f99a3fe Compare October 29, 2026 21:21
@eliykat
eliykat requested a review from BTreston October 29, 2026 21:22
@eliykat
eliykat enabled stacked auto-merge (squash) October 29, 2026 21:23
stacked auto-merge was automatically disabled October 30, 2026 22:36

Replaced by a newer auto-merge request

@eliykat
eliykat enabled stacked auto-merge (squash) October 30, 2026 22:36
@eliykat
eliykat force-pushed the ac/pm-44990/sdk-policy-record-mapper branch 2 times, most recently from 624a371 to f99a3fe Compare November 2, 2026 21:53
@eliykat
eliykat requested a review from BTreston November 2, 2026 23:41
@eliykat
eliykat force-pushed the ac/pm-44990/sdk-policy-record-mapper branch from 523fa66 to e62fe51 Compare November 3, 2026 02:56
@eliykat
eliykat merged commit faa735c into main Nov 3, 2026
160 of 161 checks passed
@eliykat
eliykat deleted the ac/pm-44990/sdk-policy-record-mapper branch November 3, 2026 22:53
@djsmith85 djsmith85 added browser Browser Extension desktop Desktop Application cli CLI Application web labels Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a Claude code review browser Browser Extension cli CLI Application desktop Desktop Application t:tech-debt Change Type - Tech debt web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants