Skip to content

[PM-17778] Updated consumed seat count logic #5711

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 30, 2025

Conversation

cturnbull-bitwarden
Copy link
Contributor

🎟️ Tracking

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

📔 Objective

The above Jira ticket added some clarification on which admin-initiated sponsorships should be included in the organization's "consumed" seat count. This PR aims to ensure that all the following sponsorships are counted:

  • Only sponsorships that are admin-initiated (IsAdminInitiated = 1)
  • The sponsorship is not marked for deletion (ToDelete = 0) OR
  • The sponsorship IS marked for deletion, but has a future expiration date (ToDelete = 1 AND ValidUntil IS NOT NULL AND ValidUntil > GETUTCDATE())
  • The sponsorship is either
    • In the SENT status (SponsoredOrganizationId IS NULL) OR
    • In the ACCEPTED status and not expired (SponsoredOrganizationId IS NOT NULL AND (ValidUntil IS NULL OR ValidUntil > GETUTCDATE()))

📸 Screenshots

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

Copy link

Copy link

codecov bot commented Apr 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.44%. Comparing base (8a2012b) to head (aa831d6).
Report is 15 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5711   +/-   ##
=======================================
  Coverage   50.43%   50.44%           
=======================================
  Files        1633     1633           
  Lines       74162    74174   +12     
  Branches     6675     6675           
=======================================
+ Hits        37407    37419   +12     
  Misses      35243    35243           
  Partials     1512     1512           

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

Copy link
Contributor

Logo
Checkmarx One – Scan Summary & Details758efd75-cf38-49e9-8944-ae6735da9386

Fixed Issues (4)

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

Severity Issue Source File / Package
MEDIUM CSRF /src/Api/AdminConsole/Controllers/GroupsController.cs: 164
MEDIUM CSRF /bitwarden_license/src/Scim/Controllers/v2/GroupsController.cs: 86
MEDIUM CSRF /src/Api/AdminConsole/Public/Controllers/GroupsController.cs: 133
MEDIUM CSRF /bitwarden_license/src/Scim/Controllers/v2/GroupsController.cs: 96

Copy link
Contributor

@rkac-bw rkac-bw left a comment

Choose a reason for hiding this comment

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

lgtm

@cturnbull-bitwarden cturnbull-bitwarden merged commit 7ebf312 into main Apr 30, 2025
56 checks passed
@cturnbull-bitwarden cturnbull-bitwarden deleted the billing/PM-17778-seat-count-tweaks branch April 30, 2025 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants