Upgrade rspec-parameterized to >= 1.0
What does this MR do and why?
This upgrade to support Ruby 3.2 because Refinenment#include
was removed (see gitlab-org/ruby/gems/gitlab-styles!147 (diffs, comment 1231921310)).
This upgrade brings back binding_of_caller
gem as transient dependency
of rspec-parameterized
. Earlier, it was removed in
!41629 (merged) due to
security concerns.
Now, this functionality is disabled in BetterErrors
explicitly and REPL
remains unavailable in development mode.
This MR also silences (via Warning.ignore
) a Ruby warning stemming from rspec-parameterized-table_syntax
on Ruby < 3.2 (see https://gitlab.com/gitlab-org/gitlab/-/jobs/3927513103#L2096) related to Refinement#include is deprecated and will be removed in Ruby 3.2
.
/builds/gitlab-org/gitlab/vendor/ruby/3.1.0/gems/rspec-parameterized-table_syntax-1.0.0/lib/rspec/parameterized/table_syntax.rb:42: warning: Refinement#include is deprecated and will be removed in Ruby 3.2
/builds/gitlab-org/gitlab/vendor/ruby/3.1.0/gems/rspec-parameterized-table_syntax-1.0.0/lib/rspec/parameterized/table_syntax.rb:46: warning: Refinement#include is deprecated and will be removed in Ruby 3.2
/builds/gitlab-org/gitlab/vendor/ruby/3.1.0/gems/rspec-parameterized-table_syntax-1.0.0/lib/rspec/parameterized/table_syntax.rb:50: warning: Refinement#include is deprecated and will be removed in Ruby 3.2
/builds/gitlab-org/gitlab/vendor/ruby/3.1.0/gems/rspec-parameterized-table_syntax-1.0.0/lib/rspec/parameterized/table_syntax.rb:54: warning: Refinement#include is deprecated and will be removed in Ruby 3.2
/builds/gitlab-org/gitlab/vendor/ruby/3.1.0/gems/rspec-parameterized-table_syntax-1.0.0/lib/rspec/parameterized/table_syntax.rb:58: warning: Refinement#include is deprecated and will be removed in Ruby 3.2
Refs !114366 (comment 1311413752).
Gem diffs
-
rspec-parameterized
- https://my.diffend.io/gems/rspec-parameterized/0.5.0/1.0.0- The gem has been split into
rspec-parameterized-core
andrspec-parameterized-table_syntax
- See https://github.com/tomykaira/rspec-parameterized/blob/master/UPGRADING.md
- The gem has been split into
-
unparser
- https://my.diffend.io/gems/unparser/0.6.0/0.6.7- Support for Ruby 3.1 + 3.2
- See https://github.com/mbj/unparser/blob/main/Changelog.md
Screenshots or screen recordings
Before (on master without binding_of_caller ) |
After (this MR with binding_of_caller disabled) |
---|---|
![]() |
![]() |
So, binding_of_caller
is require
d but is not enabled and thus REPL not available.
How to set up and validate locally
master
- Checkout
master
viagit checkout master
- Apply raise debug patch via `git apply'
diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml
index f0c1b0901403..3ee22b130fb3 100644
--- a/app/views/layouts/_head.html.haml
+++ b/app/views/layouts/_head.html.haml
@@ -1,3 +1,4 @@
+- raise({ ruby_version: RUBY_VERSION, binding_of_caller_required: $LOADED_FEATURES.grep(/binding_of_caller/).count > 0, binding_of_caller_enabled: BetterErrors.binding_of_caller_available}.inspect)
- page_description brand_title unless page_description
- site_name = _('GitLab')
%head{ prefix: "og: http://ogp.me/ns#" }
- Visit http://localhost:3000/ and see error page with
RuntimeError
This branch
- Checkout this branch via
git checkout pl-upgrade-rspec-parameterized
- Switch to Ruby 3.1 via
asdf local ruby 3.1.3
- Apply raise debug patch from above
- Checkout
Gemfile
changes from !114366 (closed) viagit checkout sh-test-ruby-3.1 Gemfile Gemfile.lock
-
bundle
andgdk restart
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.