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 6 #3439

Closed
aiomaster opened this issue Sep 13, 2019 · 15 comments
Closed

Rails 6 #3439

aiomaster opened this issue Sep 13, 2019 · 15 comments

Comments

@aiomaster
Copy link
Contributor

Hi,

do you see some show stoppers regarding rails 6 upgrade?
Is there interest?
Was some work already done somewhere?

Thanks!

@angarc
Copy link

angarc commented Sep 15, 2019

Also curious about this.

@joebutler2
Copy link
Contributor

joebutler2 commented Sep 19, 2019

I'm attempting to use it on a greenfield Rails 6 app, but there is a dependency conflict with ActionPack.

Bundler could not find compatible versions for gem "actionpack":
  In Gemfile:
    rails (~> 6.0) was resolved to 6.0.0, which depends on
      actionpack (= 6.0.0)

    refinerycms was resolved to 4.0.2, which depends on
      refinerycms-core (= 4.0.2) was resolved to 4.0.2, which depends on
        actionpack (>= 5.2.0, < 6)

Hopefully this is a trivial fix and that we can update refinerycms-core to work with ActionPack 6.

I'll update this issue as I learn more.

@joebutler2
Copy link
Contributor

Here's the branch I created: https://github.com/joebutler2/refinerycms/pull/new/rails-6-support

Currently there are 15 failing tests. I'll look into it tomorrow. https://gist.github.com/joebutler2/54c455633ae5fb9288fc0ec8e0a25c00

@joebutler2
Copy link
Contributor

I'm requesting help on this now. Progress has been made but there are a number of gems we had to upgrade in tandem.

Right now, I'm working through a failing test that's related to how image uploads work in Selenium. The feature works fine when manually testing it in the generated dummy app.

Here is a screenshot of the error occurring in Selenium (a la save_and_open_screenshot).

capybara-201909201605507514458208

Here is the stacktrace from test failure (note the line numbers will be off since I adjusted the formatting and added debug code locally)

Shared Example Group: "uploads images" called from ./images/spec/features/refinery/admin/images_spec.rb:16
     # ./images/spec/support/shared_examples/image_uploader.rb:29:in `block (3 levels) in <top (required)>'
     # ./core/spec/support/database_cleaner.rb:18:in `block (2 levels) in <top (required)>'

When I tested it manually I used the same image that is used in the automated test. spec/fixtures/image-with-dashes.jpg

Here's the branch, if anyone has the time to help out (or pair program!) it would be appreciated.

https://github.com/joebutler2/refinerycms/commits/rails-6-support

@anitagraham
Copy link
Contributor

anitagraham commented Sep 21, 2019 via email

@anitagraham
Copy link
Contributor

@joebutler2
I downloaded your branch, did a bundle update and ran the images tests which all passed.
This was still on Rails 5.2.3. Trying to go to Rails 6 triggered lots of dependency issues.

In the meantime I added a line to the test which failed for you:

#images/spec/support/shared_examples/image_uploader.rb
      fill_in  'image_image_title', with: 'Image With Dashes'
      fill_in  'image_image_alt', with: "Alt description for image"
      puts "----- Image path is #{image_path}"
      click_button ::I18n.t('save', scope: 'refinery.admin.form_actions')
    end

I guess you could check that ::Refinery::Images.whitelisted_mime_types has the expected mime types, as that is the other half of the validation.

@anitagraham
Copy link
Contributor

anitagraham commented Sep 21, 2019

I've submitted a PR (#3440) to refinery/refinerycms which incidentally gives a more specific message when an image with an invalid mime-type is uploaded.

This might be helpful finding the source of the test failure.

btw: what was the actual error. There isn't enough stacktrace there to see the error message.

The screenshot shows the error you would expect to get if you had tried to upload a file that wasn't an image file. So, the screenshot isn't of a failing test.

@joebutler2
Copy link
Contributor

