Skip to content

Upgrade to Rails 6#6522

Closed
oriolgual wants to merge 8 commits intodevelopfrom
chore/upgrade-ruby
Closed

Upgrade to Rails 6#6522
oriolgual wants to merge 8 commits intodevelopfrom
chore/upgrade-ruby

Conversation

@oriolgual
Copy link
Copy Markdown
Contributor

🎩 What? Why?

Upgrade to the latest Ruby version available. Other than using the latest stable version this is also to try to see if all the segmentation faults we get in GitHub Actions are solved using this version.

@tramuntanal
Copy link
Copy Markdown
Contributor

We're still having segmentation faults with 2.7.1

@tramuntanal
Copy link
Copy Markdown
Contributor

I've just re-run 2 cancelled and 1 failing job

@tramuntanal
Copy link
Copy Markdown
Contributor

meetings tests succeeded but "proposals (system public)" crashed with Segmentation Fault again. "Proposals (system admin)" hanged again

I've run the tests locally twice and I'm not having the seg fault. I'll run the whole proposals test suite locally. I'm on Ubuntu 18.04.

@tramuntanal
Copy link
Copy Markdown
Contributor

The problem was probably introduced after merging #6513 (749cba3) into develop. It's when we started to have this segmentation faults.

@mrcasals
Copy link
Copy Markdown
Contributor

@tramuntanal I ran bundle update rails but I see that PR updates other gems. Specially, concurrent-ruby looks suspicious... Maybe downgrading its version would help?

@tramuntanal
Copy link
Copy Markdown
Contributor

Yes it's an sprokets dependency. I'll give it a try

@mrcasals
Copy link
Copy Markdown
Contributor

I reran one job because it got hanging (Proposals system admin ran for 6h).

@tramuntanal did you encounter any segfaults after downgrading the concurrent_ruby version?

@tramuntanal
Copy link
Copy Markdown
Contributor

tramuntanal commented Sep 18, 2020

Hi @mrcasals yes I also re-ran the workflow twice yesterday because it was hanging forever... Now it finished with a segmentation fault again, but now in actionview-5.2.4.4/lib/action_view/path_set.rbL83:

/home/runner/work/decidim/decidim/vendor/bundle/ruby/2.7.0/gems/actionview-5.2.4.4/lib/action_view/path_set.rb:83: [BUG] Segmentation fault at 0x0000000000000088
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0204 p:0052 s:1327 e:001325 BLOCK  /home/runner/work/decidim/decidim/vendor/bundle/ruby/2.7.0/gems/actionview-5.2.4.4/lib/action_view/path_set.rb:83 [FINISH]
c:0203 p:---- s:1321 e:001320 CFUNC  :each
c:0202 p:0007 s:1317 e:001316 BLOCK  /home/runner/work/decidim/decidim/vendor/bundle/ruby/2.7.0/gems/actionview-5.2.4.4/lib/action_view/path_set.rb:77 [FINISH]
c:0201 p:---- s:1313 e:001312 CFUNC  :each
c:0200 p:0026 s:1309 e:001308 METHOD /home/runner/work/decidim/decidim/vendor/bundle/ruby/2.7.0/gems/actionview-5.2.4.4/lib/action_view/path_set.rb:76
c:0199 p:0015 s:1301 e:001300 METHOD /home/runner/work/decidim/decidim/vendor/bundle/ruby/2.7.0/gems/actionview-5.2.4.4/lib/action_view/path_set.rb:56
c:0198 p:0007 s:1294 e:001293 METHOD /home/runner/work/decidim/decidim/vendor/bundle/ruby/2.7.0/gems/actionview-5.2.4.4/lib/action_view/path_set.rb:48
...

maybe we can rollback #6513 or push the upgrade to rails 6 which will require some work and delay the release of 0.23 (any other idea?). We'll comment it internally with @decidim/product

@oriolgual
Copy link
Copy Markdown
Contributor Author

oriolgual commented Sep 18, 2020

By the way, I've been trying to upgrade to Rails 6 just to see what happens, and bundler doesn't finish the Resolving dependencies part. The command was: bundle update rails jquery-tmpl-rails ransack web-console system_test_html_screenshots --jobs 4 --redownload --verbose

@tramuntanal
Copy link
Copy Markdown
Contributor

@oriolgual sprockets is fixed to v 3... by decidim-core but I think that rails 6 requires sprockets 4.

Yesterday I tried to upgrade to sprockets 4 (without Rails) but it requires some refactor to do in Decidim.
I'll try to tackle the upgrade to Rails 6 together with sprockets 4 but probably it's not going to be a quick thing to do.

@oriolgual
Copy link
Copy Markdown
Contributor Author

I managed to update all the dependencies @tramuntanal!

@oriolgual
Copy link
Copy Markdown
Contributor Author

@mrcasals
Copy link
Copy Markdown
Contributor

Unrelated, but has a strategy to capture deprecation warnings that we usually don't realize we have, and might help on upgrading:

https://github.blog/2020-08-25-upgrading-github-to-ruby-2-7/

