Warn the user if their local build output is larger than 250MB#10439
Warn the user if their local build output is larger than 250MB#10439
Conversation
There was a problem hiding this comment.
Code Review
This pull request implements a size limit check for local build artifacts in App Hosting, throwing a FirebaseError if the generated tarball exceeds the specified limit (defaulting to 250MB). Review feedback highlights that the implementation currently ignores the config.ignore field, which prevents users from excluding files to stay under the limit. Additionally, it is recommended to replace the magic number used for the size limit with a named constant to improve code maintainability.
| config: AppHostingSingle, | ||
| rootDir: string, | ||
| targetSubDir?: string, | ||
| sizeLimitBytes: number = 250 * 1024 * 1024, |
There was a problem hiding this comment.
The value 250 * 1024 * 1024 is a magic number representing the Cloud Run size limit. It should be defined as a named constant (e.g., CLOUD_RUN_SIZE_LIMIT_BYTES) at the top of the file to improve maintainability and clarity, especially since this limit is referenced in the error message logic as well.
…builds_size_warning
Description
Cloud Run only supports 250MB maximum size for zip deploys
Scenarios Tested
Sample Commands