Skip to content
Snippets Groups Projects

Fixing kwargs deprecation warnings for 2.7

Merged Vitali Tatarintev requested to merge ck3g-fix-kwargs-url-blocker into master
All threads resolved!

What does this MR do?

Contributes to #257438 (closed)

Fix kwargs warnings for:

  • Gitlab::UrlBlocker.validate!
  • Gitlab::UrlBlocker.blocked_url?

Screenshots (strongly suggested)

Before

→ be rspec spec/controllers/import/bulk_imports_controller_spec.rb spec/controllers/import/fogbugz_controller_spec.rb spec/controllers/import/gitea_controller_spec.rb spec/services/import/bitbucket_server_service_spec.rb spec/services/import/github_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/.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
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/controllers/import/gitea_controller.rb:73: 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/url_blocker.rb:22: warning: The called method `validate!' is defined here
............./Users/ck3g/Developer/GitLab/gitlab-development-kit/gitlab/app/services/import/github_service.rb:71: 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/url_blocker.rb:68: warning: The called method `blocked_url?' is defined here
........................../Users/ck3g/Developer/GitLab/gitlab-development-kit/gitlab/app/services/import/bitbucket_server_service.rb:82: 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/url_blocker.rb:68: warning: The called method `blocked_url?' is defined here
............

Finished in 41.64 seconds (files took 54.77 seconds to load)
79 examples, 0 failures

After

→ be rspec spec/controllers/import/bulk_imports_controller_spec.rb spec/controllers/import/fogbugz_controller_spec.rb spec/controllers/import/gitea_controller_spec.rb spec/services/import/bitbucket_server_service_spec.rb spec/services/import/github_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/.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
WARNING: Active Record does not support composite primary key.

project_authorizations has composite primary key. Composite primary key is ignored.
..........................................................

Finished in 46.76 seconds (files took 47.98 seconds to load)
79 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

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Sincheol (David) Kim approved this merge request

    approved this merge request

  • assigned to @proglottis and unassigned @dskim_gitlab

  • James Fargher approved this merge request

    approved this merge request

  • James Fargher resolved all threads

    resolved all threads

  • James Fargher enabled an automatic merge when the pipeline for 8921e786 succeeds

    enabled an automatic merge when the pipeline for 8921e786 succeeds

  • merged

  • James Fargher mentioned in commit 43667b2f

    mentioned in commit 43667b2f

  • added workflowcanary label and removed workflowstaging label

  • added workflowproduction label and removed workflowcanary label

  • Please register or sign in to reply
    Loading