Skip to content

[PM-38101] Add Staged Provision API Fields#7927

Merged
sven-bitwarden merged 2 commits into
mainfrom
ac/pm-38101/wire-staged-provisioning-command
Jul 7, 2026
Merged

[PM-38101] Add Staged Provision API Fields#7927
sven-bitwarden merged 2 commits into
mainfrom
ac/pm-38101/wire-staged-provisioning-command

Conversation

@sven-bitwarden

@sven-bitwarden sven-bitwarden commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

🎟️ Tracking

PM-38101

📔 Objective

Closing in on the saga for Staged users, this PR opens up BWDC and SCIM to provide a new option: InviteUsersAfterProvisioning. When true, the system operates as it does today - provisioned users are invited. When false, users are no longer invited post-provisioning, they are instead added to the new Staged status, wherein they don't occupy seat counts, or really do much of anything in our system except become placeholders for be invited.

@sven-bitwarden sven-bitwarden requested a review from a team as a code owner July 6, 2026 14:14
@sven-bitwarden sven-bitwarden requested a review from JaredScar July 6, 2026 14:14
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

This PR adds an InviteUsersAfterProvisioning option to the SCIM connection config and the Public API import endpoint. When false (and the PM34423StagedStatus flag is enabled), provisioned users are created in the Staged status via CreateStagedOrganizationUsersCommand instead of being invited. The new branches are correctly feature-flagged, default to the existing invite behavior, preserve conflict/duplicate handling, and update the external-ID mapping so staged users still associate with imported groups. Unit and integration tests cover all four paths (flag on/off, invite on/off, missing config).

Code Review Details

No blocking findings.

Notes considered and dropped after validation:

  • The SCIM staged-user conflict check compares ExternalId case-sensitively (PostUserCommand.cs:65), unlike the vNext invite path which uses OrdinalIgnoreCase. This intentionally mirrors the legacy InviteScimOrganizationUserAsync path it is based on, so it is consistent with existing behavior rather than a regression.
  • test/Billing.IntegrationTest/packages.lock.json bumps internal project references (2026.6.0 → 2026.6.2) with no manifest change in the diff. These are internal Bitwarden project versions tracked with the repo version; this is routine lock-file regeneration, not a dependency concern.

@sven-bitwarden sven-bitwarden added ai-review-vnext Request a Claude code review using the vNext workflow t:feature Change Type - Feature Development labels Jul 6, 2026
@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.35294% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.35%. Comparing base (809f6b9) to head (5b94151).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
...itwarden_license/src/Scim/Users/PostUserCommand.cs 70.96% 4 Missing and 5 partials ⚠️
.../Import/ImportOrganizationUsersAndGroupsCommand.cs 90.90% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7927      +/-   ##
==========================================
- Coverage   65.85%   61.35%   -4.50%     
==========================================
  Files        2244     2244              
  Lines       98673    98743      +70     
  Branches     8912     8925      +13     
==========================================
- Hits        64978    60586    -4392     
- Misses      31462    36014    +4552     
+ Partials     2233     2143      -90     

☔ 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.

Base automatically changed from ac/pm-37954/add-staged-provision-command to main July 6, 2026 18:02
@sven-bitwarden sven-bitwarden requested a review from a team as a code owner July 6, 2026 18:02
@JaredScar

Copy link
Copy Markdown
Contributor

Lint failing, re-requiest review when passing tests please @sven-bitwarden

@JaredScar JaredScar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failing tests

@sven-bitwarden sven-bitwarden force-pushed the ac/pm-38101/wire-staged-provisioning-command branch from 8cbd42e to 4d6ffb0 Compare July 7, 2026 14:20
@sven-bitwarden sven-bitwarden requested a review from JaredScar July 7, 2026 14:46
@sven-bitwarden sven-bitwarden merged commit 4c49e19 into main Jul 7, 2026
43 checks passed
@sven-bitwarden sven-bitwarden deleted the ac/pm-38101/wire-staged-provisioning-command branch July 7, 2026 18:15
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.

2 participants