@tramuntanal
Copy link
Copy Markdown
Contributor

tests are failing due to a previous error in "create test app" step:

       rails  webpacker:install
rails aborted!
Don't know how to build task 'webpacker:install' (See the list of available tasks with `rails --tasks`)
/home/runner/work/decidim/decidim/vendor/bundle/ruby/2.7.0/gems/railties-6.0.3.3/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
/home/runner/work/decidim/decidim/vendor/bundle/ruby/2.7.0/gems/railties-6.0.3.3/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/home/runner/work/decidim/decidim/vendor/bundle/ruby/2.7.0/gems/railties-6.0.3.3/lib/rails/command.rb:48:in `invoke'
/home/runner/work/decidim/decidim/vendor/bundle/ruby/2.7.0/gems/railties-6.0.3.3/lib/rails/commands.rb:18:in `<main>'
...

I've scheduled some time today to also push on this PR

@tramuntanal
Copy link
Copy Markdown
Contributor

While working on this PR we've also been trying to only update concurrent-ruby in #6524 and it worked. But #6524 is in wip.

We're going to see if #6524 can be merged, and if not, we'll create a new PR with only the concurrent-ruby part that was missing in decidim-generators and see

@tramuntanal
Copy link
Copy Markdown
Contributor

tramuntanal commented Sep 21, 2020

It turns out that, as Segmentation Faults airse randomly, all tests succeeded by casuality. After merging #6524 into develop tests for the develop branch are still failing due to segmentation fault (see sortitions tests for example):

Randomized with seed 20612
/home/runner/work/decidim/decidim/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/http_utils.rb:74: [BUG] Segmentation fault at 0x0000000000000000
ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0073 p:---- s:0556 e:000555 CFUNC  :find
c:0072 p:0007 s:0552 e:000551 BLOCK  /home/runner/work/decidim/decidim/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/http_utils.rb:74 [FINISH]
c:0071 p:---- s:0546 e:000545 CFUNC  :each
c:0070 p:0119 s:0542 e:000541 METHOD /home/runner/work/decidim/decidim/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/http_utils.rb:73
c:0069 p:0012 s:0534 e:000533 METHOD /home/runner/work/decidim/decidim/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/http_utils.rb:90
c:0068 p:0035 s:0527 E:000fa0 BLOCK  /home/runner/work/decidim/decidim/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/resolve.rb:127 [FINISH]
c:0067 p:---- s:0520 e:000519 CFUNC  :each
c:0066 p:0046 s:0516 E:0023a8 METHOD /home/runner/work/decidim/decidim/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/resolve.rb:124
c:0065 p:0045 s:0507 e:000506 METHOD /home/runner/work/decidim/decidim/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/resolve.rb:108

@tramuntanal tramuntanal changed the title Upgrade to Ruby 2.7.1 Upgrade to Rails 6 Nov 3, 2020
@oriolgual
Copy link
Copy Markdown
Contributor Author

Closing since this was more of a test.

@oriolgual oriolgual closed this Nov 3, 2020
@tramuntanal tramuntanal deleted the chore/upgrade-ruby branch November 4, 2020 07:37
@mrcasals
Copy link
Copy Markdown
Contributor

mrcasals commented Nov 4, 2020

Oh, no! @tramuntanal are you planning on working on this? It would be awesome if we could upgrade to Rails 6, since Rails 6.1 is about to be released!

@tramuntanal
Copy link
Copy Markdown
Contributor

tramuntanal commented Nov 4, 2020

@mrcasals We tried to push this PR a little bit more but got stuck with webpack configuration. There's no plan to keep working on this right now.

@mrcasals
Copy link
Copy Markdown
Contributor

mrcasals commented Nov 4, 2020

@tramuntanal isn't the webpacker configuration optional? Until we upgrade to Rails 6.x we'll keep having a lot of deprecation warnings, because the Rails core team doesn't seem to be fixing those warnings for 5.x series:

rails/rails#38426

@tramuntanal
Copy link
Copy Markdown
Contributor

tramuntanal commented Nov 5, 2020

Yes @mrcasals , webpacker is optional, but we got stuck either with or without webpacker. Maybe you can take restore this branch and check? we don't have time to assign to this task now, but I agree with you that we need to go to Rails 6 the sooner the better

@mrcasals mrcasals restored the chore/upgrade-ruby branch November 5, 2020 08:13
@mrcasals
Copy link
Copy Markdown
Contributor

mrcasals commented Nov 5, 2020

I've restored the branch so we/someone can keep the work and dig around it. Can you describe the issues you were having @tramuntanal? 😄

@mrcasals mrcasals mentioned this pull request Nov 5, 2020
12 tasks
@alecslupu alecslupu mentioned this pull request Jan 11, 2021
12 tasks
@andreslucena andreslucena mentioned this pull request Feb 5, 2021
@andreslucena andreslucena deleted the chore/upgrade-ruby branch September 28, 2021 09:35
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

Successfully merging this pull request may close these issues.

3 participants