Skip to content

Fix DastScannerProfiles::Update Ruby 2.7 kwarg warn

What does this MR do?

fixes the ruby 2.7 deprecation warnings that appear in the ee/app/graphql/mutations/dast_site_profiles/update.rb per the project-wide effort described in #257438 (closed)

Before

Mutations::DastScannerProfiles::Update
/Users/philip/Code/gitlab-development-kit/gitlab/spec/support/helpers/stubbed_feature.rb:33: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/philip/Code/gitlab-development-kit/gitlab/lib/feature.rb:61: warning: The called method `enabled?' is defined here
/Users/philip/.rbenv/versions/2.7.1/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/philip/.rbenv/versions/2.7.1/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
  #resolve
    when on demand scan feature is enabled
      when the project does not exist
/Users/philip/Code/gitlab-development-kit/gitlab/lib/gitlab/graphql/authorize/authorize_resource.rb:33: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/philip/Code/gitlab-development-kit/gitlab/ee/app/graphql/mutations/dast_scanner_profiles/update.rb:55: warning: The called method `find_object' is defined here
/Users/philip/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/batch-loader-1.4.0/lib/batch_loader/graphql.rb:38: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/philip/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/batch-loader-1.4.0/lib/batch_loader.rb:26: warning: The called method `batch' is defined here
        raises an exception
      when the user is not associated with the project
        raises an exception
      when user can not run a DAST scan
        raises an exception
      when the user can run a DAST scan
/Users/philip/Code/gitlab-development-kit/gitlab/ee/app/graphql/mutations/dast_scanner_profiles/update.rb:44: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/philip/Code/gitlab-development-kit/gitlab/ee/app/services/dast_scanner_profiles/update_service.rb:7: warning: The called method `execute' is defined here
        updates the dast_scanner_profile
        when dast scanner profile does not exist
          raises an exception
        when on demand scan feature is not enabled                                                                                                                                                                                    raises an exception
        when on demand scan licensed feature is not available
          raises an exception

Finished in 3.88 seconds (files took 29.06 seconds to load)
7 examples, 0 failures

After

Mutations::DastScannerProfiles::Update
/Users/philip/Code/gitlab-development-kit/gitlab/spec/support/helpers/stubbed_feature.rb:33: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/philip/Code/gitlab-development-kit/gitlab/lib/feature.rb:61: warning: The called method `enabled?' is defined here
/Users/philip/.rbenv/versions/2.7.1/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/philip/.rbenv/versions/2.7.1/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
  #resolve
    when on demand scan feature is enabled
      when the project does not exist
/Users/philip/Code/gitlab-development-kit/gitlab/lib/gitlab/graphql/authorize/authorize_resource.rb:33: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/philip/Code/gitlab-development-kit/gitlab/ee/app/graphql/mutations/dast_scanner_profiles/update.rb:55: warning: The called method `find_object' is defined here
/Users/philip/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/batch-loader-1.4.0/lib/batch_loader/graphql.rb:38: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/philip/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/batch-loader-1.4.0/lib/batch_loader.rb:26: warning: The called method `batch' is defined here
        raises an exception
      when the user is not associated with the project
        raises an exception
      when user can not run a DAST scan
        raises an exception
      when the user can run a DAST scan
        updates the dast_scanner_profile
        when dast scanner profile does not exist
          raises an exception
        when on demand scan feature is not enabled
          raises an exception
        when on demand scan licensed feature is not available
          raises an exception

Finished in 4.26 seconds (files took 30.11 seconds to load)
7 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