Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update gem requirement to allow Rails 7.1 #2453

Merged
merged 4 commits into from
Oct 5, 2023
Merged

Update gem requirement to allow Rails 7.1 #2453

merged 4 commits into from
Oct 5, 2023

Conversation

schinery
Copy link

@schinery schinery commented Oct 5, 2023

Purpose

Update allowed version of Rails to < 7.2.0 as they have now released 7.1.0.

Changes

  • Updates rails_versions in Gemspec to < 7.2
  • Updates CI rails-version to 7.1
  • Added ruby-version: '3.2' to CI tests

Related GitHub issues

Based changes on #2428 which updated from < 7.0 to < 7.1.

@carltonsmith
Copy link

@wasifhossain can we expect this to be merged soon? It's blocking our upgrade to rails 7.1 at the moment

@wasifhossain
Copy link
Member

unfortunately tests are failing to run on Ubuntu 18.04 stack. there's an open PR #2451 to address the issue.

could you please test this change on that branch and if tests pass, then we can merge both these PRs.

what do you think?

@schinery
Copy link
Author

schinery commented Oct 5, 2023

unfortunately tests are failing to run on Ubuntu 18.04 stack. there's an open PR #2451 to address the issue.

could you please test this change on that branch and if tests pass, then we can merge both these PRs.

what do you think?

Hey @wasifhossain, just wondering what would be your preferred way to do this:

  1. Point this PR at the upgrade-ubuntu-on-CI branch and pull the changes in from that?
  2. Create a new PR with these changes in from the upgrade-ubuntu-on-CI?
  3. Something else?

@schinery
Copy link
Author

schinery commented Oct 5, 2023

In case it is option 2: #2454

@bf4
Copy link
Member

bf4 commented Oct 5, 2023

Got one failing test on ruby 2.7 and rails 7.1

@schinery
Copy link
Author

schinery commented Oct 5, 2023

Looks like the tests passed but running Rubocop failed 😢

