Skip to content

[RUN ALL RSPEC] Selectively raise on Ruby 2.7 keyword warnings

Thong Kuah requested to merge selective_raise into master

What does this MR do?

Raise on all keyword related warnings (will become ArgumentError in Ruby 3). But allow some Gem paths to not raise as we fix them one by one.

Related issue: #257438 (closed), #258994 (closed)

Discarded approaches

  1. Committing the deprecations yml files. As CI jobs and developer machines all have different root paths, the keyword warning paths will not match. deprecation_toolkit does not handle this case.

e.g.

# CI
DEPRECATION WARNING: /builds/gitlab-org/gitlab/spec/support/helpers/next_instance_of.rb:28: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call

# locally
DEPRECATION WARNING: /Users/tkuah/code/ee-gdk/gitlab/spec/support/helpers/next_instance_of.rb:28: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
  1. Use deprecation_toolkit's allowed_deprecations. While it will work, it will not record non-raising warnings, which we still want to record so that we can summarise in the rspec:deprecations job.

  2. Use the DeprecationToolkit::Behaviors::Raise behaviour. Can't use this as we want some warnings to not raise.

Edited by Thong Kuah

Merge request reports