-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Automatically check if zip_file exceeds 4096 chars #537
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,10 @@ def validate(self): | |
raise ValueError( | ||
"You can't specify both 'S3ObjectVersion' and 'ZipFile'" | ||
) | ||
if zip_file and len(zip_file) > 4096: | ||
raise ValueError( | ||
"ZipFile length cannot exceed 4096 characters. For larger source use S3Bucket/S3Key properties instead. Current length: %d" % len(zip_file) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The CI build fails on this line because it's to long. |
||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The CI Build fails on this line because there is trailing whitespace |
||
if not zip_file and not (s3_bucket and s3_key): | ||
raise ValueError( | ||
"You must specify a bucket location (both the 'S3Bucket' and " | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Did you think about how this would work if you write this with a Join? I'll give an example below. I think this check is great if
zip_file
is a string, but we shouldn't assume it is.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.
You are correct. In this case there is not way to check it locally as there could be any Ref, or GetAttr etc. So what if we run this check on strings only?
Maybe also on simple cases like Join('', [ ...]) where all elements are strings and we can actually calculate the size. What do you think?
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.
I think running on strings only is a good solution for this problem. I like the iteration over the join to see if they are strings too.