sequencescape icon indicating copy to clipboard operation
sequencescape copied to clipboard

GPL-nnn Ruby 2.7.x deprecation warnings

Open JamesGlover opened this issue 4 years ago • 2 comments

User story As a developer I'd like to fix Ruby 2.7 deprecation warnings to provide an avenue for future Ruby upgrades.

2.7.0-2.7.1 had quite noisy deprecation warnings. These have been silenced by default in 2.7.2 allowing us to upgrade, but they may still block future Ruby upgrades. (Although last I heard that the actual changes have been delayed, and existing behaviour should still work in Ruby 3, releasing this Christmas)

Most of the existing warnings appear to be dependencies, which we'll need to upgrade.

** Full list of warnings **

/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/activerecord-5.2.4.3/lib/active_record/transactions.rb:212: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/database_statements.rb:260: warning: The called method `transaction' is defined here
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/transaction.rb:171: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/transaction.rb:97: warning: The called method `initialize' is defined here
/home/travis/build/sanger/sequencescape/lib/plate_map_generation.rb:44: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/build/sanger/sequencescape/lib/plate_map_generation.rb:48: warning: The called method `initialize' is defined here
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/activemodel-5.2.4.3/lib/active_model/type/integer.rb:13: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/activemodel-5.2.4.3/lib/active_model/type/value.rb:8: warning: The called method `initialize' is defined here
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/mysql/database_statements.rb:12: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/query_cache.rb:95: warning: The called method `select_all' is defined here
/home/travis/build/sanger/sequencescape/app/models/barcode.rb:67: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/bundler/gems/sanger_barcode_format-df3421bec461/lib/sanger_barcode_format/sanger_barcode.rb:45: warning: The called method `initialize' is defined here
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/transaction.rb:146: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/activerecord-5.2.4.3/lib/active_record/relation/delegation.rb:132: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/activerecord-5.2.4.3/lib/active_record/relation.rb:25: warning: The called method `initialize' is defined here
/home/travis/build/sanger/sequencescape/lib/rails-authorization-plugin/lib/publishare/object_roles_table.rb:14: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/activerecord-5.2.4.3/lib/active_record/associations.rb:1368: warning: The called method `has_many' is defined here
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/activerecord-5.2.4.3/lib/active_record/persistence.rb:705: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/activerecord-5.2.4.3/lib/active_record/timestamp.rb:105: warning: The called method `_update_record' is defined here
./home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/activemodel-5.2.4.3/lib/active_model/naming.rb:190: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/i18n-1.8.3/lib/i18n.rb:195: warning: The called method `translate' is defined here
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/activemodel-5.2.4.3/lib/active_model/translation.rb:67: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/activemodel-5.2.4.3/lib/active_model/errors.rb:430: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/dynamic_form-1.1.4/lib/active_model/dynamic_errors.rb:35: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/i18n-1.8.3/lib/i18n.rb:195: warning: The called method `t' is defined here
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/actionview-5.2.4.3/lib/action_view/view_paths.rb:11: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/actionview-5.2.4.3/lib/action_view/lookup_context.rb:128: warning: The called method `template_exists?' is defined here
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/actionview-5.2.4.3/lib/action_view/helpers/tag_helper.rb:110: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/actionview-5.2.4.3/lib/action_view/helpers/tag_helper.rb:44: warning: The called method `tag_string' is defined here
./home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/actionpack-5.2.4.3/lib/action_dispatch/testing/integration.rb:350: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/actionpack-5.2.4.3/lib/action_dispatch/testing/integration.rb:23: warning: The called method `post' is defined here
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/actionpack-5.2.4.3/lib/action_dispatch/testing/integration.rb:350: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/actionpack-5.2.4.3/lib/action_dispatch/testing/integration.rb:17: warning: The called method `get' is defined here
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/actionpack-5.2.4.3/lib/action_dispatch/middleware/cookies.rb:647: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/activesupport-5.2.4.3/lib/active_support/message_encryptor.rb:150: warning: The called method `encrypt_and_sign' is defined here
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/activesupport-5.2.4.3/lib/active_support/message_encryptor.rb:175: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/activesupport-5.2.4.3/lib/active_support/messages/metadata.rb:17: warning: The called method `wrap' is defined here
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/activesupport-5.2.4.3/lib/active_support/cache.rb:445: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/activesupport-5.2.4.3/lib/active_support/cache.rb:716: warning: The called method `initialize' is defined here
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/carrierwave-1.3.1/lib/carrierwave/sanitized_file.rb:316: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/fileutils.rb:206: warning: The called method `mkdir_p' is defined here
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/dynamic_form-1.1.4/lib/active_model/dynamic_errors.rb:30: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/roo-2.8.3/lib/roo/csv.rb:96: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/csv.rb:508: warning: The called method `foreach' is defined here
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/actionpack-5.2.4.3/lib/action_dispatch/testing/integration.rb:29: warning: The called method `patch' is defined here
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/activemodel-5.2.4.3/lib/active_model/naming.rb:190: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/dynamic_form-1.1.4/lib/active_model/dynamic_errors.rb:28: warning: deprecated Object#=~ is called on LabelPrinter::PmbException; it always returns nil
/home/travis/build/sanger/sequencescape/spec/helpers/deprecation_helper_spec.rb:11: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/build/sanger/sequencescape/app/helpers/deprecation_helper.rb:44: warning: The called method `deprecate_section' is defined here
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/formtastic-3.1.5/lib/formtastic/localizer.rb:118: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/formtastic-3.1.5/lib/formtastic/i18n.rb:26: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/formtastic-3.1.5/lib/formtastic/localizer.rb:104: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
./home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/formtastic-3.1.5/lib/formtastic/localizer.rb:118: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/home/travis/build/sanger/sequencescape/lib/warren.rb:16: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/build/sanger/sequencescape/lib/warren.rb:5: warning: The called method `construct' is defined here
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/actionpack-5.2.4.3/lib/action_dispatch/middleware/stack.rb:37: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/actionpack-5.2.4.3/lib/action_dispatch/middleware/static.rb:111: warning: The called method `initialize' is defined here
/home/travis/build/sanger/sequencescape/app/api/core/initializable.rb:19: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/activesupport-5.2.4.3/lib/active_support/core_ext/module/delegation.rb:154: warning: The called method `delegate' is defined here
/home/travis/build/sanger/sequencescape/app/models/metadata.rb:25: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/activerecord-5.2.4.3/lib/active_record/associations.rb:1507: warning: The called method `has_one' is defined here
Knapsack time offset warning enabled!
Randomized with seed 16017
./home/travis/build/sanger/sequencescape/app/models/barcode.rb:67: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
./home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/activesupport-5.2.4.3/lib/active_support/option_merger.rb:24: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/actionview-5.2.4.3/lib/action_view/helpers/translation_helper.rb:91: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/dynamic_form-1.1.4/lib/active_model/dynamic_errors.rb:28: warning: deprecated Object#=~ is called on BarcodePrinter::BarcodePrinterException; it always returns nil
/home/travis/build/sanger/sequencescape/vendor/bundle/ruby/2.7.0/gems/actionpack-5.2.4.3/lib/action_dispatch/testing/integration.rb:35: warning: The called method `put' is defined here

Further reading In Ruby 2.7.2

You can turn on deprecation warnings by specifying the -w or -W:deprecated option at the command-line. Please check the topics below for details. https://bugs.ruby-lang.org/issues/17000 https://bugs.ruby-lang.org/issues/16345

JamesGlover avatar Oct 13 '20 09:10 JamesGlover

Looks like I was mistaken about the named arguments changes being delayed, and they ended up in the Ruby 3 release after all. Looks like this is blocking our migration to Ruby 3. Still not urgent but would be nice to do it within the next few months.

JamesGlover avatar Jan 05 '21 09:01 JamesGlover

Part of this is the dynamic_form gem

JamesGlover avatar Feb 03 '22 08:02 JamesGlover