Project

General

Profile

Actions

Feature #29914

closed

Migrate to Rails 6.1 with Zeitwerk autoloading

Added by Go MAEDA about 6 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Rails support
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed

Files

32886-wip-r19467.patch (1.79 KB) 32886-wip-r19467.patch Go MAEDA, 2020-01-27 05:30
0010-Fix-ArgumentError-wrong-number-of-arguments-given-1-.patch (1.03 KB) 0010-Fix-ArgumentError-wrong-number-of-arguments-given-1-.patch Marius BĂLTEANU, 2021-03-30 18:41
0009-Fix-ArgumentError-wrong-number-of-arguments-given-1-.patch (1.86 KB) 0009-Fix-ArgumentError-wrong-number-of-arguments-given-1-.patch Marius BĂLTEANU, 2021-03-30 18:41
0008-Rails-6.1-add-header-present-to-csv-tests-29914-3292.patch (10.7 KB) 0008-Rails-6.1-add-header-present-to-csv-tests-29914-3292.patch Marius BĂLTEANU, 2021-03-30 18:41
0007-Fix-ActionView-Template-Error-wrong-number-of-argume.patch (940 Bytes) 0007-Fix-ActionView-Template-Error-wrong-number-of-argume.patch Marius BĂLTEANU, 2021-03-30 18:41
0006-Fix-DEPRECATION-WARNING-Passing-a-path-to-relative-t.patch (772 Bytes) 0006-Fix-DEPRECATION-WARNING-Passing-a-path-to-relative-t.patch Marius BĂLTEANU, 2021-03-30 18:41
0005-Fix-ActiveRecord-StaleObjectError-Attempted-to-updat.patch (3.78 KB) 0005-Fix-ActiveRecord-StaleObjectError-Attempted-to-updat.patch Marius BĂLTEANU, 2021-03-30 18:41
0004-Fix-Subclasses-must-implement-a-find_templates-name-.patch (1.13 KB) 0004-Fix-Subclasses-must-implement-a-find_templates-name-.patch Marius BĂLTEANU, 2021-03-30 18:41
0003-Fix-sending-mail-with-DeliveryJob-is-deprecated-2991.patch (3.77 KB) 0003-Fix-sending-mail-with-DeliveryJob-is-deprecated-2991.patch Marius BĂLTEANU, 2021-03-30 18:41
0002-Fix-undefined-method-for-nil-NilClass-in-Rails-6.1-2.patch (922 Bytes) 0002-Fix-undefined-method-for-nil-NilClass-in-Rails-6.1-2.patch Marius BĂLTEANU, 2021-03-30 18:41
0001-Fix-DEPRECATION-WARNING-Uniqueness-validator-will-no.patch (10.6 KB) 0001-Fix-DEPRECATION-WARNING-Uniqueness-validator-will-no.patch Marius BĂLTEANU, 2021-03-30 18:41
0018-Rails-6.1-fix-set-roleids-29914-32935.patch (666 Bytes) 0018-Rails-6.1-fix-set-roleids-29914-32935.patch Marius BĂLTEANU, 2021-03-30 18:42
0019-Update-activerecord-sqlserver-adapter-to-6.0.1.patch (987 Bytes) 0019-Update-activerecord-sqlserver-adapter-to-6.0.1.patch Marius BĂLTEANU, 2021-03-30 18:42
0017-Fix-DEPRECATION-WARNING-Calling-to-an-ActiveModel-Er.patch (835 Bytes) 0017-Fix-DEPRECATION-WARNING-Calling-to-an-ActiveModel-Er.patch Marius BĂLTEANU, 2021-03-30 18:42
0015-Fix-detach-attachments-when-a-conflict-occurs-29914-.patch (896 Bytes) 0015-Fix-detach-attachments-when-a-conflict-occurs-29914-.patch Marius BĂLTEANU, 2021-03-30 18:42
0014-Disable-TestAdapter-on-IntegrationTest-29914-32936.patch (741 Bytes) 0014-Disable-TestAdapter-on-IntegrationTest-29914-32936.patch Marius BĂLTEANU, 2021-03-30 18:42
0016-Fix-DEPRECATION-WARNING-Rendering-actions-with-.-in-.patch (1.8 KB) 0016-Fix-DEPRECATION-WARNING-Rendering-actions-with-.-in-.patch Marius BĂLTEANU, 2021-03-30 18:42
0013-Remove-filename_for_content_disposition-for-MS-brows.patch (2.9 KB) 0013-Remove-filename_for_content_disposition-for-MS-brows.patch Marius BĂLTEANU, 2021-03-30 18:42
0011-Use-media_type-to-get-the-MIME-type-of-the-request-2.patch (1005 Bytes) 0011-Use-media_type-to-get-the-MIME-type-of-the-request-2.patch Marius BĂLTEANU, 2021-03-30 18:42
0012-Add-filename-header-29914-32913.patch (3.27 KB) 0012-Add-filename-header-29914-32913.patch Marius BĂLTEANU, 2021-03-30 18:42
0001-Update-TargetRailsVersion-to-6.1.patch (570 Bytes) 0001-Update-TargetRailsVersion-to-6.1.patch Marius BĂLTEANU, 2021-04-02 22:49

