ninech / netbox-client-ruby

A ruby client library for Netbox v2.
MIT License
24 stars 21 forks source link

Update version pin of dry-configurable and rake dependency #62

Closed severinkaelin closed 1 year ago

severinkaelin commented 1 year ago

Hello First of all, thanks for this gem.

It would be great, if we could update the dry-configurable dependency to v1.x 1.0.0 was released back in November 2022 (the latest version 1.0.1 as well).

I have an app relying on version > 1 of the dry-configurable gem. I imagine that this is the case for other people's projects as well.

I have performed a limited number of tests of the netbox-client-ruby gem after updating the dry-configurable dependency but so far everything is working fine (fetching vm's, updating data etc.).

Kind regards.

-Severin

severinkaelin commented 1 year ago

@thde Thanks for running the CI.

Ruby 2.6

Resolving dependencies...
Could not find compatible versions

Because every version of netbox-client-ruby depends on dry-configurable ~> 1
  and dry-configurable >= 0.14.0 depends on Ruby >= 2.7.0,
  every version of netbox-client-ruby requires Ruby >= 2.7.0.
So, because Gemfile depends on netbox-client-ruby >= 0
  and current Ruby version is = 2.6.10,
  version solving has failed.
Error: The process '/opt/hostedtoolcache/Ruby/2.6.10/x64/bin/bundle' failed with exit code 6

See: Action Run

Ruby 2.6 has already reached EOL status a year ago. I think it would be fine if the gem no longer supports Ruby 2.6. What's your take on that?


Ruby 3

I haven't had a chance to look into this in detail yet.

Run bundle exec rake spec
rake aborted!
NoMethodError: undefined method `=~' for #<Proc:0x00007f7ae2d8dee8 /home/runner/work/netbox-client-ruby/netbox-client-ruby/vendor/bundle/ruby/3.2.0/gems/rake-10.5.0/lib/rake/application.rb:393 (lambda)>
/opt/hostedtoolcache/Ruby/3.2.2/x6[4](https://github.com/ninech/netbox-client-ruby/actions/runs/5216033623/jobs/9454418020?pr=62#step:4:5)/bin/bundle:2[5](https://github.com/ninech/netbox-client-ruby/actions/runs/5216033623/jobs/9454418020?pr=62#step:4:6):in `load'
/opt/hostedtoolcache/Ruby/3.2.2/x[6](https://github.com/ninech/netbox-client-ruby/actions/runs/5216033623/jobs/9454418020?pr=62#step:4:7)4/bin/bundle:25:in `<main>'
(See full trace by running task with --trace)
Error: Process completed with exit code 1.

See: Action Run


How would you like to proceed here?

thde commented 1 year ago

I didn't look into it in too much detail, but it should be fine to remove Ruby 2.6. The tests for Ruby 3 should work though before merging.

severinkaelin commented 1 year ago

I didn't look into it in too much detail, but it should be fine to remove Ruby 2.6. The tests for Ruby 3 should work though before merging.

@thde Sounds good!

I could not reproduce the Ruby 3 test run error locally. Would you mind spawning a CI run for master? I'm curious whether or not it passes.

@severinkaelin ➜ /workspaces/netbox-client-ruby (master) $ ruby -v
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]
@severinkaelin ➜ /workspaces/netbox-client-ruby (master) $ bundle exec rake spec
/usr/local/rvm/rubies/ruby-3.0.0/bin/ruby -I/usr/local/rvm/gems/ruby-3.0.0/gems/rspec-core-3.12.2/lib:/usr/local/rvm/gems/ruby-3.0.0/gems/rspec-support-3.12.0/lib /usr/local/rvm/gems/ruby-3.0.0/gems/rspec-core-3.12.2/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb
Run options: include {:focus=>true}

All examples were filtered out; ignoring {:focus=>true}

Randomized with seed 64256
.................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Finished in 2.29 seconds (files took 0.51974 seconds to load)
1457 examples, 0 failures

Randomized with seed 64256
severinkaelin commented 1 year ago

@thde I've just had another look at the failed Ruby 3 CI run and noticed that it is not using Ruby 3.0.0 but a greater version.

I can now reproduce the error locally with Ruby >= 3.2.x. However, I ran the tests based on your master branch (not my fork) and the same error occurred. So it doesn't seem to be related to the changes in this PR.

Ruby 3.1.3

@severinkaelin ➜ /workspaces/netbox-client-ruby (master) $ git remote -v
origin  https://github.com/ninech/netbox-client-ruby (fetch)
origin  https://github.com/ninech/netbox-client-ruby (push)
@severinkaelin ➜ /workspaces/netbox-client-ruby (master) $ ruby -v
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
@severinkaelin ➜ /workspaces/netbox-client-ruby (master) $ bundle exec rake spec
/usr/local/rvm/rubies/ruby-3.1.3/bin/ruby -I/usr/local/rvm/gems/ruby-3.1.3/gems/rspec-core-3.12.2/lib:/usr/local/rvm/gems/ruby-3.1.3/gems/rspec-support-3.12.0/lib /usr/local/rvm/gems/ruby-3.1.3/gems/rspec-core-3.12.2/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb
Run options: include {:focus=>true}

All examples were filtered out; ignoring {:focus=>true}

Randomized with seed 47544
.................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Finished in 1.83 seconds (files took 0.56117 seconds to load)
1457 examples, 0 failures

Randomized with seed 47544

@severinkaelin ➜ /workspaces/netbox-client-ruby (master) $ 

:x: Ruby 3.2.0

@severinkaelin ➜ /workspaces/netbox-client-ruby (master) $ git remote -v
origin  https://github.com/ninech/netbox-client-ruby (fetch)
origin  https://github.com/ninech/netbox-client-ruby (push)
@severinkaelin ➜ /workspaces/netbox-client-ruby (master) $ ruby -v
ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-linux]
@severinkaelin ➜ /workspaces/netbox-client-ruby (master) $ bundle exec rake spec
rake aborted!
NoMethodError: undefined method `=~' for #<Proc:0x00007f8d540a1b38 /usr/local/rvm/gems/ruby-3.2.0/gems/rake-10.5.0/lib/rake/application.rb:393 (lambda)>
/usr/local/rvm/gems/ruby-3.2.0/bin/ruby_executable_hooks:22:in `eval'
/usr/local/rvm/gems/ruby-3.2.0/bin/ruby_executable_hooks:22:in `<main>'
(See full trace by running task with --trace)
@severinkaelin ➜ /workspaces/netbox-client-ruby (master) $ 

:x: Ruby 3.2.2

@severinkaelin ➜ /workspaces/netbox-client-ruby (master) $ git remote -v
origin  https://github.com/ninech/netbox-client-ruby (fetch)
origin  https://github.com/ninech/netbox-client-ruby (push)
@severinkaelin ➜ /workspaces/netbox-client-ruby (master) $ ruby -v
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]
@severinkaelin ➜ /workspaces/netbox-client-ruby (master) $ bundle exec rake spec
rake aborted!
NoMethodError: undefined method `=~' for #<Proc:0x00007f044fe01dc0 /usr/local/rvm/gems/ruby-3.2.2/gems/rake-10.5.0/lib/rake/application.rb:393 (lambda)>
/usr/local/rvm/gems/ruby-3.2.2/bin/ruby_executable_hooks:22:in `eval'
/usr/local/rvm/gems/ruby-3.2.2/bin/ruby_executable_hooks:22:in `<main>'
(See full trace by running task with --trace)
@severinkaelin ➜ /workspaces/netbox-client-ruby (master) $
severinkaelin commented 1 year ago

@thde I did some debugging and was able to trace the error down to the rake dev dependency: https://github.com/ruby/rake/issues/431

Updated the version pin from 10 to 13 for rake (using the pessimistic operator), now the test suite is passing across the following ruby versions:

I'd appreciate it if you could start another CI run.

thde commented 1 year ago

Thanks! Would you mind updating the required_ruby_version in the gemspec file and removing 2.6 from the CI config? I fixed the ruby 3.0 CI definition so a rebase should resolve it in this pipeline: https://github.com/ninech/netbox-client-ruby/commit/d5e0c4126564efdf5cf174b309579db8385cdd2b

severinkaelin commented 1 year ago

Thanks! Would you mind updating the required_ruby_version in the gemspec file and removing 2.6 from the CI config? I fixed the ruby 3.0 CI definition so a rebase should resolve it in this pipeline: d5e0c41

@thde

*[1] Feel free to adjust this again according to your needs. Just let me know if you want something changed or push the desired changes directly ("Allow edits by maintainers" option is enabled for this PR).

Thanks.

thde commented 1 year ago

LGTM thanks!

thde commented 1 year ago

@severinkaelin new version is deployed

severinkaelin commented 1 year ago

@severinkaelin new version is deployed

@thde Awesome, thanks a lot!