Project

General

Profile

Actions

Defect #38707

closed

Fix order of loading plugins' config/routes.rb

Added by Nishida Yuya 6 months ago. Updated about 1 month ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Plugin API
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

When loading init.rb, uses sort (source:tags/5.0.5/lib/redmine/plugin_loader.rb#L117), but loading plugin's config/routes.rb does not uses sort (source:tags/5.0.5/config/routes.rb#L400). In ruby-2.7 or earlier, Dir.glob does not sort. So, loading init.rb and loading plugin's config/routes.rb are different.

This issue includes following patches:


Files

Actions #1

Updated by Go MAEDA 5 months ago

  • Target version set to Candidate for next major release
Actions #2

Updated by Go MAEDA 3 months ago

  • Target version changed from Candidate for next major release to 5.1.0

Setting the target version to 5.1.0.

Actions #3

Updated by Go MAEDA 2 months ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA

Committed the patch. Thank you.

Actions #4

Updated by Marius BALTEANU about 1 month ago

  • Status changed from Closed to Reopened

There is a random failing test caused by this.

Can we take a look, please?


Failure:
RoutingPluginsTest#test_plugins [/var/lib/jenkins/workspace/trunk/DATABASE_ADAPTER/mysql/RUBY_VER/ruby-3.1/test/test_helper.rb:323]:
A route matches "/plugin_articles", but references missing controller: PluginArticlesController

rails test test/integration/routing/plugins_test.rb:63
Actions #5

Updated by Marius BALTEANU about 1 month ago

  • Status changed from Reopened to Closed

The random failing test most probably was caused by the custom plugins path defined in plugin_test.rb or plugin_loader_test.rb. I think I've fixed it by explicit setting the plugins directory to tmp/test/plugins.

Actions #6

Updated by Go MAEDA about 1 month ago

  • Tracker changed from Patch to Defect
  • Resolution set to Fixed
Actions

Also available in: Atom PDF