wrong number of arguments (given 2, expected 1)
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/psych-5.1.0/lib/psych.rb:322:in `safe_load'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rubocop-0.40.0/lib/rubocop/config_loader.rb:164:in `yaml_safe_load'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rubocop-0.40.0/lib/rubocop/config_loader.rb:149:in `load_yaml_configuration'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rubocop-0.40.0/lib/rubocop/config_loader.rb:35:in `load_file'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rubocop-0.40.0/lib/rubocop/config_store.rb:24:in `options_config='
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rubocop-0.40.0/lib/rubocop/cli.rb:64:in `act_on_options'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rubocop-0.40.0/lib/rubocop/cli.rb:25:in `run'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rubocop-0.40.0/lib/rubocop/rake_task.rb:49:in `run_cli'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rubocop-0.40.0/lib/rubocop/rake_task.rb:37:in `run_main_task'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rubocop-0.40.0/lib/rubocop/rake_task.rb:29:in `block (2 levels) in initialize'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/file_utils_ext.rb:58:in `verbose'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rubocop-0.40.0/lib/rubocop/rake_task.rb:27:in `block in initialize'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:243:in `block in invoke_prerequisites'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:241:in `each'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:241:in `invoke_prerequisites'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:218:in `block in invoke_with_call_chain'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:83:in `block in run'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:80:in `run'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/bin/rake:23:in `load'
/home/runner/work/active_model_serializers/active_model_serializers/vendor/bundle/ruby/2.7.0/bin/rake:23:in `<top (required)>'
/opt/hostedtoolcache/Ruby/2.7.8/x64/lib/ruby/gems/2.7.0/gems/bundler-2.4.20/lib/bundler/cli/exec.rb:58:in `load'
/opt/hostedtoolcache/Ruby/2.7.8/x64/lib/ruby/gems/2.7.0/gems/bundler-2.4.20/lib/bundler/cli/exec.rb:58:in `kernel_load'
/opt/hostedtoolcache/Ruby/2.7.8/x64/lib/ruby/gems/2.7.0/gems/bundler-2.4.20/lib/bundler/cli/exec.rb:23:in `run'
/opt/hostedtoolcache/Ruby/2.7.8/x64/lib/ruby/gems/2.7.0/gems/bundler-2.4.20/lib/bundler/cli.rb:492:in `exec'
/opt/hostedtoolcache/Ruby/2.7.8/x64/lib/ruby/gems/2.7.0/gems/bundler-2.4.20/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/opt/hostedtoolcache/Ruby/2.7.8/x64/lib/ruby/gems/2.7.0/gems/bundler-2.4.20/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/opt/hostedtoolcache/Ruby/2.7.8/x64/lib/ruby/gems/2.7.0/gems/bundler-2.4.20/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/opt/hostedtoolcache/Ruby/2.7.8/x64/lib/ruby/gems/2.7.0/gems/bundler-2.4.20/lib/bundler/cli.rb:34:in `dispatch'
/opt/hostedtoolcache/Ruby/2.7.8/x64/lib/ruby/gems/2.7.0/gems/bundler-2.4.20/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/opt/hostedtoolcache/Ruby/2.7.8/x64/lib/ruby/gems/2.7.0/gems/bundler-2.4.20/lib/bundler/cli.rb:28:in `start'
/opt/hostedtoolcache/Ruby/2.7.8/x64/lib/ruby/gems/2.7.0/gems/bundler-2.4.20/exe/bundle:37:in `block in <top (required)>'
/opt/hostedtoolcache/Ruby/2.7.8/x64/lib/ruby/gems/2.7.0/gems/bundler-2.4.20/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
/opt/hostedtoolcache/Ruby/2.7.8/x64/lib/ruby/gems/2.7.0/gems/bundler-2.4.20/exe/bundle:29:in `<top (required)>'
/opt/hostedtoolcache/Ruby/2.7.8/x64/bin/bundle:23:in `load'
/opt/hostedtoolcache/Ruby/2.7.8/x64/bin/bundle:23:in `<main>'
RuboCop failed!
Running RuboCop...
Error: Process completed with exit code 1.

@wasifhossain
Copy link
Member

I see. rails 7.1 is requiring psych this way

railties (7.1.0) -> irb
irb (1.8.1) -> rdoc
rdoc (6.5.0) -> psych (>= 4.0.0)

unfortunately rubocop 0.40 has issues with psych >= 4

and rdoc 6.3.3 is the last version that doesn't require psych.

so I could see the tests passing for Ruby 2.7 x Rails 7.1 with this change

diff --git a/Gemfile b/Gemfile
--- a/Gemfile
+++ b/Gemfile
@@ -88,6 +88,7 @@ end
 group :development, :test do
   if RUBY_VERSION < '3.0'
     gem 'rubocop', '~> 0.40.0', require: false
+    gem 'rdoc', '6.3.3', require: false
   else
     gem 'rubocop', '~> 1.56.0', require: false
     gem 'rubocop-minitest', '~> 0.31.0', require: false

@wasifhossain
Copy link
Member

@schinery feel free to make the change in Gemfile as shared above 🍀 and see if the test matrix is back to green 💯

@schinery
Copy link
Author

schinery commented Oct 5, 2023

@wasifhossain done 3f628ba

@schinery schinery requested a review from bf4 October 5, 2023 19:01
@schinery
Copy link
Author

schinery commented Oct 5, 2023

@wasifhossain @bf4 is this good to be merged?

@bf4 bf4 merged commit 5456a6d into rails-api:0-10-stable Oct 5, 2023
12 checks passed
@bf4
Copy link
Member

bf4 commented Oct 5, 2023

Great job!

@schinery schinery deleted the 0-10-stable branch October 5, 2023 20:15
@jgmontoya
Copy link

when could we expect this to be available in a new release in rubygems?

@bf4
Copy link
Member

bf4 commented Oct 5, 2023

@jgmontoya should be live now

@bf4
Copy link
Member

bf4 commented Oct 5, 2023

@schinery @mediafinger awesome job!

@mediafinger
Copy link

@bf4 I've just made a suggestion, @schinery did all the work :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants