-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Unblock Self-Hosted release by introducing UsageServiceMock #14162
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
Conversation
started the job as gitpod-build-gpl-14129-sh-usage.2 because the annotations in the pull request description changed |
35cd093
to
837a53a
Compare
/werft run with-clean-slate-deployment=true 👍 started the job as gitpod-build-gpl-14129-sh-usage.4 |
/werft run with-preview=true 👍 started the job as gitpod-build-gpl-14129-sh-usage.5 |
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.
This makes sense. I didn't think of this approach when I was investigating.
attributionId: AttributionId.render(AttributionId.create(team)), | ||
}); | ||
if (costCenter.costCenter?.billingStrategy === CostCenter_BillingStrategy.BILLING_STRATEGY_STRIPE) { | ||
const billingStrategy = await this.usageService.getCurrentBillingStategy(AttributionId.create(team)); |
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.
Talking to the usage service here is okay, because we should only reach this stage when isUsageBasedBillingEnabled == true
if (config.enablePayment) { | ||
return ctx.container.get<UsageServiceImpl>(UsageServiceImpl); | ||
} | ||
return new UsageServiceMock(); |
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.
[nit] Let's call it a NoOpUsageService or something along the lines. Calling it a mock smells like this is test code.
It's a hack, honestly, but should work for today. We definitely need the |
837a53a
to
6da8a9f
Compare
Supersede by this PR: #14173 |
Description
Mitigate the fact that usage is not deployed with self-hosted, yet, by mocking it away until we properly fixed it with #14129.
Related Issue(s)
Context: #14129
How to test
Release Notes
Documentation
Werft options:
If enabled this will build
install/preview
Valid options are
all
,workspace
,webapp
,ide