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
Convert packageModules to use bestzip instead of archiver #596
Convert packageModules to use bestzip instead of archiver #596
Conversation
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.
May you please add the file conflicts when you get a chance?
Done. |
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.
Any chance to fix failing tests?
In that case we can also remove all the archiver mocks for the test
framework.
|
I think so |
I've rebased against the |
Awesome, thanks! As a side note, I think it might be a good idea to have a test that tests packaging with real, and not mocked zips, especially for performance testing, but I totally understand why it was left out. |
@liron-strattic I like the idea but it might be more complex to implement. |
I've tested it on a real project. It saves about 6s (for 8 functions).
|
I think that was an issue because I originally started on a different branch, and that got changed in the release5.4.0 branch. |
…isn't working yet.
Thanks @liron-strattic! |
What did you implement:
Updated packageModules to use bestzip, allowing the module zip to use the native zip function on the server instead of archiver, if it exists. This greatly speeds up the build time when zipping archives. In our case, it changed from about 25 seconds per function to about 1.5 seconds per function.
Closes #561
How did you implement it:
Replaced the code that uses archiver for bestzip, and tested it to make sure that the resultant zip created by bestzip has the same file structure as the zips currently created by archiver. Bestzip falls back to using archiver, so if zip is not installed on the server it should still function as it does today.
To get the unit tests to pass, I created a bestzip mock, similar to what was previously done for archiver. I think it makes sense as a future enhancement to actually test that the zip is working as expected instead of just mocking it.
How can we verify it:
To verify it needs to be tested by running a package build on a server that contains a native zip function as well as on a server that doesn't, to make sure that both paths of bestzip work.
Todos:
Is this ready for review?: YES
Is it a breaking change?: NO