foreman icon indicating copy to clipboard operation
foreman copied to clipboard

Fixes #35300 - Pass keyword arguments correctly

Open ekohl opened this issue 3 years ago • 6 comments

In Ruby 3.0 keyword arguments are handled separate from positional arguments. This uses kwargs and passes it along.

It is likely very incomplete, but this is what I found easily when I started Rails 7.0 on Ruby 3.1 and clicked through the UI. I believe these changes are all Ruby 2.7 compatible.

ekohl avatar Jul 31 '22 13:07 ekohl

Issues: #35300

theforeman-bot avatar Jul 31 '22 13:07 theforeman-bot

Looks like we'll need to raise the Rubocop target version to Ruby 2.7 for this.

ekohl avatar Jul 31 '22 14:07 ekohl

This needs to be updated: https://github.com/theforeman/foreman/blob/f28bc34cc749886b80f8b0f909438118368c6040/bundler.d/test.rb#L24

But first we need to release a version that has 2.7 as the target, which is set in https://github.com/theforeman/theforeman-rubocop/blob/main/rules/ruby_target.yml.

ekohl avatar Aug 02 '22 11:08 ekohl

@ekohl is this ready for review or still waiting for Ruby 2.7 PR in theforeman-rubocop?

stejskalleos avatar Aug 08 '22 12:08 stejskalleos

This needs some work. This was passing on Ruby 3.1 but it fails on Ruby 2.7. Setting back to draft.

ekohl avatar Aug 08 '22 13:08 ekohl

At least this passes RuboCop now without an update. Let's see if the other tests are also green. Please review carefully.

ekohl avatar Aug 08 '22 16:08 ekohl

All green. Please review again.

ekohl avatar Aug 12 '22 10:08 ekohl

however on 3.0.4 I'm not able to run rails, startup is failing with following error:

Yes, #9230 is needed for that. While the tests don't pass, you can use those changes to at least get the non-graphql parts to start up again.

ekohl avatar Sep 07 '22 08:09 ekohl

Thanks @ekohl !

stejskalleos avatar Sep 12 '22 10:09 stejskalleos