jantman / vagrant-r10k

UNSUPPORTED - SEEKING MAINTAINER - Vagrant middleware plugin to retrieve puppet modules using r10k.
MIT License
35 stars 12 forks source link

Updates r10k to 2.5.0 #40

Closed petems closed 6 years ago

petems commented 7 years ago
codecov-io commented 7 years ago

Current coverage is 86.42% (diff: 42.85%)

Merging #40 into master will decrease coverage by 13.57%

@@           master        #40   diff @@
========================================
  Files           7          7          
  Lines         218        221     +3   
  Methods         0          0          
  Messages        0          0          
  Branches        0          0          
========================================
- Hits          218        191    -27   
- Misses          0         30    +30   
  Partials        0          0          

Powered by Codecov. Last update aa33372...0c94474

jantman commented 7 years ago

Oh hey, an unsolicited fix for #13 !!!!! I guess Christmas is here a bit early this year...

It appears that TravisCI is quite angry about this, though. I'll have to dig into it a bit deeper...

jantman commented 7 years ago

I'll need to read up on modern Vagrant plugin development. This was written when 1.7.0 was the newest release, and it appears that now (1.9.1) things are very different, what with the binary Vagrant installer and the documentation comment, "You must have a modern Ruby (>= 2.2) in order to develop and build Vagrant." 1.9.1, released 2 weeks ago, specifies a required ruby version of "~> 2.2".

I suppose that the smartest/easiest thing to do would be to figure out when these changes were made, and release a new version of the plugin targeting that Vagrant version or higher... and just document to use an older version of the plugin if you're on a much older Vagrant version.

It looks like the first step in testing this, for me, will probably be to pull this branch down, bump TravisCI up to using ruby 2.2 and see what happens. I imagine I'll have some issues with the (local-only) acceptance tests as well... though if I add Docker support, I could get acceptance tests for that to run on Travis.

jantman commented 7 years ago

Ok, in Travis, vagrant 1.5.0 is throwing some actual spec errors. 1.6.5, 1.7.0 and 1.7.9 are all throwing the dreaded old-ruby listen version error.

I'll spend some time going back through the Vagrant gemspecs and seeing what ruby versions were targeted by what Vagrant versions...

petems commented 7 years ago

No worries, I knew I recognised your Github name from somewhere! Been using vagrant-r10k for a while 👍

RE: the tests. I'm sticking with the failing spec instance right now.

Right now it's failing with uninitialized constant R10K::Action::Puppetfile::Sync, which seems to be because that method no longer exists.

I might see if I can ask Adrien if he can give us a hand on this one, the change in methods seems pretty dramatic!

jantman commented 7 years ago

:) cool!

Thanks to the holidays, I've got a half-day at my day job today, and then I'm only working one day through the end of the year. I'm sure I'll have some more time to dedicate to this...

Ok, so as to that spec error, the culprit is this commit that replaced R10K::Task::Puppetfile::Sync with R10K::Action::Puppetfile::Install.

Also, FWIW, r10k itself currently says it supports ruby 1.9.3, 2.0.0 and 2.1.0, and tests against those plus 2.2.0 and 2.3.0. For vagrant itself, I extracted both the rvm versions they use in TravisCI and the ruby, bundler and listen versions from the gemspec, for each tag since 1.2.0, and came up with (sequential tags with the same versions omitted):

# v1.2.0
travis rvm: 1.9.3

# v1.4.0
travis rvm: 2.0.0

# v1.5.0
travis rvm: 2.0.0
  s.add_dependency "bundler", "~> 1.5.2"
  s.add_dependency "listen", "~> 2.4.0"

# v1.5.3
travis rvm: 2.0.0
  s.add_dependency "bundler", "~> 1.5.2"
  s.add_dependency "listen", "~> 2.7.1"

# v1.6.0
travis rvm: 2.0.0
  s.required_ruby_version     = ">= 2.0.0"
  s.add_dependency "bundler", ">= 1.5.2", "< 1.7.0"
  s.add_dependency "listen", "~> 2.7.1"

# v1.7.0
travis rvm: 2.0.0
  s.required_ruby_version     = ">= 2.0.0"
  s.add_dependency "bundler", ">= 1.5.2", "< 1.8.0"
  s.add_dependency "listen", "~> 2.7.11"

