From 189aa5fa4e489cbca323c25e4a6f9417547aa1a9 Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Thu, 23 Nov 2023 08:29:51 +0800 Subject: [PATCH] FIX: `plugin:install_all_gems` Rake task not installing plugin gem (#24522) Why this change? This regressed in dec68d780c58ef0954865b786d04b653c20e26fa where the commit assumes that plugin gems are always installed when the `plugin:install_all_gems` Rake task is ran as it would run the our Rails initializers which activates plugins and install the gems. However, this assumption only holds true when the `LOAD_PLUGINS` is present and set to `1`. What does this change do? This commit changes the `plugin:install_all_gems` to load the Rails environment with `LOAD_PLUGINS` set to `1` such that the plugin gems will be installed as part of our initialization process for the app. The commit also removes the `plugin:install_gems` Rake task which is currently a noop and does not seem to be used anywhere.. --- lib/tasks/plugin.rake | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/lib/tasks/plugin.rake b/lib/tasks/plugin.rake index e20c121f0ee..f3c3333f9cb 100644 --- a/lib/tasks/plugin.rake +++ b/lib/tasks/plugin.rake @@ -170,18 +170,8 @@ end desc "install all plugin gems" task "plugin:install_all_gems" do |t| - # Left intentionally blank. - # When the app is being loaded, all missing gems are installed - # See: lib/plugin_gem.rb - puts "Done" -end - -desc "install plugin gems" -task "plugin:install_gems", :plugin do |t, args| - # Left intentionally blank. - # When the app is being loaded, all missing gems are installed - # See: lib/plugin_gem.rb - puts "Done" + ENV["LOAD_PLUGINS"] = "1" + Rake::Task["environment"].invoke end def spec(plugin, parallel: false, argv: nil)