Skip to content

Fix DastSiteProfiles::Update Ruby 2.7 kwarg warn

Philip Cunningham requested to merge fix-kwargs-dast-site-profiles-257438 into master

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::DastSiteProfiles::Update
  #resolve
    when on demand scan feature is enabled
      when the project does not exist
/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
/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/app/graphql/mutations/concerns/mutations/authorizes_project.rb:13: 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 the user is an owner
/Users/philip/Code/gitlab-development-kit/gitlab/ee/app/graphql/mutations/dast_site_profiles/update.rb:39: 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_site_profiles/update_service.rb:5: warning: The called method `execute' is defined here
        has no errors
      when the user is a maintainer
        has no errors
      when the user is a developer
        has no errors
      when the user is a reporter
        raises an exception
      when the user is a guest
        raises an exception
      when the user can run a dast scan
        updates the dast_site_profile
        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 1 minute 17.71 seconds (files took 53.65 seconds to load)
10 examples, 0 failures

After

Mutations::DastSiteProfiles::Update
  #resolve
    when on demand scan feature is enabled
      when the project does not exist
/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
/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/app/graphql/mutations/concerns/mutations/authorizes_project.rb:13: 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 the user is an owner
        has no errors
      when the user is a maintainer
        has no errors
      when the user is a developer
        has no errors
      when the user is a reporter
        raises an exception
      when the user is a guest
        raises an exception
      when the user can run a dast scan
        updates the dast_site_profile
        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 6.34 seconds (files took 26.3 seconds to load)
10 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 Mayra Cabrera

Merge request reports