# v1.7.2
travis rvm: 2.0.0
  s.required_ruby_version     = ">= 2.0.0"
  s.add_dependency "bundler", ">= 1.5.2", "< 1.8.0"
  s.add_dependency "listen", "~> 2.8.0"

# v1.7.3
travis rvm: 2.0.0
  s.required_ruby_version     = ">= 2.0.0"
  s.add_dependency "bundler", ">= 1.5.2", "<= 1.10.5"
  s.add_dependency "listen", "~> 3.0.2"

# v1.8.0
travis rvm: 2.0.0
  s.required_ruby_version     = ">= 2.0.0"
  s.add_dependency "bundler", ">= 1.5.2", "<= 1.10.6"
  s.add_dependency "listen", "~> 3.0.2"

# v1.8.3
travis rvm: 2.0.0
  s.required_ruby_version     = ">= 2.0.0"
  s.add_dependency "bundler", ">= 1.5.2", "<= 1.12.0"
  s.add_dependency "listen", "~> 3.0.2"

# v1.8.4
travis rvm: 2.0.0
  s.required_ruby_version     = ">= 2.0.0"
  s.add_dependency "bundler", "= 1.12.5"
  s.add_dependency "listen", "~> 3.0.2"

# v1.8.5
travis rvm: 2.2.3
  s.required_ruby_version     = "~> 2.2"
  s.add_dependency "bundler", "= 1.12.5"
  s.add_dependency "listen", "~> 3.1.5"

# v1.9.0
travis rvm: 2.2.5, 2.3.3
  s.required_ruby_version     = "~> 2.2"
  s.add_dependency "listen", "~> 3.1.5"
petems commented 7 years ago

Great, yeah, I've had some free time to do some hacking over the christmas break so I've been opening some PRs 👍

I've tried changing the method to R10K::Action::Puppetfile::Install but getting some weird errors:

Failure/Error: expect(subject.deploy(env, config)).to be_nil
     NoMethodError:
       undefined method `original' for #<RSpec::Mocks::Mo

Looks like it's not a find/replace change, might need some digging!

I've opened this PR to allow changes from maintainers, so if you want to edit this PR or try on your own branch feel free 😄

jantman commented 7 years ago

Yeah, same here :) I have a few projects I want to finally get finished up, and replace my router at home, but other than that it's the first time I've had a week off of work and no major plans in a long time...

Ok, cool, thanks. I've never played with the new "allow maintainers to edit" feature... I gather it just gives me access to that one branch in your repo. I think I'll probably cut my own branch off of yours so I can mess around a bit, but when I get something working, I'll give that a try...

jantman commented 7 years ago

I'm working on some fixes that mostly work with 2.5.0, but it looks like the puppetfile check action needs https://github.com/puppetlabs/r10k/commit/2678d55eb9607f4ff925e8dff2c38b0bb2b3960d in order to work, or else we need to just replicate that.

It also appears that the internals of r10k have changed a LOT more than either of us thought... most of the current code in this project for checking and installing Puppetfiles no longer works. And there's now code in place that catches pretty much all exceptions and sends them to STDERR (this is part of the "visitor" pattern that's now used). So, this is going to be a bit of work.

I've decided that I need an actual vacation, and I'm not doing any work this week on any of my projects that aren't 100% for my personal pleasure. So... I'll come back to this sometime next week (in the new year).

For my initial work on the changes, see this gist.

jantman commented 7 years ago

Ok, back from vacation and trying to get into the swing of things.

But, to be honest... I don't even use this plugin anymore, and I doubt I will any time in the near future. I'm not really sure I can invest the time, at least in the near-term, in the massive changes required to make this work...

jantman commented 7 years ago

@petems I no longer use vagrant-r10k anywhere, and doubt I will again. The only logical thing for me to do is call this project "unsupported". I've updated the README accordingly; if you're interested in taking it over, just let me know.

jantman commented 6 years ago

Closing per previous comment. @petems if you or anyone else still use this and would like to take over the project, that's fine with me. I haven't used this project myself in over 2 years, and with all of my work in the past few years being targeted at immutable infrastructure, I doubt I will again.