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

Rails 5-1 #18076

Merged
merged 6 commits into from
Jun 19, 2019
Merged

Rails 5-1 #18076

merged 6 commits into from
Jun 19, 2019

Conversation

jrafanie
Copy link
Member

@jrafanie jrafanie commented Oct 10, 2018

Remaining items

  • Extract commits that can land on master for both rails 5.0 and 5.1 (this repo and others)
  • Fix julian to gregorian time issue
  • Fix deadlock/database lock test
  • Figure out what to do with rails 5-1-stable branch (5.1.7 was released)
  • Deploy to an appliance and look for failures/warnings
  • Verify debug and compile assets (enabled compile in test / monkey patched sprockets-rails)
  • Verify haml/haml_lint/erubi change (extracted to Use erubi instead of erubis, upgrade haml/haml_lint #18868)
  • Write up talk article with the most common rails 5.1 issues DONE, here

Other repos:

  • Test UI classic repo with this fork as the manageiq repo

jrafanie added a commit to jrafanie/manageiq that referenced this pull request Oct 10, 2018
For fun, autoload doesn't work in application.rb, so you have to either
do it in an config/initializers or require the file.

rails/rails@83b767ce
Rails issue: #25525

Extracted from ManageIQ#18076
jrafanie added a commit to jrafanie/manageiq that referenced this pull request Oct 10, 2018
Rails 5.1 removed support for specifying a string/symbol for the
middleware class.  You must now use a constant. For fun, autoload
doesn't work in application.rb, so you have to either
do it in an config/initializers or require the file.

rails/rails@83b767ce
Rails issue: #25525

Extracted from ManageIQ#18076
jrafanie added a commit to jrafanie/manageiq that referenced this pull request Oct 10, 2018
To avoid relying on the connection to type cast the binds, this method was
removed.  It was replaced with the underlying implementation of the
method, which is also used here to replace our usage.

rails/rails@5465508

Extracted from ManageIQ#18076
jrafanie added a commit to jrafanie/manageiq that referenced this pull request Oct 10, 2018
The force reload parameter was removed from assocations in:
rails/rails@09cac8c67af

It was previously deprecated but apparently we didn't fix that warning.

Extracted from ManageIQ#18076
jrafanie added a commit to jrafanie/manageiq that referenced this pull request Oct 10, 2018
The force reload parameter was removed from associations in:
rails/rails@09cac8c67af

It was previously deprecated but apparently we didn't fix that warning.

Extracted from ManageIQ#18076
jrafanie added a commit to jrafanie/manageiq that referenced this pull request Oct 10, 2018
According to 85c0224, we want the
cascading delete to avoid orphaned resources, so we'll remove the one
that doesn't explicitly say dependent => destroy.

Rails 5.1+ complains about has_many through associations if the through
association is not yet defined, and in this case, the second
host_storages association occurs after the through association, so rails
yells:

```
     ActiveRecord::HasManyThroughOrderError:
            Cannot have a has_many :through association 'Storage#hosts'
            which goes through 'Storage#host_storages' before the
            through association is defined.
```

Extracted from ManageIQ#18076
jrafanie added a commit to jrafanie/manageiq that referenced this pull request Oct 10, 2018
Rails 5.1+ complains about has_many through associations if the through
association is not yet defined.

Extracted from ManageIQ#18076
jrafanie added a commit to jrafanie/manageiq that referenced this pull request Oct 10, 2018
Rails ~5.1 changed arity from 1 to 0 in commit:
rails/rails@a553302

Extracted from ManageIQ#18076
jrafanie added a commit to jrafanie/manageiq that referenced this pull request Oct 10, 2018
Rails exists? with empty hash in ancestry 2.2.x was broken by rails PR: 28699

Fixed in ancestry 3.0.0:
stefankroes/ancestry@8c43482

Extracted from ManageIQ#18076
@miq-bot miq-bot added the wip label Oct 11, 2018
jrafanie added a commit to jrafanie/manageiq that referenced this pull request Oct 11, 2018
The force reload parameter was removed from associations in:
rails/rails@09cac8c67af

It was previously deprecated here:
rails/rails@6eae366

From that commit:

For collections:
@user.posts.reload   # Instead of @user.posts(true)

For singular associations:
@user.reload.profile # Instead of @user.profile(true)

Extracted from ManageIQ#18076
jrafanie added a commit to jrafanie/manageiq that referenced this pull request Oct 11, 2018
Note, the before_save was calling remove_invalid_resource on create
which didn't make sense because it was trying to find service_resources
with orphaned resources, which can't happen unless the service_template
itself has been saved.  Because of this, it makes sense to change this
to before_update instead of adding r.persisted? checks in the
remove_invalid_resource method.

The force reload parameter was removed from associations in:
rails/rails@09cac8c67af

It was previously deprecated here:
rails/rails@6eae366

From that commit:

For collections:
@user.posts.reload   # Instead of @user.posts(true)

For singular associations:
@user.reload.profile # Instead of @user.profile(true)

Extracted from ManageIQ#18076
@jrafanie jrafanie force-pushed the rails-5-1 branch 2 times, most recently from a5491e4 to 24028ae Compare October 11, 2018 22:01
@miq-bot miq-bot removed the wip label Jun 19, 2019
@jrafanie
Copy link
Member Author

jrafanie commented Jun 19, 2019

Copy link
Member

@bdunne bdunne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM

Copy link
Contributor

@himdel himdel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, ui-classic is stilll green.

I guess there's a chance we can still hit some params issues (ManageIQ/manageiq-ui-classic#5076), but currently not seeing any 👍

@himdel
Copy link
Contributor

himdel commented Jun 19, 2019

Oh, correction, specs are passing locally.
ManageIQ/manageiq-ui-classic#5676 is actually red now, restarting

@himdel
Copy link
Contributor

himdel commented Jun 19, 2019

Oh, @jrafanie can you rebase please?
I think the only reason ManageIQ/manageiq-ui-classic#5676 is failing travis is that this branch is based on master before the UI travis fix in #18892

@jrafanie
Copy link
Member Author

Oh, @jrafanie can you rebase please?
I think the only reason ManageIQ/manageiq-ui-classic#5676 is failing travis is that this branch is based on master before the UI travis fix in #18892

thanks, I thought I did before court this morning but I rebased the manageiq rails-5-1 branch... ETOOMANYREPOS... I just rebased ui-classi's rails-5-1 test branch... will post here when it is green

@jrafanie jrafanie closed this Jun 19, 2019
@jrafanie jrafanie reopened this Jun 19, 2019
@jrafanie
Copy link
Member Author

oops, comment is too close to close and comment

chrisarcand and others added 6 commits June 19, 2019 13:17
Rails 5.1 switched from julian to gregorian calendar so 1.month and
1.year changed in value.

Note, duration_of_report_step consumers should be 30.days and sometimes 1.month, ugh

rails/rails#27610 (comment)
rails/rails@2a5ae2b
Rails PR: #29971
5.1 added new methods for checking changes, specifically in before
callbacks.

Summary:
5.0           => 5.1
name_changed? => will_save_change_to_name? (before callback)
name_changed? => saved_change_to_name? (after callback)

A larger table of changes can be found here:
rails/rails#25337 (comment)

Use latest ancestry with changes for the changed change:
https://github.com/stefankroes/ancestry/pull/441/files
This is basically a revert of e83ca32.
@miq-bot
Copy link
Member

miq-bot commented Jun 19, 2019

Checked commits jrafanie/manageiq@c6329a1~...3b7b50d with ruby 2.3.3, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0
11 files checked, 2 offenses detected

app/models/chargeback.rb

lib/extensions/ar_migration.rb

@jrafanie
Copy link
Member Author

ok, the test rails 5.1 PR on ui classic is now green after rebasing and force pushing this PR.

jrafanie added a commit to jrafanie/manageiq-schema that referenced this pull request Jun 19, 2019
local developers to bundler up and get rails 5.2.  Unfortunately,
manageiq isn't yet on rails 5.2 so it can't process 5.2 versioned
migrations as seen at least once such as ManageIQ#379.

ManageIQ/manageiq#18076 is adding rails 5.1
support to manageiq, so let's change schema to 5.1 for now while we work
on 5.2 for manageiq.
jrafanie added a commit to jrafanie/manageiq-schema that referenced this pull request Jun 19, 2019
manageiq isn't yet on rails 5.2 so it can't process 5.2 versioned
migrations as seen at least once already, such as ManageIQ#379.

ManageIQ/manageiq#18076 is adding rails 5.1
support to manageiq, so let's change schema to 5.1 for now while we work
on 5.2 for manageiq.
jrafanie added a commit to jrafanie/manageiq-schema that referenced this pull request Jun 19, 2019
PR ManageIQ#365 added support for rails 5.1 and 5.2 to schema.  Unfortunately,
manageiq isn't yet on rails 5.2 so it can't process 5.2 versioned
migrations as seen in ManageIQ#379.

ManageIQ/manageiq#18076 is adding rails 5.1
support to manageiq, so let's change schema to 5.1 for now while we work
on 5.2 for manageiq.
@bdunne bdunne merged commit dbd6f04 into ManageIQ:master Jun 19, 2019
@bdunne bdunne added this to the Sprint 114 Ending Jun 24, 2019 milestone Jun 19, 2019
@bdunne bdunne self-assigned this Jun 19, 2019
jrafanie added a commit to jrafanie/manageiq-schema that referenced this pull request Jun 19, 2019
PR ManageIQ#365 added support for rails 5.1 and 5.2 to schema.  Unfortunately,
manageiq isn't yet on rails 5.2 so it can't process 5.2 versioned
migrations as seen in ManageIQ#379.

ManageIQ/manageiq#18076 is adding rails 5.1
support to manageiq, so let's change schema to 5.1 for now while we work
on 5.2 for manageiq.
@jrafanie jrafanie deleted the rails-5-1 branch June 19, 2019 20:39
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.

7 participants