Loading
Update spring to 4.1.x
What does this MR do and why?
This fixes Ruby 3 compatibility; I was getting this error when running specs via spring:
git@822c47967818:~/gitlab$ bin/rspec spec/lib/gitlab/memory/reporter_spec.rb
/data/cache/bundle-3.0.4/gems/bundler-2.3.22/lib/bundler/runtime.rb:308:in `check_for_activated_spec!': You have already activated set 1.0.3, but your Gemfile requires set 1.0.1. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
from /data/cache/bundle-3.0.4/gems/bundler-2.3.22/lib/bundler/runtime.rb:25:in `block in setup'
from /data/cache/bundle-3.0.4/gems/bundler-2.3.22/lib/bundler/spec_set.rb:155:in `each'
from /data/cache/bundle-3.0.4/gems/bundler-2.3.22/lib/bundler/spec_set.rb:155:in `each'
from /data/cache/bundle-3.0.4/gems/bundler-2.3.22/lib/bundler/runtime.rb:24:in `map'
from /data/cache/bundle-3.0.4/gems/bundler-2.3.22/lib/bundler/runtime.rb:24:in `setup'
from /data/cache/bundle-3.0.4/gems/bundler-2.3.22/lib/bundler.rb:162:in `setup'
from /data/cache/bundle-3.0.4/gems/bundler-2.3.22/lib/bundler/setup.rb:20:in `block in <top (required)>'
from /data/cache/bundle-3.0.4/gems/bundler-2.3.22/lib/bundler/ui/shell.rb:136:in `with_level'
from /data/cache/bundle-3.0.4/gems/bundler-2.3.22/lib/bundler/ui/shell.rb:88:in `silence'
from /data/cache/bundle-3.0.4/gems/bundler-2.3.22/lib/bundler/setup.rb:20:in `<top (required)>'
from <internal:/usr/local/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/usr/local/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /data/cache/bundle-3.0.4/ruby/3.0.0/gems/spring-2.1.1/lib/spring/commands.rb:33:in `<module:Spring>'
from /data/cache/bundle-3.0.4/ruby/3.0.0/gems/spring-2.1.1/lib/spring/commands.rb:4:in `<top (required)>'
from <internal:/usr/local/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/usr/local/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /data/cache/bundle-3.0.4/ruby/3.0.0/gems/spring-2.1.1/lib/spring/server.rb:9:in `<top (required)>'
from <internal:/usr/local/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/usr/local/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /data/cache/bundle-3.0.4/ruby/3.0.0/gems/spring-2.1.1/lib/spring/client/server.rb:9:in `call'
from /data/cache/bundle-3.0.4/ruby/3.0.0/gems/spring-2.1.1/lib/spring/client/command.rb:7:in `call'
from /data/cache/bundle-3.0.4/ruby/3.0.0/gems/spring-2.1.1/lib/spring/client.rb:30:in `run'
from /data/cache/bundle-3.0.4/ruby/3.0.0/gems/spring-2.1.1/bin/spring:49:in `<main>'
git@822c47967818:~/gitlab$
exit
make: *** [Makefile.control.mk:63: shell] Error 1
After the update, it works:
git@822c47967818:~/gitlab$ bin/rspec spec/lib/gitlab/memory/reporter_spec.rb
Running via Spring preloader in process 369
Run options: include {:focus=>true}
All examples were filtered out; ignoring {:focus=>true}
Test environment set up in 5.183590862 seconds
Gitlab::Memory::Reporter
# order random
#run_report
runs the given report
logs duration and other metrics
increments Prometheus duration counter
when the report returns invalid file path
logs `0` as `perf_report_size_bytes`
Finished in 6.89 seconds (files took 0.71375 seconds to load)
4 examples, 0 failures
Changes
- https://github.com/rails/spring/blob/main/CHANGELOG.md
- https://my.diffend.io/gems/spring/2.1.1/4.1.0
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
We can verify the change using the binstubs generated by bundle exec spring binstub and which are stored in bin/
For instance, to run tests with spring, we can run:
bin/rspec spec/../...
To open a Rails console:
bin/spring rails c
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.
Edited by Matthias Käppler