Feature #29914

Migrate to Rails 6.1

Added by Go MAEDA over 2 years ago. Updated 4 months ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Rails support
Target version:5.0.0
Resolution:

32886-wip-r19467.patch Magnifier (1.79 KB) Go MAEDA, 2020-01-27 05:30

0010-Fix-ArgumentError-wrong-number-of-arguments-given-1-.patch Magnifier (1.03 KB) Marius BALTEANU, 2021-03-30 18:41

0009-Fix-ArgumentError-wrong-number-of-arguments-given-1-.patch Magnifier (1.86 KB) Marius BALTEANU, 2021-03-30 18:41

0008-Rails-6.1-add-header-present-to-csv-tests-29914-3292.patch Magnifier (10.7 KB) Marius BALTEANU, 2021-03-30 18:41

0007-Fix-ActionView-Template-Error-wrong-number-of-argume.patch Magnifier (940 Bytes) Marius BALTEANU, 2021-03-30 18:41

0006-Fix-DEPRECATION-WARNING-Passing-a-path-to-relative-t.patch Magnifier (772 Bytes) Marius BALTEANU, 2021-03-30 18:41

0005-Fix-ActiveRecord-StaleObjectError-Attempted-to-updat.patch Magnifier (3.78 KB) Marius BALTEANU, 2021-03-30 18:41

0004-Fix-Subclasses-must-implement-a-find_templates-name-.patch Magnifier (1.13 KB) Marius BALTEANU, 2021-03-30 18:41

0003-Fix-sending-mail-with-DeliveryJob-is-deprecated-2991.patch Magnifier (3.77 KB) Marius BALTEANU, 2021-03-30 18:41

0002-Fix-undefined-method-for-nil-NilClass-in-Rails-6.1-2.patch Magnifier (922 Bytes) Marius BALTEANU, 2021-03-30 18:41

0001-Fix-DEPRECATION-WARNING-Uniqueness-validator-will-no.patch Magnifier (10.6 KB) Marius BALTEANU, 2021-03-30 18:41

0018-Rails-6.1-fix-set-roleids-29914-32935.patch Magnifier (666 Bytes) Marius BALTEANU, 2021-03-30 18:42

0019-Update-activerecord-sqlserver-adapter-to-6.0.1.patch Magnifier (987 Bytes) Marius BALTEANU, 2021-03-30 18:42

0017-Fix-DEPRECATION-WARNING-Calling-to-an-ActiveModel-Er.patch Magnifier (835 Bytes) Marius BALTEANU, 2021-03-30 18:42

0015-Fix-detach-attachments-when-a-conflict-occurs-29914-.patch Magnifier (896 Bytes) Marius BALTEANU, 2021-03-30 18:42

0014-Disable-TestAdapter-on-IntegrationTest-29914-32936.patch Magnifier (741 Bytes) Marius BALTEANU, 2021-03-30 18:42

0016-Fix-DEPRECATION-WARNING-Rendering-actions-with-.-in-.patch Magnifier (1.8 KB) Marius BALTEANU, 2021-03-30 18:42

0013-Remove-filename_for_content_disposition-for-MS-brows.patch Magnifier (2.9 KB) Marius BALTEANU, 2021-03-30 18:42

0011-Use-media_type-to-get-the-MIME-type-of-the-request-2.patch Magnifier (1005 Bytes) Marius BALTEANU, 2021-03-30 18:42

0012-Add-filename-header-29914-32913.patch Magnifier (3.27 KB) Marius BALTEANU, 2021-03-30 18:42

0001-Update-TargetRailsVersion-to-6.1.patch Magnifier (570 Bytes) Marius BALTEANU, 2021-04-02 22:49


Related issues

