Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

[PM-37593] Add OrganizationUserStatusTypeNew - 🪓 Revoked#7666

Merged
sven-bitwarden merged 3 commits into
mainfrom
ac/pm-37593/add-status-new-columns
May 21, 2026
Merged

[PM-37593] Add OrganizationUserStatusTypeNew - 🪓 Revoked#7666
sven-bitwarden merged 3 commits into
mainfrom
ac/pm-37593/add-status-new-columns

Conversation

@sven-bitwarden

@sven-bitwarden sven-bitwarden commented May 18, 2026

Copy link
Copy Markdown
Contributor

🎟️ Tracking

PM-37593

📔 Objective

This PR implements part of Phase 1 of the initiative to separate Revoked from OrganizationUserStatusType.

The overall initiative will have us creating a new home for OrganizationUserStatusType (sans Revoked), populating it for revokes and checking it first for restores, moving all organization user status type checks to account for revoked now being a separate field, and then cleaning up.

@sven-bitwarden sven-bitwarden requested review from a team as code owners May 18, 2026 21:59
@sven-bitwarden sven-bitwarden added needs-qa ai-review-vnext Request a Claude code review using the vNext workflow labels May 18, 2026
@github-actions

github-actions Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

This PR is Phase 1 scaffolding for the initiative to separate Revoked from OrganizationUserStatusType. It adds a nullable StatusNew SMALLINT column to [dbo].[OrganizationUser], a corresponding nullable OrganizationUserStatusTypeNew? property on the entity, updates all seven OrganizationUser_* stored procedures to pass the column through with safe defaults, and ships parity EF migrations for SQL Server, MySQL, Postgres, and Sqlite. The migration script also refreshes the five views that reference OrganizationUser so SQL metadata stays consistent. No behavior reads or writes the new column yet — that arrives in subsequent phases.

Code Review Details

No findings. Reviewer feedback from mkincaid-bw on column ordering and view refresh has been addressed in the latest revision; the stored proc parameter defaults (@StatusNew SMALLINT = NULL) preserve backward compatibility for existing callers.

@codecov

codecov Bot commented May 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.54%. Comparing base (4224933) to head (c6004d5).
⚠️ Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7666      +/-   ##
==========================================
+ Coverage   59.98%   64.54%   +4.55%     
==========================================
  Files        2121     2132      +11     
  Lines       93543    93905     +362     
  Branches     8301     8341      +40     
==========================================
+ Hits        56113    60611    +4498     
+ Misses      35450    31219    -4231     
- Partials     1980     2075      +95     

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

@mkincaid-bw mkincaid-bw 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.

Couple minor changes

Comment thread src/Sql/dbo/Tables/OrganizationUser.sql Outdated
JaredScar
JaredScar previously approved these changes May 19, 2026

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

Admin Console changes seem fine (only 2 files)

@sven-bitwarden

Copy link
Copy Markdown
Contributor Author

@mkincaid-bw updated - thanks for the reminder especially on the views ✌️

@sven-bitwarden sven-bitwarden requested a review from JaredScar May 20, 2026 14:48
@sonarqubecloud

Copy link
Copy Markdown

@mkincaid-bw mkincaid-bw 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.

LGTM

@eliykat eliykat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Comment is non blocking

@@ -0,0 +1,17 @@
using Bit.Core.Entities;

namespace Bit.Core.Enums;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should be in Bit.Core.AdminConsole.Enums. The only reason our current enum isn't is that moving it would trigger code owner review bingo.

This is non-blocking and can be addressed in a later PR.

public string? ResetPasswordKey { get; set; }
/// <inheritdoc cref="OrganizationUserStatusType"/>
public OrganizationUserStatusType Status { get; set; }
/// <inheritdoc cref="OrganizationUserStatusTypeNew"/>

@eliykat eliykat May 21, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This could do with some more explicit documentation at this stage. e.g.

This is not fully in use yet and should not be used outside the restore/revoke flows.
It is only used to back up the Status before revoking a user, and restore
the user to the correct status later. It should be null if the user is not revoked.

(also non-blocking)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll tack it on to my upcoming PR 💅

@sven-bitwarden sven-bitwarden merged commit b848298 into main May 21, 2026
100 of 108 checks passed
@sven-bitwarden sven-bitwarden deleted the ac/pm-37593/add-status-new-columns branch May 21, 2026 19:08
@djsmith85 djsmith85 added the t:feature Change Type - Feature Development label Jun 10, 2026
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.

5 participants