-
Notifications
You must be signed in to change notification settings - Fork 27
Implement multipart upload(AST-24859) #1343
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
base: main
Are you sure you want to change the base?
Conversation
|
Great job! No new security vulnerabilities introduced in this pull request |
06bb69c to
5b95d6d
Compare
5b95d6d to
a8c7e42
Compare
| flagResponse, _ := featureFlagsWrapper.GetSpecificFlag(wrappers.IncreaseFileUploadLimit) | ||
| if flagResponse.Status && fileInfo.Size() > MaxSizeBytes { | ||
| // File size >5GB, proceed with multipart upload | ||
| logger.PrintIfVerbose("File size >5GB and INCREASE_FILE_UPLOAD_LIMIT flag is enabled,hence uploading file in multiple parts...") |
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.
update message & removed Flag name from log message
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.
Uploading source code in multiple parts.
| preSignedURL, zipFilePathErr = uploadsWrapper.UploadFileInMultipart(zipFilePath, featureFlagsWrapper) | ||
| } else { | ||
| // File size is within <=5GB, proceed with upload in single part | ||
| logger.PrintIfVerbose("File size is within the limit and uploading file in a single part...") |
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.
remove this log
| // calculate file size and compare with 5GB limit | ||
| fileInfo, err := os.Stat(sourcesFile) | ||
| if err != nil { | ||
| return nil, errors.Wrapf(err, "Failed to stat - %s", sourcesFile) |
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.
remove error condition
| // Generate presigned URL | ||
| presignedURL, err := getPresignedURLForMultipartUploading(startMultipartUploadResponse, partNumber) | ||
| if err != nil { | ||
| return nil, fmt.Errorf("failed to get presigned URL for part%d - %s", partNumber, err.Error()) |
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.
Failed - change f to F
| // Upload part | ||
| etag, err := uploadPart(presignedURL, partPath, featureFlagsWrapper) | ||
| if err != nil { | ||
| return nil, fmt.Errorf("failed to upload part%d - %s", partNumber, err.Error()) |
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.
Change f to F
| path := viper.GetString(commonParams.CompleteMultipartUploadPathEnv) | ||
| jsonBytes, err := json.Marshal(completeMultipartUpload) | ||
| if err != nil { | ||
| return nil, errors.Errorf("Failed to marshal complete multipart upload request body - %s", err.Error()) |
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.
change the error message.

By submitting this pull request, you agree to the terms within the Checkmarx Code of Conduct. Please review the contributing guidelines for guidance on creating high-quality pull requests.
Description
Implemented code changes for multi part upload when source folder size exceeds the 5GB and introduce 'multipart_file_size' environment variable in checkmarx.yml file where customer can give the file part size according to internet banwidth.
Type of Change
Related Issues
Link any related issues or tickets.
Checklist
Screenshots (if applicable)
Add screenshots to help explain your changes.
Additional Notes
Add any other relevant information.