Related issues

Related to Redmine - Feature #31128: Drop Ruby < 2.5 supportClosedGo MAEDA

Actions
Related to Redmine - Defect #32885: Rails 6: DEPRECATION WARNING: Single arity template handlers are deprecatedClosed

Actions
Related to Redmine - Patch #32886: Rails 6: Use #media_type instead of #content_type to test the MIME type of a responseClosedGo MAEDA

Actions
Related to Redmine - Patch #32887: Rails 6: Use "render template:" instead of "render file:" in app/views/layouts/admin.html.erbClosedGo MAEDA

Actions
Related to Redmine - Defect #32897: Rails 6: Pass `case_sensitive: true` option explicitly to the uniqueness validatorClosedGo MAEDA

Actions
Related to Redmine - Defect #32908: Rails 6: Sending mail with DeliveryJob is deprecatedClosedGo MAEDA

Actions
Related to Redmine - Patch #32909: Replace pluck().first with pick()ClosedGo MAEDA

Actions
Related to Redmine - Defect #32910: Rails 6: add lookup_context to hook_test.rbClosed

Actions
Related to Redmine - Patch #32911: Rails 6: Fix deprecation warning "Class level methods will no longer inherit scoping"ClosedGo MAEDA

Actions
Related to Redmine - Defect #32912: Rails 6: update no longer bypass optimistic lockingClosedGo MAEDA

Actions
Related to Redmine - Defect #32913: Rails 6: add filename headerClosedGo MAEDA

Actions
Related to Redmine - Defect #32914: Rails 6: remove #filename_for_content_disposition for MS browsersClosedGo MAEDA

Actions
Related to Redmine - Patch #32922: Reload detached attachmentsClosedGo MAEDA

Actions
Related to Redmine - Defect #32923: Rails 6: detach attachments when a conflict occursClosedGo MAEDA

Actions
Related to Redmine - Defect #32921: Rails 6: add header=present to csv testsClosedGo MAEDA

Actions
Related to Redmine - Defect #32935: Rails 6: fix set role_idsClosedGo MAEDA

Actions
Related to Redmine - Defect #32936: Rails 6: disable AJ test adapter for integration testsClosedGo MAEDA

Actions
Related to Redmine - Patch #32937: test_revisions_latin_1_identifier should be skipped on WindowsClosedGo MAEDA

Actions
Related to Redmine - Feature #32938: Rails 6: Zeitwerk supportClosedMarius BĂLTEANU

Actions
Related to Redmine - Defect #32939: Rails 6: fix plugin migrationsClosedGo MAEDA

