Skip to content
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

[PM-18955] Improve performance of Billing invocations on Collections page #5618

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

jonashendrickx
Copy link
Member

@jonashendrickx jonashendrickx commented Apr 7, 2025

🎟️ Tracking

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

📔 Objective

  • We can merge 3 calls to Stripe for the organization metadata endpoint by leveraging the expand property. This at the very least saves us a couple round trips. Reducing the latency from 750ms-1.3s to just 400-450ms.
  • Reducing 1 call to the Pricing API can reduce the latency for getting a response back from the organization metadata endpoint by another 10-30ms.
  • To check whether a payment method is configured we can use the customer.invoice_settings object. This allows us to avoid retrieving the payment method entirely in the front-end.

Tested with

  • Marketing initiated trials
  • Existing organizations

📸 Screenshots

Screen.Recording.2025-04-07.at.16.41.13.mov

⏰ 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

@jonashendrickx jonashendrickx requested a review from a team as a code owner April 7, 2025 13:42
Copy link
Contributor

github-actions bot commented Apr 7, 2025

Logo
Checkmarx One – Scan Summary & Detailsa394ef5d-dd16-472b-b973-16c4e2956b61

Great job, no security vulnerabilities found in this Pull Request

Copy link

codecov bot commented Apr 7, 2025

Codecov Report

Attention: Patch coverage is 75.00000% with 8 lines in your changes missing coverage. Please review.

Project coverage is 45.72%. Comparing base (0bad7a6) to head (f957a45).
Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
...ices/Implementations/OrganizationBillingService.cs 76.47% 0 Missing and 4 partials ⚠️
src/Core/Billing/Models/OrganizationMetadata.cs 50.00% 2 Missing ⚠️
...g/Models/Responses/OrganizationMetadataResponse.cs 75.00% 1 Missing ⚠️
src/Core/Billing/Extensions/CustomerExtensions.cs 85.71% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5618      +/-   ##
==========================================
+ Coverage   45.12%   45.72%   +0.59%     
==========================================
  Files        1565     1600      +35     
  Lines       71728    72609     +881     
  Branches     6424     6505      +81     
==========================================
+ Hits        32368    33198     +830     
- Misses      37983    37992       +9     
- Partials     1377     1419      +42     

☔ 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

sonarqubecloud bot commented Apr 8, 2025

Copy link
Contributor

@amorask-bitwarden amorask-bitwarden left a comment

Choose a reason for hiding this comment

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

This looks good - thanks for making those changes. However, just as a heads up for future PR's, the reviewer is the one who should mark conversations as resolved.

@jonashendrickx jonashendrickx changed the title [PM-18955] Improve performance of Billing invocations on Collections page [PM-18955][PM-20088] Improve performance of Billing invocations on Collections page Apr 10, 2025
@amorask-bitwarden amorask-bitwarden changed the title [PM-18955][PM-20088] Improve performance of Billing invocations on Collections page [PM-18955] [PM-20088] [PM-19981] Improve performance of Billing invocations on Collections page Apr 10, 2025
@amorask-bitwarden amorask-bitwarden changed the title [PM-18955] [PM-20088] [PM-19981] Improve performance of Billing invocations on Collections page [PM-18955] [PM-20088] Improve performance of Billing invocations on Collections page Apr 10, 2025
@amorask-bitwarden amorask-bitwarden changed the title [PM-18955] [PM-20088] Improve performance of Billing invocations on Collections page [PM-18955] Improve performance of Billing invocations on Collections page Apr 11, 2025
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.

2 participants