Related to Redmine - Feature #31128: Drop Ruby < 2.5 support Closed
Related to Redmine - Defect #32885: Rails 6: DEPRECATION WARNING: Single arity template handl... Closed
Related to Redmine - Patch #32886: Rails 6: Use #media_type instead of #content_type to test... Closed
Related to Redmine - Patch #32887: Rails 6: Use "render template:" instead of "render file:"... Closed
Related to Redmine - Defect #32897: Rails 6: Pass `case_sensitive: true` option explicitly to... Closed
Related to Redmine - Defect #32908: Rails 6: Sending mail with DeliveryJob is deprecated Closed
Related to Redmine - Patch #32909: Replace pluck().first with pick() Closed
Related to Redmine - Defect #32910: Rails 6: add lookup_context to hook_test.rb Closed
Related to Redmine - Patch #32911: Rails 6: Fix deprecation warning "Class level methods wil... Closed
Related to Redmine - Defect #32912: Rails 6: update no longer bypass optimistic locking Closed
Related to Redmine - Defect #32913: Rails 6: add filename header Closed
Related to Redmine - Defect #32914: Rails 6: remove #filename_for_content_disposition for MS ... Closed
Related to Redmine - Patch #32922: Reload detached attachments Closed
Related to Redmine - Defect #32923: Rails 6: detach attachments when a conflict occurs Closed
Related to Redmine - Defect #32921: Rails 6: add header=present to csv tests Closed
Related to Redmine - Defect #32935: Rails 6: fix set role_ids Closed
Related to Redmine - Defect #32936: Rails 6: disable AJ test adapter for integration tests Closed
Related to Redmine - Patch #32937: test_revisions_latin_1_identifier should be skipped on Wi... Closed
Related to Redmine - Feature #32938: Rails 6: Zeitwerk support New
Related to Redmine - Defect #32939: Rails 6: fix plugin migrations Closed
Related to Redmine - Defect #34980: Fix "undefined method `represent_boolean_as_integer=' for... Closed
Related to Redmine - Defect #34985: Rails 6.1 replace ActiveModel::Errors #<< with #add Closed
Related to Redmine - Defect #34984: Rails 6.1 Rendering actions with '.' in the name is depre... Closed
Related to Redmine - Feature #34987: Rails 6.1 destroy async New
Related to Redmine - Defect #35002: Fix MS SQL on Rails 6.1 Closed
Related to Redmine - Defect #35003: Update Rails UJS Closed
Related to Redmine - Defect #35004: DEPRECATION WARNING during startup Closed
Related to Redmine - Defect #35005: RuntimeError "Couldn't find Active Storage configuration"... Closed
Related to Redmine - Patch #35081: Update config/environments/*.rb for Rails 6.1 New
Related to Redmine - Patch #35466: Rename test/fixtures/configuration/*.yml.example to test/... Closed
Blocked by Redmine - Patch #31919: Update roadie-rails gem (~> 2.1.0) Closed
Blocks Redmine - Feature #34992: Ruby 3.0 support Resolved

Associated revisions

Revision 18375
Added by Go MAEDA almost 2 years ago

Code cleanup: RuboCop: Rails/ActiveRecordAliases

update_attributes is deprecated in Rails 6.0 and will be removed in Rails 6.1 (#29914).

Revision 20879
Added by Go MAEDA 4 months ago

Gemfile: Update Rails to 6.1 (#29914).

Revision 20880
Added by Go MAEDA 4 months ago

DEPRECATION WARNING: Uniqueness validator will no longer enforce case sensitive comparison in Rails 6.1. (#29914, #32897).

Patch by Marius BALTEANU.

Revision 20881
Added by Go MAEDA 4 months ago

Fix "undefined method for nil:NilClass" in Rails 6.1 (#29914, #34980).

Patch by Marius BALTEANU.

Revision 20882
Added by Go MAEDA 4 months ago

Fix sending mail with DeliveryJob is deprecated (#29914, #32908).

Patch by Pavel Rosický.

Revision 20883
Added by Go MAEDA 4 months ago

Fix Subclasses must implement a find_templates(name, prefix, partial, details, locals = []) method (#29914).

Patch by Go MAEDA.

Revision 20884
Added by Go MAEDA 4 months ago

Fix "ActiveRecord::StaleObjectError: Attempted to update a stale object: Issue." (#29914, #32912).

Patch by Pavel Rosický.

Revision 20885
Added by Go MAEDA 4 months ago

Fix "DEPRECATION WARNING: Passing a path to relative to is deprecated." (#29914).

Patch by Marius BALTEANU.

Revision 20886
Added by Go MAEDA 4 months ago

Fix "ActionView::Template::Error (wrong number of arguments (given 2, expected 1))" (#29914).

Patch by Marius BALTEANU.

Revision 20887
Added by Go MAEDA 4 months ago

Rails 6.1: add header=present to csv tests (#29914, #32921).

Patch by Pavel Rosický.

Revision 20888
Added by Go MAEDA 4 months ago

Fix "ArgumentError: wrong number of arguments (given 1, expected 2) on Redmine::PluginTest#test_migrate_redmine_plugin" (#29914, #32939).

Patch by Pavel Rosický.

Revision 20889
Added by Go MAEDA 4 months ago

Fix ArgumentError: wrong number of arguments (given 1, expected 3) (#29914).

Patch by Marius BALTEANU.

Revision 20890
Added by Go MAEDA 4 months ago

Use media_type to get the MIME type of the request (#29914).

Patch by Marius BALTEANU.

Revision 20891
Added by Go MAEDA 4 months ago

Add filename header (#29914, #32913).

Patch by Pavel Rosický.

Revision 20892
Added by Go MAEDA 4 months ago

Remove #filename_for_content_disposition for MS browsers (#29914, #32914).

Patch by Pavel Rosický.

Revision 20893
Added by Go MAEDA 4 months ago

Disable TestAdapter on IntegrationTest (#29914, #32936).

Patch by Pavel Rosický.

Revision 20894
Added by Go MAEDA 4 months ago

Fix detach attachments when a conflict occurs (#29914, #32923).

Patch by Pavel Rosický.

Revision 20895
Added by Go MAEDA 4 months ago

Fix "DEPRECATION WARNING: Rendering actions with '.' in the name is deprecated: common/error_messages.api" (#29914, #34985).

Patch by Pavel Rosický.

Revision 20896
Added by Go MAEDA 4 months ago

Reverts r20895 (#29914, #34985).

Wrong issue number.

Revision 20897
Added by Go MAEDA 4 months ago

Fix "DEPRECATION WARNING: Rendering actions with '.' in the name is deprecated: common/error_messages.api" (#29914, #34984).

Patch by Pavel Rosický.

Revision 20898
Added by Go MAEDA 4 months ago

Fix "DEPRECATION WARNING: Calling '<<' to an ActiveModel::Errors message array in order to add an error is deprecated." (#29914, #34985).

Revision 20899
Added by Go MAEDA 4 months ago

Rails 6.1: fix set roleids (#29914, #32935).

Patch by Pavel Rosický.

Revision 20900
Added by Go MAEDA 4 months ago

Update activerecord-sqlserver-adapter to 6.0.1 (#29914).

Revision 20901
Added by Go MAEDA 4 months ago

Fix a test failure caused by an assert forgotten to be deleted (#29914, #32913).

Revision 20906
Added by Go MAEDA 4 months ago

RuntimeError "Couldn't find Active Storage configuration" is raised at startup (#29914, #35005).

Revision 20908
Added by Go MAEDA 4 months ago

Set TargetRailsVersion of RuboCop to 6.1 (#29914).

Revision 20937
Added by Go MAEDA 3 months ago

Update Rails UJS to 6.1.3.1 (#29914, #35003).

Patch by Marius BALTEANU.

Revision 20938
Added by Go MAEDA 3 months ago

set svn:eol-style to native (#29914, #35003).

Revision 20983
Added by Go MAEDA 3 months ago

Update Rails to 6.1.3.2 (#29914).

Revision 21029
Added by Marius BALTEANU about 1 month ago

Update activerecord-sqlserver-adapter gem to 6.1.0 (#29914, #35002).

Revision 21049
Added by Go MAEDA about 1 month ago

Update Rails to 6.1.4 (#29914).

History

#1 Updated by Go MAEDA over 2 years ago

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

#2 Updated by Marius BALTEANU over 2 years ago

#3 Updated by Go MAEDA about 2 years ago

  • Target version changed from Unplanned backlogs to 5.0.0

#4 Updated by Enziin System about 2 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.

#5 Updated by Go MAEDA almost 2 years ago

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

#7 Updated by Tigergm Wu over 1 year 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.

#8 Updated by Go MAEDA over 1 year ago

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

#9 Updated by Go MAEDA over 1 year ago

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

#10 Updated by Go MAEDA over 1 year ago

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

#11 Updated by Go MAEDA over 1 year 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!

#12 Updated by Marius BALTEANU over 1 year 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.

#13 Updated by Marius BALTEANU over 1 year ago

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

#14 Updated by Go MAEDA over 1 year 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.

#15 Updated by Aleksandar Pavic over 1 year ago

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

#16 Updated by Marius BALTEANU over 1 year 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.

#17 Updated by Marius BALTEANU over 1 year ago

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

#18 Updated by Marius BALTEANU over 1 year ago

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

#19 Updated by Marius BALTEANU over 1 year ago

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

#20 Updated by Marius BALTEANU over 1 year ago

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

#21 Updated by Marius BALTEANU over 1 year ago

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

#22 Updated by Marius BALTEANU over 1 year ago

#23 Updated by Marius BALTEANU over 1 year ago

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

#24 Updated by Marius BALTEANU over 1 year ago

  • Related to Patch #32922: Reload detached attachments added

#25 Updated by Marius BALTEANU over 1 year ago

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

#26 Updated by Marius BALTEANU over 1 year ago

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

#27 Updated by Pavel Rosický over 1 year ago

all tests should be passing now

#28 Updated by Marius BALTEANU over 1 year ago

#29 Updated by Marius BALTEANU over 1 year ago

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

#30 Updated by Marius BALTEANU over 1 year ago

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

#31 Updated by Marius BALTEANU over 1 year ago

#32 Updated by Marius BALTEANU over 1 year ago

#33 Updated by Go MAEDA 9 months ago

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

#34 Updated by Petr Pospisil 8 months 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

#35 Updated by Marius BALTEANU 4 months ago

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

#36 Updated by Marius BALTEANU 4 months ago

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

#37 Updated by Marius BALTEANU 4 months ago

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

#38 Updated by Marius BALTEANU 4 months 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!

#40 Updated by Go MAEDA 4 months 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.

#41 Updated by Marius BALTEANU 4 months ago

  • Subject changed from Migrate to Rails 6 to Migrate to Rails 6.1

#42 Updated by Marius BALTEANU 4 months ago

#43 Updated by Go MAEDA 4 months ago

#44 Updated by Go MAEDA 4 months 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

#45 Updated by Go MAEDA 4 months 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

#46 Updated by Go MAEDA 4 months ago

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

#47 Updated by Yuichi HARADA 4 months 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)

#48 Updated by Pavel Rosický 4 months ago

@yuichi 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.

#49 Updated by Yuichi HARADA 4 months ago

Pavel Rosický wrote:

@yuichi 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.

#50 Updated by Marius BALTEANU 4 months ago

#51 Updated by Marius BALTEANU 4 months ago

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

#52 Updated by Marius BALTEANU 4 months ago

#53 Updated by Go MAEDA 4 months ago

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

#54 Updated by Go MAEDA 4 months ago

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

#55 Updated by Marius BALTEANU 4 months ago

We should update Rubocop TargetRailsVersion to 6.1

#56 Updated by Go MAEDA 4 months ago

Marius BALTEANU wrote:

We should update Rubocop TargetRailsVersion to 6.1

Done in r20908.

#57 Updated by Go MAEDA 3 months ago

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

#58 Updated by Go MAEDA about 1 month ago

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

Also available in: Atom PDF