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

feat: add script to create space allocations snapshot #451

Merged
merged 11 commits into from
Dec 23, 2024

Conversation

BravoNatalie
Copy link
Contributor

@BravoNatalie BravoNatalie commented Dec 6, 2024

Description

This PR addresses the issue storacha/project-tracking#183.

This PR introduces the billing/scripts/space-allocations-snapshot script, which utilizes the allocation and store tables to calculate customer storage size and provide an estimate of their overall usage.

Please note that this method is not entirely accurate, as it does not account for deleted storage.

For detailed instructions on using the script, refer to the billing/scripts/space-allocations-snapshot/README.md file.

Copy link

seed-deploy bot commented Dec 6, 2024

View stack outputs

@BravoNatalie BravoNatalie force-pushed the feat/fix-billing-from-space-allocations-snapshot branch from 8165def to 539427c Compare December 13, 2024 19:14
billing/lib/api.ts Outdated Show resolved Hide resolved
billing/tables/client.js Outdated Show resolved Hide resolved
Copy link
Member

@travis travis 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 great, thank you! I had a couple minor nits but nothing blocking.

Do you think it's worth adding any testsuites for this? I know a lot of it is boilerplate setup code for the stores, so the types might be enough to feel pretty solid about this, but if there are any trickier bits it would be nice to get some tests in place as we add code.

Great work!

billing/scripts/dry-run/helpers.js Outdated Show resolved Hide resolved
billing/scripts/dry-run/helpers.js Outdated Show resolved Hide resolved
billing/scripts/space-allocations-snapshot/.env.template Outdated Show resolved Hide resolved
@seed-deploy seed-deploy bot temporarily deployed to pr451 December 19, 2024 18:06 Inactive
@BravoNatalie BravoNatalie merged commit 6d411c6 into main Dec 23, 2024
2 of 3 checks passed
@BravoNatalie BravoNatalie deleted the feat/fix-billing-from-space-allocations-snapshot branch December 23, 2024 18:24
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.

3 participants