Actions
Related to Redmine - Defect #34980: Fix "undefined method `represent_boolean_as_integer=' for nil:NilClass" in Rails 6.1ClosedGo MAEDA

Actions
Related to Redmine - Defect #34985: Rails 6.1 replace ActiveModel::Errors #<< with #addClosedGo MAEDA

Actions
Related to Redmine - Defect #34984: Rails 6.1 Rendering actions with '.' in the name is deprecatedClosedGo MAEDA

Actions
Related to Redmine - Feature #34987: Rails 6.1 destroy asyncNew

Actions
Related to Redmine - Defect #35002: Fix MS SQL on Rails 6.1ClosedMarius BĂLTEANU

Actions
Related to Redmine - Defect #35003: Update Rails UJSClosedGo MAEDA

Actions
Related to Redmine - Defect #35004: DEPRECATION WARNING during startupClosed

Actions
Related to Redmine - Defect #35005: RuntimeError "Couldn't find Active Storage configuration" is raised at startupClosedGo MAEDA

Actions
Related to Redmine - Patch #35081: Update config/environments/*.rb for Rails 6.1ClosedGo MAEDA

Actions
Related to Redmine - Patch #35466: Rename test/fixtures/configuration/*.yml.example to test/fixtures/files/configuration/*.ymlClosedGo MAEDA

Actions
Related to Redmine - Defect #36218: Plugin assets are not copied correctly in trunk r21289ClosedMarius BĂLTEANU

Actions
Related to Redmine - Defect #36273: Modifying the source code of a plugin does not reload it after r21295ClosedGo MAEDA

Actions
Blocked by Redmine - Patch #31919: Update roadie-rails gem (~> 2.1.0)ClosedGo MAEDA

Actions
Blocks Redmine - Feature #34992: Ruby 3.0 supportClosedGo MAEDA

Actions
Actions #1

Updated by Go MAEDA about 6 years ago

  • Related to Defect #27780: Case-insensitive matching fails for Unicode filenames when referring to attachments in text formatting added
Actions #2

Updated by Marius BĂLTEANU over 5 years ago

Actions #3

Updated by Go MAEDA over 5 years ago

  • Target version changed from Unplanned backlogs to 5.0.0
Actions #4

Updated by Enziin System over 5 years ago

Rails 6?

Please carefully, because Rails 6 drop sprockets assets and use Webpack default.

In the wonderland, Redmine converts to the frontend with Angular/Reactjs/Vue, it's my dream.

Actions #5

Updated by Go MAEDA over 5 years ago

  • Blocked by Patch #31919: Update roadie-rails gem (~> 2.1.0) added
Actions #7

Updated by Tigergm Wu almost 5 years ago

Yes. I hope so.
Enziin System wrote:

Rails 6?

Please carefully, because Rails 6 drop sprockets assets and use Webpack default.

In the wonderland, Redmine converts to the frontend with Angular/Reactjs/Vue, it's my dream.

Actions #8

Updated by Go MAEDA almost 5 years ago

  • Related to Defect #32885: Rails 6: DEPRECATION WARNING: Single arity template handlers are deprecated added
Actions #9

Updated by Go MAEDA almost 5 years ago

  • Related to Patch #32886: Rails 6: Use #media_type instead of #content_type to test the MIME type of a response added
Actions #10

Updated by Go MAEDA almost 5 years ago

  • Related to Patch #32887: Rails 6: Use "render template:" instead of "render file:" in app/views/layouts/admin.html.erb added
Actions #11

Updated by Go MAEDA almost 5 years ago

I started work on this issue.

Here is the very first version of the work-in-progress patch but there are still many errors.

4936 runs, 22346 assertions, 34 failures, 42 errors, 7 skips

Please feel free to update the patch. Your help is highly appreciated!

Actions #12

Updated by Marius BĂLTEANU almost 5 years ago

Go MAEDA wrote:

I started work on this issue.

