Skip to content

[PM-41311] Register Fill Assist policy - #8123

Draft
bensbits91 wants to merge 3 commits into
mainfrom
pm-41311-register-fill-assist-policy
Draft

[PM-41311] Register Fill Assist policy#8123
bensbits91 wants to merge 3 commits into
mainfrom
pm-41311-register-fill-assist-policy

Conversation

@bensbits91

@bensbits91 bensbits91 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

🎟️ Tracking

PM-41311

📔 Objective

Registers the FillAssist policy type on the server as part of Fill Assist Milestone 2 (epic PM-39414). This milestone introduces an organizational policy that lets admins:

  • Turn Fill Assist on as the default for org members who have never explicitly set their own Fill Assist preference. Members who have already opted in or out keep their choice.
  • Optionally point the client at a custom rules feed URL (typically a fork of bitwarden/map-the-web) to replace the default CDN feed.

This PR registers the new PolicyType.FillAssist enum value and wires up its { rulesUrl } payload with [Required] + [Url] validation, and the corresponding unit and integration tests.

Notes:

  • No enforcement is performed server-side — Fill Assist is applied entirely in the client, and the server simply persists the policy for clients to read.
  • The enum value (22) matches the corresponding sdk-internal enum addition in PM-41310 / PR 1321.

Signed-off-by: Ben Brooks <bbrooks@bitwarden.com>
@bensbits91 bensbits91 added the ai-review-vnext Request a Claude code review using the vNext workflow label Jul 31, 2026
@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Re-reviewed after the latest commit. Both previously flagged findings are resolved: ValidateAndSerialize now takes an enabled flag so {"enabled": false} with no data no longer 400s on either the internal or Public API, and the HTTPS scheme check is case-insensitive via (?i). Traced the three call sites (ToPolicyUpdateAsync, ToPolicyUpdate, ToSavePolicyModel) — all pass Enabled.GetValueOrDefault(), and Enabled is [Required] on both request models, so model binding rejects a missing value before this code runs. Enum registration, display name, and IPolicyDataModel wiring match the pattern used by the most recent policy addition (OrganizationUserNotification); no validator or event-handler registration is needed since the policy has no server-side enforcement or dependencies. Unit and integration tests cover valid, missing, empty, malformed, non-HTTPS, uppercase-scheme, wrong-type, and disable-without-data cases.

Code Review Details

No blocking findings.

PR Metadata Assessment

  • ❓ : The description says the custom rules feed URL is optional, but rulesUrl is now [Required] whenever the policy is enabled — worth updating the description (or the constraint) so the client team and reviewers work from the same contract.

@bensbits91 bensbits91 added the t:feature Change Type - Feature Development label Jul 31, 2026
Signed-off-by: Ben Brooks <bbrooks@bitwarden.com>
Comment thread src/Core/AdminConsole/Utilities/PolicyDataValidator.cs Outdated
Comment thread src/Core/AdminConsole/Models/Data/Organizations/Policies/FillAssistPolicyData.cs Outdated
@codecov

codecov Bot commented Aug 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.81818% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.87%. Comparing base (32342d4) to head (0485719).

Files with missing lines Patch % Lines
.../Public/Models/Request/PolicyUpdateRequestModel.cs 50.00% 1 Missing ⚠️
src/Core/AdminConsole/Enums/PolicyType.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8123   +/-   ##
=======================================
  Coverage   62.87%   62.87%           
=======================================
  Files        2301     2302    +1     
  Lines      100212   100220    +8     
  Branches     9019     9020    +1     
=======================================
+ Hits        63008    63014    +6     
- Misses      35020    35022    +2     
  Partials     2184     2184           

☔ View full report in Codecov by Harness.
📢 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.

…heck

Signed-off-by: Ben Brooks <bbrooks@bitwarden.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review-vnext Request a Claude code review using the vNext workflow t:feature Change Type - Feature Development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant