Skip to content
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

bump maximum allowed rubocop version #73

Closed
wants to merge 1 commit into from
Closed

Conversation

micwoj92
Copy link

I picked this arbitrary version simply because I have 1.39 installed, I think it can be just safe to bump this to "< 2.0".
Version 0.50 was released in 2017.

Here bundle exec rake on my system:

rake test
/home/micwoj92/pkg/fog-brightbox/lib/fog/brightbox/models/compute/flavor.rb:20: warning: method redefined; discarding old bits
/usr/lib/ruby/gems/3.0.0/gems/fog-core-2.3.0/lib/fog/core/attributes/default.rb:52: warning: previous definition of bits was here
/usr/lib/ruby/gems/3.0.0/gems/fog-core-2.3.0/lib/fog/core/attributes/default.rb:43: warning: method redefined; discarding old nodes=
/usr/lib/ruby/gems/3.0.0/gems/fog-core-2.3.0/lib/fog/core/attributes/default.rb:43: warning: previous definition of nodes= was here
/usr/lib/ruby/gems/3.0.0/gems/fog-core-2.3.0/lib/fog/core/attributes/default.rb:52: warning: method redefined; discarding old nodes
/usr/lib/ruby/gems/3.0.0/gems/fog-core-2.3.0/lib/fog/core/attributes/default.rb:52: warning: previous definition of nodes was here
/home/micwoj92/pkg/fog-brightbox/lib/fog/brightbox/models/compute/load_balancer.rb:82: warning: method redefined; discarding old certificate_expires_at
/usr/lib/ruby/gems/3.0.0/gems/fog-core-2.3.0/lib/fog/core/attributes/default.rb:52: warning: previous definition of certificate_expires_at was here
/home/micwoj92/pkg/fog-brightbox/lib/fog/brightbox/models/compute/load_balancer.rb:87: warning: method redefined; discarding old certificate_subject
/usr/lib/ruby/gems/3.0.0/gems/fog-core-2.3.0/lib/fog/core/attributes/default.rb:52: warning: previous definition of certificate_subject was here
Run options: --seed 17974

# Running:

......................................................................................................................................................................................................................................................................

Finished in 0.269072s, 973.7182 runs/s, 1397.3972 assertions/s.

262 runs, 376 assertions, 0 failures, 0 errors, 0 skips

@tokengeek
Copy link
Member

Hi @micwoj92

Thanks for the pull request. I have had a brief look at it but don't really have time to do too much with it yet given some issues I've encountered in testing.

The workflow actions aren't in sync for the main fog repo so there are some older (unsupported) Ruby versions clashing with the older bundler version so it isn't a clean merge. Dropping support for them means coordinating with some upstream uses of the library.

When testing the change in an Ubuntu 20.04 container, it also failed to bundle correctly since rubocop seems to reporting a dependency on the json gem. This requires native build tools to be installed to build that gem, at least in my initial testing. That's on 20.04s default Ruby 2.7.0

The purpose of fog-json was to abstract the JSON library available to be used and declaring a native gem requirement in a development tool changes things slightly.

One other issue that used to exist with rubocop but does seem fixed with later versions is poor support for limiting checks/auto correct on different Ruby versions. The number of times I've seen it introduce breaking changes means I'm not in a great rush to update it without also confirming an interim version works with whatever versions I'm still required to support.

Was there a specific reason you felt just rubocop needed updating? Is it related to any upstream (fog/fog or brightbox/brightbox-cli) or downstream (fog/fog-core) work?

@micwoj92
Copy link
Author

When testing the change in an Ubuntu 20.04 container, it also failed to bundle correctly since rubocop seems to reporting a dependency on the json gem. This requires native build tools to be installed to build that gem, at least in my initial testing. That's on 20.04s default Ruby 2.7.0

The purpose of fog-json was to abstract the JSON library available to be used and declaring a native gem requirement in a development tool changes things slightly.

Could maybe using https://rubygems.org/gems/json_pure help?

One other issue that used to exist with rubocop but does seem fixed with later versions is poor support for limiting checks/auto correct on different Ruby versions. The number of times I've seen it introduce breaking changes means I'm not in a great rush to update it without also confirming an interim version works with whatever versions I'm still required to support.

Was there a specific reason you felt just rubocop needed updating? Is it related to any upstream (fog/fog or brightbox/brightbox-cli) or downstream (fog/fog-core) work?

ruby-fog-* packages are available in AUR, currently the packages just install using gem install from .gem file.
Ideally I'd like to also enable running test/checks in the build process for all of them (currently seems like a far-fetched dream), that means using system wide installed libraries instead instead of downloading specified gem version for each package(and I'd like to avoid doing that as much as possible).
I've opened few issues in other fog repos about updating dependencies, for example fog/fog#4086 or fog/fog-core#290 and I will probably post more in the future.

@tokengeek
Copy link
Member

I've pushed #74 which splits the workflow actions and pinning them to use Ubuntu 20.04. That clears up the build failures which seems to be a known issue with how setup-ruby works combined with old Rubies/newer GLIC.

I'm testing removing the rubocop dependency completely because it is a development only dependency. In which case if you are planning to add testing, it would be up to you to setup testing accordingly.

... And it seemed to work out so I've merged in #75

Could maybe using https://rubygems.org/gems/json_pure help?

That wouldn't help since the dependency is from rubocop.

An error occurred while installing json (2.6.3), and Bundler cannot continue.

In Gemfile:
  rubocop was resolved to 1.57.2, which depends on
    json

⋮

An error occurred while installing racc (1.7.3), and Bundler cannot continue.

In Gemfile:
  rubocop was resolved to 1.57.2, which depends on
    rubocop-ast was resolved to 1.30.0, which depends on
      parser was resolved to 3.2.2.4, which depends on
        racc

So if you want to install development dependencies you either need to sort native gem building out. That may be covered by the base development tools on Arch. Or try something else like using a Gemfile without rubocop for any post install tests you intend to automate.

Anyway, the rubocop dependency is now unpinned so the original pull request isn't required anymore.

Thanks.

@tokengeek tokengeek closed this Nov 24, 2023
@micwoj92
Copy link
Author

Thanks for these changes, is there a possibility to release new version of this gem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants