Fix kwargs deprecation warnings for Ruby 2.7
What does this MR do?
Contributes to #257438 (closed)
Fixes a new batch of deprecation warnings
Screenshots (strongly suggested)
Before
Click this to collapse/fold.
→ be rspec spec/lib/gitlab/checks/timed_logger_spec.rb spec/lib/gitlab/ci/ansi2json_spec.rb spec/lib/gitlab/email/handler/create_issue_handler_spec.rb spec/lib/api/validations/validators/
/Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/acts-as-taggable-on-6.5.0/lib/acts_as_taggable_on/tagging.rb:9: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activerecord-6.0.3.3/lib/active_record/associations.rb:1657: warning: The called method `belongs_to' is defined here
/Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/marginalia-1.9.0/lib/marginalia.rb:94: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activerecord-6.0.3.3/lib/active_record/connection_adapters/postgresql_adapter.rb:648: warning: The called method `execute_and_clear_without_marginalia' is defined here
/Users/ck3g/Developer/GitLab/gitlab-development-kit/gitlab/app/workers/concerns/worker_context.rb:8: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/ck3g/Developer/GitLab/gitlab-development-kit/gitlab/lib/gitlab/application_context.rb:33: warning: The called method `initialize' is defined here
Run options: include {:focus=>true}
All examples were filtered out; ignoring {:focus=>true}
./Users/ck3g/Developer/GitLab/gitlab-development-kit/gitlab/lib/gitlab/checks/timed_logger.rb:34: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/ck3g/Developer/GitLab/gitlab-development-kit/gitlab/lib/gitlab/checks/timed_logger.rb:64: warning: The called method `time_suffix_message' is defined here
../Users/ck3g/Developer/GitLab/gitlab-development-kit/gitlab/lib/gitlab/ci/ansi2json/converter.rb:26: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/ck3g/Developer/GitLab/gitlab-development-kit/gitlab/lib/gitlab/ci/ansi2json/style.rb:9: warning: The called method `initialize' is defined here
.............................../Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/state_machines-activerecord-0.6.0/lib/state_machines/integrations/active_record.rb:511: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activerecord-6.0.3.3/lib/active_record/suppressor.rb:43: warning: The called method `save' is defined here
WARNING: Active Record does not support composite primary key.
project_authorizations has composite primary key. Composite primary key is ignored.
......./Users/ck3g/Developer/GitLab/gitlab-development-kit/gitlab/lib/gitlab/email/handler/reply_processing.rb:48: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/ck3g/Developer/GitLab/gitlab-development-kit/gitlab/lib/gitlab/email/attachment_uploader.rb:12: warning: The called method `execute' is defined here
....../Users/ck3g/Developer/GitLab/gitlab-development-kit/gitlab/lib/api/validations/validators/absence.rb:10: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/grape-1.4.0/lib/grape/exceptions/validation.rb:11: warning: The called method `initialize' is defined here
../Users/ck3g/Developer/GitLab/gitlab-development-kit/gitlab/lib/api/validations/validators/array_none_any.rb:13: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/grape-1.4.0/lib/grape/exceptions/validation.rb:11: warning: The called method `initialize' is defined here
../Users/ck3g/Developer/GitLab/gitlab-development-kit/gitlab/lib/api/validations/validators/email_or_email_list.rb:14: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/grape-1.4.0/lib/grape/exceptions/validation.rb:11: warning: The called method `initialize' is defined here
../Users/ck3g/Developer/GitLab/gitlab-development-kit/gitlab/lib/api/validations/validators/file_path.rb:14: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/grape-1.4.0/lib/grape/exceptions/validation.rb:11: warning: The called method `initialize' is defined here
....../Users/ck3g/Developer/GitLab/gitlab-development-kit/gitlab/lib/api/validations/validators/git_ref.rb:20: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/grape-1.4.0/lib/grape/exceptions/validation.rb:11: warning: The called method `initialize' is defined here
../Users/ck3g/Developer/GitLab/gitlab-development-kit/gitlab/lib/api/validations/validators/git_sha.rb:12: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/grape-1.4.0/lib/grape/exceptions/validation.rb:11: warning: The called method `initialize' is defined here
.../Users/ck3g/Developer/GitLab/gitlab-development-kit/gitlab/lib/api/validations/validators/integer_or_custom_value.rb:19: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/grape-1.4.0/lib/grape/exceptions/validation.rb:11: warning: The called method `initialize' is defined here
....../Users/ck3g/Developer/GitLab/gitlab-development-kit/gitlab/lib/api/validations/validators/limit.rb:12: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/grape-1.4.0/lib/grape/exceptions/validation.rb:11: warning: The called method `initialize' is defined here
../Users/ck3g/Developer/GitLab/gitlab-development-kit/gitlab/lib/api/validations/validators/untrusted_regexp.rb:14: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/grape-1.4.0/lib/grape/exceptions/validation.rb:11: warning: The called method `initialize' is defined here
.
Finished in 8.95 seconds (files took 39.38 seconds to load)
73 examples, 0 failures
After
Click this to collapse/fold.
→ be rspec spec/lib/gitlab/checks/timed_logger_spec.rb spec/lib/gitlab/ci/ansi2json_spec.rb spec/lib/gitlab/email/handler/create_issue_handler_spec.rb spec/lib/api/validations/validators/
/Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/acts-as-taggable-on-6.5.0/lib/acts_as_taggable_on/tagging.rb:9: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activerecord-6.0.3.3/lib/active_record/associations.rb:1657: warning: The called method `belongs_to' is defined here
/Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/marginalia-1.9.0/lib/marginalia.rb:94: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activerecord-6.0.3.3/lib/active_record/connection_adapters/postgresql_adapter.rb:648: warning: The called method `execute_and_clear_without_marginalia' is defined here
/Users/ck3g/Developer/GitLab/gitlab-development-kit/gitlab/app/workers/concerns/worker_context.rb:8: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/ck3g/Developer/GitLab/gitlab-development-kit/gitlab/lib/gitlab/application_context.rb:33: warning: The called method `initialize' is defined here
Run options: include {:focus=>true}
All examples were filtered out; ignoring {:focus=>true}
................................../Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/state_machines-activerecord-0.6.0/lib/state_machines/integrations/active_record.rb:511: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activerecord-6.0.3.3/lib/active_record/suppressor.rb:43: warning: The called method `save' is defined here
WARNING: Active Record does not support composite primary key.
project_authorizations has composite primary key. Composite primary key is ignored.
.......................................
Finished in 9.46 seconds (files took 38.75 seconds to load)
73 examples, 0 failures
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team