Skip to content

Fix kwargs deprecation warnings for Ruby 2.7

Vitali Tatarintev requested to merge ck3g-fix-kwargs-warnings-batch-5 into master

What does this MR do?

Contributes to #257438 (closed)

Screenshots (strongly suggested)

Before

Click this to collapse/fold.

→ be rspec spec/lib/gitlab/sanitizers/exif_spec.rb spec/lib/banzai/filter/merge_request_reference_filter_spec.rb spec/lib/gitlab/import_export/project/sample/relation_tree_restorer_spec.rb ee/spec/services/security/ci_configuration/sast_create_service_spec.rb ee/spec/controllers/projects/security/sast_configuration_controller_spec.rb ee/spec/services/dast_on_demand_scans/create_service_spec.rb ee/spec/models/visible_approvable_spec.rb ee/spec/controllers/groups/analytics/repository_analytics_controller_spec.rb
/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
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.
/Users/ck3g/Developer/GitLab/gitlab-development-kit/gitlab/lib/gitlab/sanitizers/exif.rb:70: 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/relation/batches.rb:67: warning: The called method `find_each' is defined here
....../Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/gems/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
/Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/2.7.0/fileutils.rb:206: warning: The called method `mkdir_p' 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:515: 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:47: warning: The called method `save!' is defined here
..../Users/ck3g/Developer/GitLab/gitlab-development-kit/gitlab/lib/banzai/filter/merge_request_reference_filter.rb:63: 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/banzai/filter/abstract_reference_filter.rb:252: warning: The called method `data_attributes_for' 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.

merge_request_diff_commits has composite primary key. Composite primary key is ignored.
........WARNING: Active Record does not support composite primary key.

user_interacted_projects has composite primary key. Composite primary key is ignored.
/Users/ck3g/Developer/GitLab/gitlab-development-kit/gitlab/lib/gitlab/import_export/project/sample/relation_tree_restorer.rb:9: 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/import_export/relation_tree_restorer.rb:14: warning: The called method `initialize' is defined here
../Users/ck3g/Developer/GitLab/gitlab-development-kit/gitlab/lib/gitlab/import_export/relation_tree_restorer.rb:158: 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/import_export/base/relation_factory.rb:34: warning: The called method `create' is defined here
WARNING: Active Record does not support composite primary key.

milestone_releases has composite primary key. Composite primary key is ignored.
WARNING: Active Record does not support composite primary key.

issue_assignees has composite primary key. Composite primary key is ignored.
....../Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/message_expectation.rb:101: 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/tracking.rb:27: warning: The called method `event' is defined here
..../Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/devise-4.7.3/lib/devise/test/controller_helpers.rb:35: 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/rails-controller-testing-1.0.5/lib/rails/controller/testing/template_assertions.rb:60: warning: The called method `process' is defined here
..../Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/dsl.rb:526: 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/capybara-3.33.0/lib/capybara/rspec/matchers.rb:51: warning: The called method is defined here
.../Users/ck3g/Developer/GitLab/gitlab-development-kit/gitlab/ee/app/services/security/ci_configuration/sast_create_service.rb:60: 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/tracking.rb:27: warning: The called method `event' is defined here
../Users/ck3g/Developer/GitLab/gitlab-development-kit/gitlab/ee/app/services/dast_on_demand_scans/create_service.rb:79: 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/ee/app/services/ci/run_dast_scan_service.rb:27: warning: The called method `execute' 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
/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
...../Users/ck3g/Developer/GitLab/gitlab-development-kit/gitlab/ee/app/models/concerns/visible_approvable.rb:20: 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/ee/app/models/approval_state.rb:95: warning: The called method `filtered_approvers' is defined here
........./Users/ck3g/Developer/GitLab/gitlab-development-kit/gitlab/ee/app/controllers/groups/analytics/repository_analytics_controller.rb:11: 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/tracking.rb:12: warning: The called method `track_event' is defined here
....

Finished in 54.67 seconds (files took 39.19 seconds to load)
90 examples, 0 failures

After

Click this to collapse/fold.

→ be rspec spec/lib/gitlab/sanitizers/exif_spec.rb spec/lib/banzai/filter/merge_request_reference_filter_spec.rb spec/lib/gitlab/import_export/project/sample/relation_tree_restorer_spec.rb ee/spec/services/security/ci_configuration/sast_create_service_spec.rb ee/spec/controllers/projects/security/sast_configuration_controller_spec.rb ee/spec/services/dast_on_demand_scans/create_service_spec.rb ee/spec/models/visible_approvable_spec.rb ee/spec/controllers/groups/analytics/repository_analytics_controller_spec.rb
/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
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.
....../Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/gems/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
/Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/2.7.0/fileutils.rb:206: warning: The called method `mkdir_p' 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:515: 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:47: warning: The called method `save!' 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.

merge_request_diff_commits has composite primary key. Composite primary key is ignored.
........WARNING: Active Record does not support composite primary key.

user_interacted_projects has composite primary key. Composite primary key is ignored.
..WARNING: Active Record does not support composite primary key.

milestone_releases has composite primary key. Composite primary key is ignored.
WARNING: Active Record does not support composite primary key.

issue_assignees has composite primary key. Composite primary key is ignored.
....../Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/message_expectation.rb:101: 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/tracking.rb:27: warning: The called method `event' is defined here
..../Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/devise-4.7.3/lib/devise/test/controller_helpers.rb:35: 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/rails-controller-testing-1.0.5/lib/rails/controller/testing/template_assertions.rb:60: warning: The called method `process' is defined here
..../Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/dsl.rb:526: 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/capybara-3.33.0/lib/capybara/rspec/matchers.rb:51: warning: The called method 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
/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
..................

Finished in 58.4 seconds (files took 36.48 seconds to load)
90 examples, 0 failures

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

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
Edited by Vitali Tatarintev

Merge request reports