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

Reduce Ruby warnings in recent builds #345

Closed
jywarren opened this issue Feb 19, 2019 · 14 comments
Closed

Reduce Ruby warnings in recent builds #345

jywarren opened this issue Feb 19, 2019 · 14 comments

Comments

@jywarren
Copy link
Member

We're looking at upgrading Ruby in #319 and i'm seeing a lot of warning messages that weren't previously there in the recent #341 PR, which make it hard to read the output:

https://travis-ci.org/publiclab/mapknitter/builds/494340774

@sashadev-sky @gauravano @SidharthBansal what do you think, is this just stricter behavior from a more recent version of Ruby, or what else can we do to reduce the # of warnings? Thank you!

Just to note, it's not just in #341, i guess; this recent main branch build has lots too:

https://travis-ci.org/publiclab/mapknitter/builds/493792946

@jywarren
Copy link
Member Author

Looks like we're in Ruby 2.1.x in all these, so dunno if it's related to newer ruby versions. Errors sampling:

/usr/local/lib/ruby/gems/2.1.0/gems/will_paginate-3.1.6/lib/will_paginate/railtie.rb:1: warning: loading in progress, circular require considered harmful - /usr/local/lib/ruby/gems/2.1.0/gems/will_paginate-3.1.6/lib/will_paginate.rb

/usr/local/lib/ruby/gems/2.1.0/gems/railties-3.2.22.5/lib/rails/application.rb:98: warning: File.exists? is a deprecated name, use File.exist? instead

/usr/local/lib/ruby/gems/2.1.0/gems/will_paginate-3.1.6/lib/will_paginate/core_ext.rb:8: warning: previous definition of except was here
/usr/local/lib/ruby/gems/2.1.0/gems/activesupport-3.2.22.5/lib/active_support/core_ext/hash/except.rb:19: warning: method redefined; discarding old except!

/usr/local/lib/ruby/gems/2.1.0/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:251: warning: loading in progress, circular require considered harmful - /usr/local/lib/ruby/gems/2.1.0/gems/ruby-openid-2.7.0/lib/openid.rb
	from /usr/local/lib/ruby/gems/2.1.0/gems/rake-12.3.2/lib/rake/rake_test_loader.rb:5:in  `<main>'
	from /usr/local/lib/ruby/gems/2.1.0/gems/rake-12.3.2/lib/rake/rake_test_loader.rb:5:in  `select'
	from /usr/local/lib/ruby/gems/2.1.0/gems/rake-12.3.2/lib/rake/rake_test_loader.rb:17:in  `block in <main>'
	from /usr/local/lib/ruby/gems/2.1.0/gems/rake-12.3.2/lib/rake/rake_test_loader.rb:17:in  `require'
	from /app/test/unit/comment_test.rb:1:in  `<top (required)>'
	from /app/test/unit/comment_test.rb:1:in  `require'
	from /app/test/test_helper.rb:2:in  `<top (required)>'
	from /app/test/test_helper.rb:2:in  `require'
	from /app/config/environment.rb:5:in  `<top (required)>'
	from /usr/local/lib/ruby/gems/2.1.0/gems/railties-3.2.22.5/lib/rails/railtie/configurable.rb:30:in  `method_missing'

Hm, also looking back a ways, this didn't have the errors but is actually ruby 2.1.2 also: https://travis-ci.org/publiclab/mapknitter/builds/410929149

@grvsachdeva
Copy link
Member

grvsachdeva commented Feb 20, 2019

After a quick look at the above build logs point to deprecated File.exists? as a cause of these warnings, I will see if the #320 throws the same warning or not. Thanks!

@sashadev-sky
Copy link
Member

@gauravano @jywarren I will get involved with this too during mysql upgrade. If they are simple fixes I can always update them in that PR

@sashadev-sky
Copy link
Member

sashadev-sky commented Mar 27, 2019

Copying over some information from my PRs #380 and #355 related to this:

  • Warning ::Fixnum is deprecated error: this warning will be fixed with an update to Rails 5. see here
  • File.exists? (deprecated since ruby 2.2.0) updated to File.exist? comes from gems and from the source code for running a rake test. Source code is updated to File.exist? for Rails 4.

Problem gems:

  • paperclip seems to cause the greatest number of errors including errors mentioned above

    • Dependabot recommended update to 4.3.7 confirming this update is compatible but does not get rid of any warnings.
    • Recommended solution is to wait for upgrade to Rails 5.2 and then migrate away from Paperclip as its been deprecated: see here
    • also seeing: DEPRECATION WARNING: [paperclip] [deprecation] Rails 3.2 and 4.1 are unsupported as of Rails 5 release. Please upgrade to Rails 4.2 before upgrading paperclip. (called from class:Warpable at /Users/sashaboginsky/Desktop/public lab/mapknitter/app/models/warpable.rb:8)
  • ruby-openid

    • updating to latest version does not get rid of errors but I see a PR open on the gem page that would fix some of the warnings currently receiving (unused parameters, file.exists?)
  • open_id_authentication

  • will_paginate

    • already updated but PR currently open on the gem page to get rid of circular warnings error
  • friendly_id

    • Updated versions removed support for Rails < 4.0. see here so maybe try catching up to Rails 4.0 first

@sashadev-sky
Copy link
Member

sashadev-sky commented Mar 27, 2019

@jywarren from my comment above, should I open a PR to update to Rails 4 next to try to resolve some of the File.exists and maybe friendly_id errors?

also just saw this update is part of a gsoc proposal here so can also leave it for this person and link them my notes on the proposal page

@jywarren
Copy link
Member Author

jywarren commented Mar 30, 2019 via email

@kaustubh-nair
Copy link
Member

kaustubh-nair commented Mar 30, 2019

@sashadev-sky Sure that will be awesome. I can take up that issue!
Thanks!

@alaxalves
Copy link
Member

alaxalves commented Apr 2, 2019

@sashadev-sky A lot of those warnings will be missing in Rails Upgrade. I empirically upgraded to Rails 4.2.8 here and a lot of those warning have gone missing.

@jywarren
Copy link
Member Author

jywarren commented Apr 2, 2019 via email

@sashadev-sky
Copy link
Member

sashadev-sky commented Apr 3, 2019

@alaxalves Thank you that is great to hear! I'm going to open an issue regarding upgrading to Rails 4.0 to take it one step at a time. I will tag you there, let me know if you remember any gems or custom configs you remember having to update.

I'll also just look at the version you tagged a link to to see

@alaxalves
Copy link
Member

@sashadev-sky The greatest approach to this is gradually updating versions, such as 3.2 to the next release. eg. rails 3.2 to rails 3.3. using the appropriate rake task. I'll try to make all those steps clearer in my GSoC proposal. I'll finish it today(04/03/2019) and I submit the link here. What do you think?

@jywarren
Copy link
Member Author

I think we're doing MUCH better here now, and can close up and focus on Rails upgrades!!!

@jywarren
Copy link
Member Author

@jywarren
Copy link
Member Author

Thanks, everyone!

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

No branches or pull requests

5 participants