Project

General

Profile

Actions

Feature #36320

open

Migrate to Rails 7.1

Added by Go MAEDA almost 2 years ago. Updated 6 days ago.

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

0%

Estimated time:
Resolution:
Fixed

Files

0001-Upgrade-to-Rails-7.patch (5.05 KB) 0001-Upgrade-to-Rails-7.patch Takashi Kato, 2022-04-10 15:35
0002-Fix-deprecation-warning.patch (5.73 KB) 0002-Fix-deprecation-warning.patch Takashi Kato, 2022-04-10 15:35
0004-Use-Selenium-WebDriver-Wait.patch (1.58 KB) 0004-Use-Selenium-WebDriver-Wait.patch Takashi Kato, 2022-04-10 15:35
0003-Replace-to_s-db-to-to_fs-db.patch (10.9 KB) 0003-Replace-to_s-db-to-to_fs-db.patch Takashi Kato, 2022-04-10 15:35
0001-Upgrade-to-rails-7.1-beta1.patch (25.7 KB) 0001-Upgrade-to-rails-7.1-beta1.patch patch for r22317 Takashi Kato, 2023-09-24 17:42
20231117_36320.patch (26.1 KB) 20231117_36320.patch r22429@trunk Minoru Maeda, 2023-11-17 06:13
0001-Fix-autoloading-plugin-classes.patch (2.83 KB) 0001-Fix-autoloading-plugin-classes.patch Takashi Kato, 2023-11-28 13:12
0001v2-Fix-autoloading-plugin-classes.patch (4.66 KB) 0001v2-Fix-autoloading-plugin-classes.patch patch for r22488 Takashi Kato, 2023-11-28 15:44

Related issues

Related to Redmine - Patch #36317: Set default protect from forgery trueClosedMarius BALTEANU

Actions
Related to Redmine - Patch #36355: Update roadie-rails to 3.0ClosedGo MAEDA

Actions
Related to Redmine - Patch #35536: Use webpack to improve javascripts and stylesheets managementNew

Actions
Related to Redmine - Patch #39110: Replacing request_store with ActiveSupport::CurrentAttributesClosedMarius BALTEANU

Actions
Related to Redmine - Defect #37732: Fix "DEPRECATION WARNING: Rendering actions with '.' in the name is deprecated" in RepositoriesControllerClosedMarius BALTEANU

Actions
Actions #1

Updated by Go MAEDA almost 2 years ago

  • Related to Patch #36317: Set default protect from forgery true added
Actions #2

Updated by Go MAEDA almost 2 years ago

Actions #3

Updated by Marius BALTEANU almost 2 years ago

  • Related to Patch #35536: Use webpack to improve javascripts and stylesheets management added
Actions #4

Updated by Go MAEDA over 1 year ago

  • Target version changed from Unplanned backlogs to 6.0.0
Actions #6

Updated by Go MAEDA over 1 year ago

Thank you for posting the patches.

I think we have to wait until the release of Redmine 5.1.0 to upgrade Rails because 5.1.0 should be Rails 6.1 based.

Actions #7

Updated by Takashi Kato 2 months ago

I've updated a patch that is compatible with Rails 7.1 beta. As for the WebDriver patch, I have linked it to another issue 37558.

Actions #8

Updated by Jun NAITOH 21 days ago

https://endoflife.date/rails

6.1
(01 Jun 2024)

https://github.com/rails/rails/pull/46895#issuecomment-1673353127

6.1 is not getting anymore releases unless it's a severe vulnerability and will be EOL next June.

I think Redmine needs to upgrade to Rails 7 before Rails 6.1 EOL.

Actions #9

Updated by M T 18 days ago

Not a bad effort there Takashi Kato, I gave your patch a quick go with Rails 7.1 and it seemed to work with standard Redmine 5.1 release branch.

However one thing that got broke is the autoloading of classes and modules from plugin folders, not sure why. Perhaps you could check this out... I know there have been some subtle changes in this area in Rails. (Also is there a reason you deleted the zeitwerk config line?)

Cheers
MT

Actions #10

Updated by Minoru Maeda 18 days ago

Takashi Kato wrote in #note-7:

I've updated a patch that is compatible with Rails 7.1 beta. As for the WebDriver patch, I have linked it to another issue 37558.

Thank you for the great patch. I applied the 0001-Upgrade-to-rails-7.1-beta1.patch to r22429@trunk and ran tests, but some of them failed.

  • test/integration/sudo_mode_test.rb
  • test/integration/api_test/my_test.rb and test/integration/api_test/news_test.rb
    • It seems there is a problem where XML and JSON requests don't return the expected content-type.
  • test/unit/project_nested_set_concurrency_test.rb:34
    • It looks like assert_difference is evaluated without waiting for the Thread to finish.

Based on the patch you posted, I made corrections so that test/integration/api_test would pass. Also, I updated to Rails v7.1.2, which was released on November 10, 2023.
However, the failures in test/integration/sudo_mode_test.rb and test/unit/project_nested_set_concurrency_test.rb have not been resolved.

I hope this helps.

Actions #11

Updated by Marius BALTEANU 18 days ago

  • Assignee set to Marius BALTEANU
Actions #12

Updated by Marius BALTEANU 15 days ago

  • Related to Patch #39110: Replacing request_store with ActiveSupport::CurrentAttributes added
Actions #13

Updated by Marius BALTEANU 7 days ago

  • Subject changed from Migrate to Rails 7 to Migrate to Rails 7.1
  • Status changed from New to Resolved
  • Resolution set to Fixed

I've committed the patch that updates Rails to 7.1.2 on trunk. Thanks Takashi Kato for your work!

Actions #14

Updated by Takashi Kato 7 days ago

A fix included in rails 7.1.2 (https://github.com/rails/rails/pull/49636) causes autoloading of plugins to fail.
A patch to fix this is attached.

Actions #15

Updated by Marius BALTEANU 7 days ago

Thanks!

Can you take a look also on the failing tests from here? I will do it as well this week.

Actions #16

Updated by Takashi Kato 7 days ago

Sorry for your time.
It is difficult to fix autoload_paths after initialize, so I've changed the method.

Actions #17

Updated by Marius BALTEANU 6 days ago

  • Related to Defect #37732: Fix "DEPRECATION WARNING: Rendering actions with '.' in the name is deprecated" in RepositoriesController added
Actions #18

Updated by Mischa The Evil 6 days ago

Takashi Kato wrote in #note-16:

Sorry for your time.
It is difficult to fix autoload_paths after initialize, so I've changed the method.

Just my two cents on this patch:
  • This somewhat seems to converge with #24007 (albeit not as a user config option directly) and as such has the issue mentioned in #24007#note-13 that 'plugins' directory remains hard-coded in source:/trunk/Gemfile@22489#L125.
  • The comments included in this patch contain a typo (s/tesr/test).
Actions

Also available in: Atom PDF