poise / poise-archive

A Chef cookbook to unpack file archives like TAR and ZIP files.
Apache License 2.0
10 stars 13 forks source link

Chef 13 Deprecation Fix #11

Open moofish32 opened 7 years ago

moofish32 commented 7 years ago

I am using poise archive in another cookbook and recently turned on deprecations as errors in my Chef 12 environment. I get the following:

          * directory[/opt/consul/0.9.3] action create[2017-10-23T18:42:33+00:00] INFO: Processing directory[/opt/consul/0.9.3] action create (/tmp/kitchen/cache/cookbooks/poise-arch
ive/files/halite_gem/poise_archive/archive_providers/base.rb line 100)
        (up to date)
       [2017-10-23T18:42:33+00:00] ERROR: chef_gem[rubyzip] chef_gem compile_time installation is deprecated. Please set `compile_time false` on the resource to use the new behavior, or
 set `compile_time true` on the resource if compile_time behavior is required. (CHEF-3)/tmp/kitchen/cache/cookbooks/poise-archive/files/halite_gem/poise_archive/archive_providers/zip.rb
:47:in `install_rubyzip'.
       Please see https://docs.chef.io/deprecations_chef_gem_compile_time.html for further details and information on how to correct this problem. at /opt/chef/embedded/lib/ruby/gems/2.
3.0/gems/chef-12.21.20/lib/chef/formatters/doc.rb:419:in `deprecation'

I believe this is tracked back to the chef_gem rubyzip resource which I have updated.

coderanger commented 7 years ago

Unfortunately that property didn't exist in some Chef versions I support. It would have to either be guarded on a defined? or check a version, and it hasn't seemed worthwhile to go there yet. You can try compile_time(true) if defined?(compile_time) and I think that works given the context, but there is so much method_missing that I've lost track.

codecov-io commented 7 years ago

Codecov Report

Merging #11 into master will decrease coverage by 0.1%. The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #11      +/-   ##
==========================================
- Coverage   83.37%   83.27%   -0.11%     
==========================================
  Files          15       15              
  Lines         824      825       +1     
==========================================
  Hits          687      687              
- Misses        137      138       +1
Impacted Files Coverage Δ
lib/poise_archive/archive_providers/zip.rb 28.57% <0%> (-0.7%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 32f0626...1807ef7. Read the comment docs.

tas50 commented 6 years ago

@coderanger Isn't compile_time a 12.1+ feature which is what this cookbook requires?

Wing924 commented 6 years ago

Chef 12 was EOL, it's time to merge it.