-
Notifications
You must be signed in to change notification settings - Fork 900
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
Upgrade RubyZip Gem to 1.2 #6938
Conversation
@@ -39,7 +39,8 @@ gem "ovirt", "~>0.7.2", :require => false | |||
gem "pg", "~>0.18.2", :require => false | |||
gem "psych", "~>2.0.12" | |||
gem "rest-client", "=2.0.0.rc1", :require => false | |||
gem "rubyzip", "=0.9.5", :require => false # TODO: Review 0.9.7 breaking log collection in FB14646 | |||
gem "rubyzip", "~>1.2", :require => false | |||
gem "zip-zip" |
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.
Should this be locked down to a specific version series? Also, should we lock down the rubyzip to the third digit?
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 can put in 1.2.0 for ruby zip and 0.3.0 for zip-zip....
7156e7f
to
4f413f4
Compare
@Fryguy Gemfile changes made as recommended. Please merge when ready. Thanks. |
4f413f4
to
1ea3238
Compare
@jerryk55 I'm still seeing the original problem locally with your PR... trying to fix it.
|
Really! I looked at the test and it looked like it made the same call.... Its definitely this line in util.rb: zip.file.utime(time, entry) Commenting out: irb(main):001:0> VMDB::Util.zip_logs("joe.zip", ["log/*.log"]) Looking further.... On Thu, Feb 25, 2016 at 4:45 PM, Joe Rafaniello notifications@github.com
Jerry Keselman |
Yeah you're right (obviously). I guess the test doesn't test. Who woulda On Thu, Feb 25, 2016 at 4:45 PM, Joe Rafaniello notifications@github.com
Jerry Keselman |
1ea3238
to
ac76634
Compare
The rubyzip gem has been locked at 0.9.5 for 4 years due to a namespace conflict caused by a change in 0.9.7. The api changed in 1.0 and there are other gems that rely on the new API, including winrm-fs, which is needed for winrm-elevated. Adding gem ZipZip allows older api code to continue to function alongside code using the newer api. Spec tests against the new gem which failed with 0.9.7 pass.
The error message for an empty zip file has been changed between rubyzip 0.9.5 and 1.2.0. Fix the test to the correct message.
The interface to change the utime on an entry in a zipfile has changed between RubyZip 0.9.5 and 1.2. Instead of calling zip.add with a filename and zip.file.utime with a File.mtime, convert the mtime to a Zip::DOSTime, and create a new Zip Entry, setting the time on the entry initializer. Then call zip.add with the Entry rather than the name.
Modify tests for add_zip_entry to coincide with changes required when updating from RubyZip 0.9.5 to 1.2.0.
ac76634
to
93766ab
Compare
Spec tests for VMDB::Util needed tweaking to allow for the changes in RubyZip as well. Tested and pushed. Review as before when possible. Thanks @jrafanie |
Checked commits jerryk55/manageiq@9820dd3~...93766ab with ruby 2.2.3, rubocop 0.37.2, and haml-lint 0.16.1 lib/vmdb/util.rb
|
<github_pr_commenter_batch />Some comments on commits jerryk55/manageiq@9820dd3~...93766ab |
Looks good! Thanks for getting to the bottom of this @jerryk55. |
The rubyzip gem has been locked at 0.9.5 for 4 years due to a namespace conflict
caused by a change in 0.9.7. The api changed in 1.0 (3 years ago) and there are other gems that
rely on the new API, including winrm-fs, which is needed for winrm-elevated, being added
via another PR.
In addition gem ZipZip allows older RubyZip api code to continue to function alongside code using
the newer api so no code changes are necessary in our log handling code for this upgrade.
Spec tests against the new gem which cause the issue back with 0.9.7 pass.
A different spec test for an empty zip file was changed because the gem error message
changed between 0.9.5 and 1.2.0.
@Fryguy @jrafanie @chessbyte @roliveri please review and merge when appropriate. Thank you.