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

fix: use Float for restore size #3633

Merged
merged 1 commit into from Jan 15, 2024
Merged

fix: use Float for restore size #3633

merged 1 commit into from Jan 15, 2024

Conversation

shreddedbacon
Copy link
Member

@shreddedbacon shreddedbacon commented Dec 28, 2023

General Checklist

  • Affected Issues have been mentioned in the Closing issues section
  • Documentation has been written/updated
  • PR title is ready for inclusion in changelog

Database Migrations

  • If your PR contains a database migation, it MUST be the latest in date order alphabetically

Changes the return type from Int to Float, based on discussion in #3629

Other services in the API that store information related to storage size use Float, and these values would very likely see sizes into the GB if not TB of sizes that a restore would also see.
https://github.com/uselagoon/lagoon/blob/v2.17.0/services/api/src/typeDefs.js#L941
https://github.com/uselagoon/lagoon/blob/v2.17.0/services/api/src/typeDefs.js#L947

Closing issues

closes #3629

@shreddedbacon shreddedbacon marked this pull request as ready for review December 28, 2023 21:39
Copy link
Member

@rocketeerbkw rocketeerbkw left a comment

Choose a reason for hiding this comment

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

Tested with a large value 1000000000000000000000000000000000000000000000000000000000000000 and the api returns "restoreSize": 1e+63. This is a number format that javascript can natively use, so it won't error out our current UI implementation. It also corresponds to a file size of 1e+39 YB (yottabytes), which is so large that I couldn't find an example online to compare it to, so it should be fine for file sizes 🤣

@shreddedbacon shreddedbacon merged commit 7d1bcaa into main Jan 15, 2024
1 check passed
@shreddedbacon shreddedbacon deleted the restore-size-fix branch January 15, 2024 02:06
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.

API uses Int for backup restore sizes which can be larger than Int size
2 participants