Here is the very first version of the work-in-progress patch but there are still many errors.

[...]

Please feel free to update the patch. Your help is highly appreciated!

I'm willing to help with this, but I think we should have first a decision (from Jean-Philippe, I guess) regarding next Redmine major version. If we're going to update to Rails 6, we should merge version 4.2.0 to 5.0.0.

Considering the time frame of the major releases, I'm in favour of Redmine 5.0.0 with support for Rails 6.

Actions #13

Updated by Marius BĂLTEANU almost 5 years ago

  • Related to Defect #32897: Rails 6: Pass `case_sensitive: true` option explicitly to the uniqueness validator added
Actions #14

Updated by Go MAEDA almost 5 years ago

Marius BALTEANU wrote:

I'm willing to help with this, but I think we should have first a decision (from Jean-Philippe, I guess) regarding next Redmine major version. If we're going to update to Rails 6, we should merge version 4.2.0 to 5.0.0.

I agree. Redmine 5.0.0 is the appropriate version to switch to Rails 6 and this should be decided by Jean-Philippe Lang.

But while waiting for Jean-Philippe's decision, we can prepare for moving to Rails 6. And I think we should do it to quickly switch to Rails 6 once JPL decided to do.

I think we should move to Rails 6 as soon as we can because the Rails team no longer provides bug fixes for Rails 5.2 except for security fixes. The negative impacts of that are already happening. For example, Redmine does not support Ruby 2.7 because Rails 5.2 does not. And probably Rails 5.2 will never support 2.7.

So, I think we should prepare for Rails 6 in parallel with waiting for the decision.

Actions #15

Updated by Aleksandar Pavic almost 5 years ago

+1 however I guess lot's of plugin developers will need to be notified and start their upgrades as well...

Actions #16

Updated by Marius BĂLTEANU almost 5 years ago

Go MAEDA wrote:

I agree. Redmine 5.0.0 is the appropriate version to switch to Rails 6 and this should be decided by Jean-Philippe Lang.

But while waiting for Jean-Philippe's decision, we can prepare for moving to Rails 6. And I think we should do it to quickly switch to Rails 6 once JPL decided to do.

I think we should move to Rails 6 as soon as we can because the Rails team no longer provides bug fixes for Rails 5.2 except for security fixes. The negative impacts of that are already happening. For example, Redmine does not support Ruby 2.7 because Rails 5.2 does not. And probably Rails 5.2 will never support 2.7.

So, I think we should prepare for Rails 6 in parallel with waiting for the decision.

Let's do it then. I've prepared this branch on my Gitlab CI instance, it should be easier to track the test fails.
As next steps, I propose to open issues for all fails and deprecation warnings and to discuss there the fixes. I expect to get some feedback from other active contributors.

Actions #17

Updated by Marius BĂLTEANU almost 5 years ago

  • Related to Defect #32908: Rails 6: Sending mail with DeliveryJob is deprecated added
Actions #18

Updated by Marius BĂLTEANU almost 5 years ago

  • Related to Patch #32909: Replace pluck().first with pick() added
Actions #19

Updated by Marius BĂLTEANU almost 5 years ago

  • Related to Defect #32910: Rails 6: add lookup_context to hook_test.rb added
Actions #20

Updated by Marius BĂLTEANU almost 5 years ago

  • Related to Patch #32911: Rails 6: Fix deprecation warning "Class level methods will no longer inherit scoping" added
Actions #21

Updated by Marius BĂLTEANU almost 5 years ago

  • Related to Defect #32912: Rails 6: update no longer bypass optimistic locking added
Actions #22

Updated by Marius BĂLTEANU almost 5 years ago

Actions #23

Updated by Marius BĂLTEANU almost 5 years ago

  • Related to Defect #32914: Rails 6: remove #filename_for_content_disposition for MS browsers added
Actions #24

Updated by Marius BĂLTEANU almost 5 years ago

  • Related to Patch #32922: Reload detached attachments added
