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

Fixes #35432 - Use Rails 6.1 defaults #9382

Closed
wants to merge 7 commits into from

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented Aug 25, 2022

Rails has introduced config.load_defaults to load the defaults of a certain version. Currently this is not called at all, which means using Rails < 5.0 defaults. Changing this brings Foreman more in line with the Rails recommended defaults.

Right now this is a draft since I'm a bit uncertain of all the implications.

@theforeman-bot
Copy link
Member

Issues: #35432

@ekohl
Copy link
Member Author

ekohl commented Aug 25, 2022

Quite certain test failures are related. Will need to dive into them.

@ekohl
Copy link
Member Author

ekohl commented Aug 25, 2022

I've split it into multiple commits so I can dive into it and see where things break. Currently running tests on these.

app/models/host/base.rb Outdated Show resolved Hide resolved
In Ruby 3.0 keyword arguments are handled separate from positional
arguments[1]. This uses kwargs and passes it along.

[1]: https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/
Rails has introduced config.load_defaults[1] to load the defaults of a
certain version. Currently this is not called at all, which means using
Rails < 5.0 defaults. Changing this brings Foreman more in line with the
Rails recommended defaults.

[1]: https://guides.rubyonrails.org/configuring.html#versioned-default-values
Rails has introduced config.load_defaults[1] to load the defaults of a
certain version. Currently this is not called at all, which means using
Rails < 5.0 defaults. Changing this brings Foreman more in line with the
Rails recommended defaults.

[1]: https://guides.rubyonrails.org/configuring.html#versioned-default-values
@ekohl
Copy link
Member Author

ekohl commented Sep 5, 2022

Rebased on #9332 now. Still need to dive into the failures.

@ekohl
Copy link
Member Author

ekohl commented Sep 9, 2022

For encryption I think it the requirements on the key may have been tightened. The key looks to be md5 (they are always 32 characters):

def stub_encryption_key(model, key = '25d224dd383e92a7e0c82b8bf7c985e8')

Perhaps updating this to a stronger key is sufficient.

As for the interface validation errors, I don't know. I wish the errors were less vague.

@ekohl ekohl mentioned this pull request Sep 28, 2022
@theforeman-bot
Copy link
Member

Thank you for your contribution, @ekohl! This PR has been inactive for 3 months, closing for now.
Feel free to reopen when you return to it. This is an automated process.

@theforeman-bot
Copy link
Member

Thank you for your contribution, @ekohl! This PR has been inactive for 3 months, closing for now.
Feel free to reopen when you return to it. This is an automated process.

@ekohl ekohl deleted the 35432-use-rails-6.1-defaults branch July 7, 2023 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants