Skip to content

[PM-31978] Expand Organization Ability documentation#6970

Merged
eliykat merged 17 commits intomainfrom
ac/pm-31978/expand-organizationability-documentation
Feb 17, 2026
Merged

[PM-31978] Expand Organization Ability documentation#6970
eliykat merged 17 commits intomainfrom
ac/pm-31978/expand-organizationability-documentation

Conversation

@eliykat
Copy link
Copy Markdown
Member

@eliykat eliykat commented Feb 10, 2026

🎟️ Tracking

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

📔 Objective

In #6781 we added initial documentation around the organization ability pattern. This PR incorporates additional documentation from Confluence, including a step-by-step guide with file references. This has been cross-checked and updated. The confluence doc will be deleted or archived to avoid confusion.

📸 Screenshots

@eliykat eliykat requested a review from a team as a code owner February 10, 2026 02:18
@eliykat eliykat requested review from a team, amorask-bitwarden, r-tome and sven-bitwarden and removed request for a team February 10, 2026 02:18
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 10, 2026

Logo
Checkmarx One – Scan Summary & Details0898c925-27e9-447b-bb71-f3fd02cab3df

Fixed Issues (2)

Great job! The following issues were fixed in this Pull Request

Severity Issue Source File / Package
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1178
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1062

@eliykat eliykat added the ai-review Request a Claude code review label Feb 10, 2026
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Feb 10, 2026

Claude finished @eliykat's task in 3m 25s —— View job


Reviewing PR #6970

  • Gather context and read changed files
  • Check if previous review comments have been addressed
  • Verify file paths and code examples
  • Post review summary

Review Summary

PR: PM-31978 Expand Organization Ability documentation
Type: Documentation
Risk: Low
Files changed: 1 (src/Core/AdminConsole/OrganizationFeatures/OrganizationAbility/README.md)

Assessment

This is a well-structured documentation expansion that consolidates knowledge from Confluence into the codebase. The PR adds a detailed step-by-step guide for adding new organization abilities, a comparison table for abilities vs. feature flags vs. policies, and comprehensive file references for each step.

Verification performed:

  • All 30+ file paths referenced in the guide verified as existing in the current codebase
  • PlanType enum values in the SQL example (4, 5, 10, 11, 14, 15, 19, 20) verified against src/Core/Billing/Enums/PlanType.cs -- all correctly map to Enterprise plan types across all versions
  • Method names referenced (UpdateFromLicense, VerifyData, GetDataBytes, GetManyAbilitiesAsync, GetOrganizationAbilityAsync) verified as existing in the referenced files
  • Code examples match actual patterns used in the codebase (e.g., _applicationCacheService.GetOrganizationAbilityAsync() pattern matches usage in SavePolicyCommand.cs, CipherService.cs, etc.)
  • All feedback from @kdenney's review has been incorporated (OrganizationLicense updates, UpdateFromLicense(), GetDataBytes() ignored fields, and test references)

Result

No issues found. The documentation is accurate, comprehensive, and will be a valuable reference for developers adding new organization abilities.

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.46%. Comparing base (de330e9) to head (6694d27).
⚠️ Report is 29 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6970      +/-   ##
==========================================
+ Coverage   56.26%   56.46%   +0.20%     
==========================================
  Files        1983     1996      +13     
  Lines       87651    88039     +388     
  Branches     7815     7845      +30     
==========================================
+ Hits        49317    49715     +398     
+ Misses      36504    36487      -17     
- Partials     1830     1837       +7     

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

r-tome
r-tome previously approved these changes Feb 10, 2026
Copy link
Copy Markdown
Contributor

@r-tome r-tome left a comment

Choose a reason for hiding this comment

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

This is great!

@connerbw connerbw requested review from kdenney and removed request for amorask-bitwarden February 10, 2026 15:47
@bitwarden bitwarden deleted a comment from claude Bot Feb 10, 2026
@sven-bitwarden
Copy link
Copy Markdown
Contributor

@eliykat The only question I have - you outlined the difference between organization abilities and feature flags, but what considerations go into organization abilities vs policies? Is that worth documenting here or is it already elsewhere?

Copy link
Copy Markdown
Contributor

@kdenney kdenney left a comment

Choose a reason for hiding this comment

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

I was able to confirm these patterns and what changes are needed. Please let me know if I missed anything or if you have any more questions. FYI our team is planning to address this as technical debt to clean up in a future sprint so hopefully this is greatly simplified soon. ☺️

> ⚠️ **WARNING:** Mistakes in organization license changes can disable the entire organization for self-hosted customers!
> Double-check your work and ask for help if unsure.
>
> **Note:** Do not add new properties to the `OrganizationLicense` file - make sure you use the claims-based system below.
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.

I confirmed with Conner that this is wrong. New features do need added to OrganizationLicense because those properties are still used in the UpdateOrganizationLicenseCommand to update the organization properties from the license properties. So this needs removed and other changes below as well.

Note: I will likely miss a few spots here but if you add a property and add it to LicenseConstants and then run tests in UpdateOrganizationLicenseCommandTests.cs, the test failures will guide you to all of the changes required so that should help identify areas that need documented.

**Update tests:**

- `test/Core.Test/Billing/Organizations/Commands/UpdateOrganizationLicenseCommandTests.cs`
- Exclude from test comparison (line ~91)
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.

I believe this should be removed. Since we are adding the properties to both classes, I believe we do want this test to include them in this comparison.


**Update tests:**

- `test/Core.Test/Billing/Organizations/Commands/UpdateOrganizationLicenseCommandTests.cs`
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.

It looks to me like you probably want to also add the new property to this test: UpdateLicenseAsync_WithClaimsPrincipal_ExtractsAllPropertiesFromClaims

> Double-check your work and ask for help if unsure.
>
> **Note:** Do not add new properties to the `OrganizationLicense` file - make sure you use the claims-based system below.

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.

It is also required to add the new property to the UpdateFromLicense() method in src/Core/AdminConsole/Entities/Organization.cs


**Update license verification:**

- `src/Core/Billing/Organizations/Models/OrganizationLicense.cs`
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.

I'm pretty sure you also need to add the new property to the GetDataBytes() method in this file to the section at the bottom below this comment:
// any new fields added need to be added here so that they're ignored

Comment thread src/Core/AdminConsole/OrganizationFeatures/OrganizationAbility/README.md Outdated
@sonarqubecloud
Copy link
Copy Markdown

@eliykat eliykat requested review from kdenney and r-tome February 17, 2026 04:21
@eliykat
Copy link
Copy Markdown
Member Author

eliykat commented Feb 17, 2026

@kdenney and @sven-bitwarden your comments should be addressed in the last commits.

Copy link
Copy Markdown
Contributor

@kdenney kdenney left a comment

Choose a reason for hiding this comment

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

Licensing changes all look good now. Nice job!

@eliykat eliykat merged commit 24b9885 into main Feb 17, 2026
48 checks passed
@eliykat eliykat deleted the ac/pm-31978/expand-organizationability-documentation branch February 17, 2026 22:54
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants