-
Notifications
You must be signed in to change notification settings - Fork 190
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
feat: plan prices accurately read from Stripe #4104
Conversation
@@ -0,0 +1,198 @@ | |||
/* eslint-disable @typescript-eslint/no-explicit-any */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inspired by @iainsproat's recent experimentation with a generic fn/factory caching wrapper, just more decoupled & a bit easier to use - you can wrap any existing fn/factory with this without changing the fn/factory signature, so you don't need to write extra integration/resolver code
cache providers are reusable as well
see example in prices.ts or in unit tests
const store: StorageType = { | ||
requestId: reqId, | ||
dbMetrics: { | ||
totalCount: 0, | ||
totalDuration: 0 | ||
} | ||
}, | ||
logger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added req.logger to req context itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 💯
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
packages/server/observability/components/express/requestContext.ts
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4104 +/- ##
==========================================
+ Coverage 71.70% 71.83% +0.12%
==========================================
Files 405 410 +5
Lines 18342 18472 +130
Branches 2974 2997 +23
==========================================
+ Hits 13152 13269 +117
- Misses 4181 4188 +7
- Partials 1009 1015 +6 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible separate the rename of the existing inMemory cache, and the new caching mechanism & spec in to a separate PR?
@iainsproat i'd rather not, it's not a big part of the PR and its entirely new code (except a simple fn rename) so shouldn't break anything existing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The caching part lgtm. I'll refer to someone else in backend team to review the Stripe changes.
📸 Preview service has generated an image. |
@@ -569,7 +569,7 @@ Generate the environment variables for Speckle server and Speckle objects deploy | |||
- name: FF_WORKSPACES_SSO_ENABLED | |||
value: {{ .Values.featureFlags.workspacesSSOEnabled | quote }} | |||
|
|||
- name: FF_WORKSPACES_NEW_PLAN_ENABLED | |||
- name: FF_WORKSPACES_NEW_PLANS_ENABLED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alemagio I think u may have created a duplicate feature flag, Gergo already created the new plans FF in his initial PR
@iainsproat I left the helm chart path as is, maybe thats fine if these are supposed to be somewhat temporary
📸 Preview service has generated an image. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, FE looks good 😁
📸 Preview service has generated an image. |
}), | ||
getWorkspacePlanProductAndPriceIds | ||
}) | ||
const prices = await getWorkspacePlanPrices.fresh() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, left this on .fresh() (skips cache) for testing, i'll switch it back to the cached version when the PR is ready to go
📸 Preview service has generated an image. |
Description & motivation
Changes:
To-do before merge:
Screenshots:
Validation of changes:
Checklist:
References