@anitagraham thank you for helping out. It turns out most of those errors were due to my local environment. This is now an open pull request #3441. As of right now there is only one failure in CI, and that's in the pages extension when running mysql in ruby 2.4.2 (link to failed build). The other errors in the build are the same ones we are currently seeing in master.

Here is the stack trace for that failure:

  1) Pages new/create allows to easily create nested page
1405     Failure/Error: find("a[href='#{refinery.new_admin_page_path(:parent_id => parent_page.id)}']").click
1406     
1407     Capybara::ElementNotFound:
1408       Unable to find css "a[href='/refinery/pages/new?parent_id=15']"
1409     # ./pages/spec/features/refinery/admin/pages_spec.rb:199:in `block (3 levels) in <module:Admin>'
1410     # -e:1:in `<main>'

As for handling the dependencies, the branch featured in that PR should contain most of the dependency updates.

My local environment mirrors what heroku currently supports (some specific to me). Ruby 2.5.5 and postgresql 11.5, and Rails 6.0.

We also need to update the .gemspec file in refinerycms-i18n since that is blocking us from Rails 6 as well. Here is an open PR for that repo. I'll take a look into why that build failed tomorrow.

Once we fix both of these failed builds, refinery should be good to go for Rails 6 apps. Of course, I'll report and help fix any bugs that arise.

If anyone wants to help with either one of those pull requests, I would love to collaborate and possibly do remote pair programming (via Tuple or Floobits). /cc @aiomaster @angarc

@joebutler2
Copy link
Contributor

I re-triggered the build for PR #3441 and that failing test passed. So from my point of view, that branch should be good to merge into master, although my preference is to fix master ASAP.

I'm dedicating some time right now to look into the failure in master.

Also, I still need to figure out why the build failed for updating refinerycms-i18n to support Rails 6 (pull request link).

Hopefully, we can resolve these broken builds in the next couple of days, then refinery will support Rails 6!

@joebutler2
Copy link
Contributor

Quick update:

The updates to refinerycms-i18n for Rails 6 support are ready to be merged in. refinery/refinerycms-i18n#80

If we could get someone to merge that in and release a patch version of the gem (@bricesanchez @aiomaster), then we can wrap up the pull request for refinerycms itself #3441.

I'm also hopeful that updating the mobility gem in refinerycms-i18n will also fix the build in master. See this comment for details.

Thanks everyone who has helped out! Hopefully we can wrap this up in the coming days!

@joebutler2
Copy link
Contributor

I compiled the updated version of refinerycms-i18n locally and now I'm receiving dependency conflicts in bundler. https://gist.github.com/joebutler2/d78c3ed245652663032c7ede84075ef8

I'm hoping to get them resolved quickly!

@joebutler2
Copy link
Contributor

I was able to resolve the refinerycms-i18n conflict locally (thanks to geminabox!).

Now once refinery/refinerycms-i18n#80 is merged and the patch version of the gem is released we will be very close to having RefineryCMS support Rails 6!

Also, I updated this gist to the remaining dependency conflicts, hopefully, we can wrap it up tomorrow!
https://gist.github.com/joebutler2/d78c3ed245652663032c7ede84075ef8

@joebutler2
Copy link
Contributor

Was able to resolve all of the dependency conflicts locally (with a custom rubygem server). Now there is a loading issue with refinerycms-core.

The PR for refinerycms-i18n was accepted and merged in by Philip (thanks parndt!) Waiting for that to be released. Also had to update the decorators gem as well (See this PR for details).

I'll keep working on the pull request while figuring the rest out. I'll stop updating this issue going forward, if you want to see notifications / progress watch #3441.

@parndt
Copy link
Member

parndt commented Oct 15, 2019

Also see #3446

@parndt
Copy link
Member

parndt commented Oct 19, 2019

Fixed by #3446

@parndt parndt closed this as completed Oct 19, 2019
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

No branches or pull requests

5 participants