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

[WIP] Rails71 #23225

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

[WIP] Rails71 #23225

wants to merge 12 commits into from

Conversation

jrafanie
Copy link
Member

@jrafanie jrafanie commented Oct 7, 2024

No description provided.

@jrafanie jrafanie requested a review from Fryguy as a code owner October 7, 2024 22:45
@jrafanie jrafanie changed the title [WIPRails71 [WIP] Rails71 Oct 7, 2024
@jrafanie jrafanie force-pushed the rails71 branch 2 times, most recently from 8888823 to 35c7f80 Compare October 7, 2024 22:53
@jrafanie jrafanie mentioned this pull request Oct 10, 2024
40 tasks
@jrafanie jrafanie force-pushed the rails71 branch 2 times, most recently from 95c915c to 728da06 Compare October 29, 2024 19:37
I don't think it fixes all the issues as you can call alias_attribute
anywhere up the ancestry tree and it's possible lazy loading is preventing
them from being loaded.

See:

https://www.github.com/rails/rails/issues/52820
https://www.github.com/rails/rails/pull/52842
(7.1 backport: https://www.github.com/rails/rails/pull/52844)

Looks like it's still an issue in some situations:
https://www.github.com/rails/rails/issues/50154
https://www.github.com/rails/rails/issues/51717
Fixes deprecation of this variety:

Foo model aliases `x`, but `x` is not an attribute. Starting in Rails 7.2, alias_attribute with non-attribute targets will raise. Use `alias_method :y, :x` or define the method manually.
I noticed deep_merge was behaving differently in tests and failing on 7.1.

Digging in, rails 7.0 was using the gem, 7.1 was using the activesupport module:

rails 7.1:

```
(byebug) {}.method(:deep_merge)
  #<Method: Hash(DeepMerge::DeepMergeHash)#deep_merge(source, options=...) /Users/joerafaniello/.gem/ruby/3.3.6/gems/deep_merge-1.2.2/lib/deep_merge/deep_merge_hash.rb:18>
```

rails 7.0:

```
(byebug) {}.method(:deep_merge)
  #<Method: Hash#deep_merge(other_hash, &block) /Users/joerafaniello/.gem/ruby/3.3.6/gems/activesupport-7.0.8.6/lib/active_support/core_ext/hash/deep_merge.rb:18>
```

Rails 7.1 changed the way their deep_merge is defined via a refactored module:
https://www.github.com/rails/rails/commit/43b980368a7628fac95cc4f673e0dfbcee77c10b

This was raised in:
https://www.github.com/rails/rails/issues/49457

Config gem fixed this in 5.0 and subsequently fixed another compatibility issue in 5.1
https://www.github.com/rubyconfig/config/commit/759c0fe271b4b90d534217a5b6e0653d0c94ee85
@miq-bot
Copy link
Member

miq-bot commented Nov 20, 2024

Checked commits jrafanie/manageiq@b3ed22e~...1b0c5a9 with ruby 3.1.5, rubocop 1.56.3, haml-lint 0.51.0, and yamllint
29 files checked, 35 offenses detected

Gemfile

app/models/automation_request.rb

  • ❗ - Line 2, Col 3 - Style/Alias - Use alias instead of alias_method in a class body.
  • ❗ - Line 3, Col 3 - Style/Alias - Use alias instead of alias_method in a class body.

app/models/automation_task.rb

  • ❗ - Line 2, Col 3 - Style/Alias - Use alias instead of alias_method in a class body.
  • ❗ - Line 3, Col 3 - Style/Alias - Use alias instead of alias_method in a class body.

app/models/manageiq/providers/embedded_automation_manager/authentication.rb

  • ❗ - Line 7, Col 3 - Style/Alias - Use alias instead of alias_method in a class body.
  • ❗ - Line 8, Col 3 - Style/Alias - Use alias instead of alias_method in a class body.

app/models/miq_provision.rb

app/models/miq_provision_request.rb

  • ❗ - Line 5, Col 3 - Style/Alias - Use alias instead of alias_method in a class body.
  • ❗ - Line 6, Col 3 - Style/Alias - Use alias instead of alias_method in a class body.
  • ❗ - Line 7, Col 3 - Style/Alias - Use alias instead of alias_method in a class body.
  • ❗ - Line 8, Col 3 - Style/Alias - Use alias instead of alias_method in a class body.

app/models/persistent_volume.rb

  • ❗ - Line 8, Col 3 - Style/Alias - Use alias instead of alias_method in a class body.
  • ❗ - Line 9, Col 3 - Style/Alias - Use alias instead of alias_method in a class body.

app/models/physical_switch.rb

app/models/resource_group.rb

app/models/service.rb

app/models/service_template_provision_request.rb

app/models/vm_migrate_task.rb

  • ❗ - Line 2, Col 3 - Style/Alias - Use alias instead of alias_method in a class body.
  • ❗ - Line 3, Col 3 - Style/Alias - Use alias instead of alias_method in a class body.

app/models/vm_reconfigure_task.rb

  • ❗ - Line 2, Col 3 - Style/Alias - Use alias instead of alias_method in a class body.
  • ❗ - Line 3, Col 3 - Style/Alias - Use alias instead of alias_method in a class body.

app/models/vm_retire_task.rb

  • ❗ - Line 2, Col 3 - Style/Alias - Use alias instead of alias_method in a class body.
  • ❗ - Line 3, Col 3 - Style/Alias - Use alias instead of alias_method in a class body.

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.

2 participants