Skip to content

[usage] Add billInstancesAfter config setting #11882

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
Aug 5, 2022

Conversation

andrew-farries
Copy link
Contributor

@andrew-farries andrew-farries commented Aug 4, 2022

Description

Add a new config setting to the usage component config setting to better support the rollout of usage based pricing.

The billInstancesAfter setting defines the date after which instances should be considered for billing - instances started before billInstancesAfter will never be considered by the billing controller.

Related Issue(s)

Part of #10937

How to test

Unit tests for the billing controller.

For an end-to-end test do this in the preview environment:

{
  "billInstancesAfter": "2022-08-06T00:00:00Z",
  ...
}

By changing the date, restarting the usage pod and starting workspaces you can see that workspaces are either included or not in the Stripe invoice for the Gitpod team (find it in the Stripe dashboard).

Release Notes

NONE

Documentation

Werft options:

  • /werft with-preview
  • /werft with-payment

Add a new config setting to the usage component.

`billInstancesAfter` sets the date after which instances should be
considered for billing - instances started before `billInstancesAfter`
will not be considered by the billing controller.
@andrew-farries andrew-farries requested a review from a team August 4, 2022 12:03
@gitpod-io gitpod-io deleted a comment from werft-gitpod-dev-com bot Aug 4, 2022
@gitpod-io gitpod-io deleted a comment from werft-gitpod-dev-com bot Aug 4, 2022
@andrew-farries
Copy link
Contributor Author

andrew-farries commented Aug 4, 2022

/werft run

👍 started the job as gitpod-build-af-no-billing-for-old-instances.9
(with .werft/ from main)

Copy link
Member

@geropl geropl left a comment

Choose a reason for hiding this comment

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

Code LGTM, tested and works - nice! 🎉

Out-of-scope, but may be relevant for later: We noticed that if there is 0 usage, the BillingController does not call Stripe to override the old state. It's an edge case, but we have to be aware.

@roboquat roboquat merged commit 9d72fb5 into main Aug 5, 2022
@roboquat roboquat deleted the af/no-billing-for-old-instances branch August 5, 2022 12:47
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: webapp Meta team change is running in production deployed Change is completely running in production release-note-none size/L team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants