Skip to content

Fix kwargs deprecation warnings for Ruby 2.7

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

What does this MR do?

Contributes to #257438 (closed)

Fixes keyword arguments deprecation warnings for Ruby 2.7

Screenshots (strongly suggested)

Before

Click this to collapse/fold.

→ be rspec ee/spec/graphql/resolvers/epics_resolver_spec.rb spec/graphql/resolvers/ci/runner_setup_resolver_spec.rb spec/models/concerns/issuable_spec.rb spec/controllers/projects/milestones_controller_spec.rb  spec/services/git/base_hooks_service_spec.rb spec/services/ci/create_pipeline_service_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
/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/ee/app/graphql/resolvers/epics_resolver.rb:55: 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/graphql-1.11.4/lib/graphql/schema/resolver.rb:130: warning: The called method `ready?' is defined here
..............WARNING: Active Record does not support composite primary key.

milestone_releases has composite primary key. Composite primary key is ignored.
/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/app/graphql/resolvers/ci/runner_setup_resolver.rb:25: 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/runner_instructions.rb:54: warning: The called method `initialize' is defined here
....WARNING: Active Record does not support composite primary key.

user_interacted_projects has composite primary key. Composite primary key is ignored.
..................../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
.........................................................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/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/app/models/concerns/issuable.rb:314: 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/app/models/concerns/sortable.rb:47: warning: The called method `highest_label_priority' 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/Developer/GitLab/gitlab-development-kit/gitlab/app/models/label.rb:260: 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/app/models/concerns/presentable.rb:12: warning: The called method `present' 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/.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/app/services/git/base_hooks_service.rb:137: 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/data_builder/push.rb:88: warning: The called method `build' is defined here
/Users/ck3g/Developer/GitLab/gitlab-development-kit/gitlab/app/services/ci/create_pipeline_service.rb:94: 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/app/services/ci/create_pipeline_service.rb:51: warning: The called method `execute' is defined here
../Users/ck3g/Developer/GitLab/gitlab-development-kit/gitlab/app/services/git/base_hooks_service.rb:142: 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/data_builder/push.rb:88: warning: The called method `build' 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
....WARNING: Active Record does not support composite primary key.

merge_request_diff_commits has composite primary key. Composite primary key is ignored.
........................./Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activerecord-6.0.3.3/lib/active_record/relation.rb:412: 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/app/models/concerns/has_environment_scope.rb:25: 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
.............................*................../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/app/models/concerns/bulk_insert_safe.rb:84: warning: The called method `bulk_insert!' is defined here
.......................................................

Pending: (Failures listed here are expected and do not affect your suite's status)

  1) Ci::CreatePipelineService#execute Pipeline for external pull requests when source is external pull request when config has external_pull_requests keywords when external pull request is specified when pull request is created from fork does not create an external pull request pipeline
     # Not yet implemented
     # ./spec/services/ci/create_pipeline_service_spec.rb:1266


Finished in 2 minutes 36.9 seconds (files took 41.11 seconds to load)
348 examples, 0 failures, 1 pending

After

Click this to collapse/fold.

→ be rspec ee/spec/graphql/resolvers/epics_resolver_spec.rb spec/graphql/resolvers/ci/runner_setup_resolver_spec.rb spec/models/concerns/issuable_spec.rb spec/controllers/projects/milestones_controller_spec.rb  spec/services/git/base_hooks_service_spec.rb spec/services/ci/create_pipeline_service_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
/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}
..............WARNING: Active Record does not support composite primary key.

milestone_releases has composite primary key. Composite primary key is ignored.
/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.
...................WARNING: Active Record does not support composite primary key.

user_interacted_projects has composite primary key. Composite primary key is ignored.
..................../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
.........................................................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/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/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/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/.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/.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
....WARNING: Active Record does not support composite primary key.

merge_request_diff_commits has composite primary key. Composite primary key is ignored.
........................./Users/ck3g/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activerecord-6.0.3.3/lib/active_record/relation.rb:412: 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/app/models/concerns/has_environment_scope.rb:25: 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
.............................*................../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/app/models/concerns/bulk_insert_safe.rb:84: warning: The called method `bulk_insert!' is defined here
.......................................................

Pending: (Failures listed here are expected and do not affect your suite's status)

  1) Ci::CreatePipelineService#execute Pipeline for external pull requests when source is external pull request when config has external_pull_requests keywords when external pull request is specified when pull request is created from fork does not create an external pull request pipeline
     # Not yet implemented
     # ./spec/services/ci/create_pipeline_service_spec.rb:1266


Finished in 2 minutes 51.1 seconds (files took 50.05 seconds to load)
348 examples, 0 failures, 1 pending

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

Merge request reports