Actions #25

Updated by Marius BĂLTEANU almost 5 years ago

  • Related to Defect #32923: Rails 6: detach attachments when a conflict occurs added
Actions #26

Updated by Marius BĂLTEANU almost 5 years ago

  • Related to Defect #32921: Rails 6: add header=present to csv tests added
Actions #27

Updated by Pavel Rosický almost 5 years ago

all tests should be passing now

Actions #28

Updated by Marius BĂLTEANU almost 5 years ago

Actions #29

Updated by Marius BĂLTEANU almost 5 years ago

  • Related to Defect #32936: Rails 6: disable AJ test adapter for integration tests added
Actions #30

Updated by Marius BĂLTEANU almost 5 years ago

  • Related to Patch #32937: test_revisions_latin_1_identifier should be skipped on Windows added
Actions #31

Updated by Marius BĂLTEANU almost 5 years ago

Actions #32

Updated by Marius BĂLTEANU almost 5 years ago

Actions #33

Updated by Go MAEDA about 4 years ago

  • Related to deleted (Defect #27780: Case-insensitive matching fails for Unicode filenames when referring to attachments in text formatting)
Actions #34

Updated by Petr Pospisil about 4 years ago

Hello all,

I would like to offer you our help to speed up migration to Rails 6. If you are interested in, please contact me. I have several experienced Redmine developers that should help to move Redmine forward. We can setup a plan and deliver issues done. I know we can send a patch, but I am talking about closer cooperation.

Thank you
Petr

Actions #35

Updated by Marius BĂLTEANU over 3 years ago

  • Related to Defect #34980: Fix "undefined method `represent_boolean_as_integer=' for nil:NilClass" in Rails 6.1 added
Actions #36

Updated by Marius BĂLTEANU over 3 years ago

  • Related to Defect #34985: Rails 6.1 replace ActiveModel::Errors #<< with #add added
Actions #37

Updated by Marius BĂLTEANU over 3 years ago

  • Related to Defect #34984: Rails 6.1 Rendering actions with '.' in the name is deprecated added
Actions #38

Updated by Marius BĂLTEANU over 3 years ago

I'm attaching a patch series (19) that updates Rails to 6.1.3.1 and fixes all the tests on MySQL and PostgreSQL. MS SQL support is broken for now because the gem supports only Rails 6.0, but I'm confident that will be fixed in the following weeks (there are active discussions/PRs).

My proposal is to have these patches committed as soon as possible in order to have enough time to catch and fix other issues caused by this update (this apply also for plugin developers) and to discuss the other improvements that Rails 6.0/6.1 are adding. In the meanwhile, to track the changes easily, I've changed from Patch to Defect all those tickets that are a must for this update (and for which we have patches attached here).

Thanks again Pavel Rosický for you work on this!

Actions #40

Updated by Go MAEDA over 3 years ago

Thank you all for working on this.

Marius BALTEANU wrote:

My proposal is to have these patches committed as soon as possible in order to have enough time to catch and fix other issues caused by this update (this apply also for plugin developers) and to discuss the other improvements that Rails 6.0/6.1 are adding.

I agree. Support for Rails 5.2 will end when Rails 7.0 is released (maybe this year?). So we need to migrate to Rails 6 as soon as possible.

I will commit the patches contributed by Pavel Rosický and Marius BALTEANU in the coming days.

Actions #41

Updated by Marius BĂLTEANU over 3 years ago

  • Subject changed from Migrate to Rails 6 to Migrate to Rails 6.1
Actions #42

Updated by Marius BĂLTEANU over 3 years ago

Actions #43

Updated by Go MAEDA over 3 years ago

Actions #44

Updated by Go MAEDA over 3 years ago

The following error was reported while running the test suite.

Failure:
RepositoriesSubversionControllerTest#test_entry_download [/Users/maeda/redmines/trunk/test/functional/repositories_subversion_controller_test.rb:332]:
--- expected
+++ actual
@@ -1 +1 @@
-"attachment; filename=\"helloworld.c\"" 
+"attachment; filename=\"helloworld.c\"; filename*=UTF-8''helloworld.c" 

rails test test/functional/repositories_subversion_controller_test.rb:318
Actions #45

Updated by Go MAEDA over 3 years ago

Go MAEDA wrote:

The following error was reported while running the test suite.

[...]

I will fix RepositoriesSubversionControllerTest#test_entry_download when I commit 0012-Add-filename-header-29914-32913.patch

Actions #46

Updated by Go MAEDA over 3 years ago

Committed 19 patches attached to #29914#note-38 and #29914#note-39 (r20879 .. r20901).

Actions #47

Updated by Yuichi HARADA over 3 years ago

Updating activerecord-sqlserver-adapter with r20900, but when I execute bundle update, the following error occurs.

% bundle update
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Bundler could not find compatible versions for gem "activerecord":
  In Gemfile:
    activerecord-sqlserver-adapter (~> 6.0.1) was resolved to 6.0.1, which depends on
      activerecord (~> 6.0.0)

    rails (= 6.1.3.1) was resolved to 6.1.3.1, which depends on
      activerecord (= 6.1.3.1)
Actions #48

Updated by Pavel Rosický over 3 years ago

優一 内田 activerecord-sqlserver-adapter doesn't support Rails 6.1 yet, but there's an open PR
https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/861

it would be nice if someone could run tests on it.

Actions #49

Updated by Yuichi HARADA over 3 years ago

Pavel Rosický wrote:

優一 内田 activerecord-sqlserver-adapter doesn't support Rails 6.1 yet, but there's an open PR
https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/861

it would be nice if someone could run tests on it.

Thank you for teaching me. I hope it will be resolved by the time Redmine 5.0 is released.

Actions #50

Updated by Marius BĂLTEANU over 3 years ago

Actions #51

Updated by Marius BĂLTEANU over 3 years ago

I've created #35002 to track the compatibility with MS SQL.

Actions #52

Updated by Marius BĂLTEANU over 3 years ago

Actions #53

Updated by Go MAEDA over 3 years ago

  • Related to Defect #35004: DEPRECATION WARNING during startup added
Actions #54

Updated by Go MAEDA over 3 years ago

  • Related to Defect #35005: RuntimeError "Couldn't find Active Storage configuration" is raised at startup added
Actions #55

Updated by Marius BĂLTEANU over 3 years ago

We should update Rubocop TargetRailsVersion to 6.1

Actions #56

Updated by Go MAEDA over 3 years ago

Marius BALTEANU wrote:

We should update Rubocop TargetRailsVersion to 6.1

Done in r20908.

Actions #57

Updated by Go MAEDA over 3 years ago

  • Related to Patch #35081: Update config/environments/*.rb for Rails 6.1 added
Actions #58

Updated by Go MAEDA over 3 years ago

  • Related to Patch #35466: Rename test/fixtures/configuration/*.yml.example to test/fixtures/files/configuration/*.yml added
Actions #59

Updated by Marius BĂLTEANU about 3 years ago

  • Subject changed from Migrate to Rails 6.1 to Migrate to Rails 6.1 with Zeitwerk autoloading
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Now that we switched to Zeitwerk autoloader (#32938), we can consider the migration to Rails 6.1 completed.

Thanks again for all the help!

Actions #60

Updated by Marius BĂLTEANU about 3 years ago

  • Status changed from New to Closed
Actions #61

Updated by Marius BĂLTEANU about 3 years ago

  • Related to Defect #36218: Plugin assets are not copied correctly in trunk r21289 added
Actions #64

Updated by Go MAEDA almost 2 years ago

  • Related to Defect #36273: Modifying the source code of a plugin does not reload it after r21295 added
Actions

Also available in: Atom PDF