-
Notifications
You must be signed in to change notification settings - Fork 20
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
File to upload exceeds max size #107
base: master
Are you sure you want to change the base?
Conversation
As a fix to #104 gracefully exit if the file is bigger than the max size
if file_size >= MAX_CHUNK_SIZE: | ||
exceeded_max_size_msg = ('!!! {} NOT UPLOADED. ' | ||
'File size is {} which exceeded max size {} !!!') | ||
print(exceeded_max_size_msg.format( |
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.
Is there a reason to use print
instead of throwing an error? With print we will still upload lists which don't exceed the limit, but what if we may related changes across multiple lists. Let's say we add new domains to the blocklist which should have corresponding entitylist updates, but the entity list exceeds the chunksize. We'd upload the new blocklist but not the new entitylist, which might lead to breakage. Thus. it seems safer to throw an error. Are there any downsides to throwing an 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.
No downsides I could think of. Though now I think about this, we should probably make the size be dependent on the version as well right? Since Nightly (73) will have the increased chunk size while the Beta and Release will still have the older max chunk size.
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.
If it's not too much work that would be safest.
About this PR
As a fix to #104 gracefully exit if the file is bigger than the max size.
Acceptance Criteria
Practical test
Test
shavar-list-creationg
gracefully exits if the file is bigger than the max size on Firefoxshavar_list_creation.ini
and add the section:constants.py
and edit theWHITELIST_SECTIONS
to include"google-whitelist"
shavar-list-creation
by executing the commandpython ./lists2safebrowsing.py
!!! google-trackwhite-digest256 NOT UPLOADED. File size is 1434496 which exceeded max size 1048576 !!!
google-trackwhite-digest256
is NOT uploaded to S3Dependent on chunk size increase on Firefox