From 89d948737cf8cdfb8f253acb3b2487dc101f1595 Mon Sep 17 00:00:00 2001 From: Yuriy Kurant Date: Wed, 12 Nov 2025 14:52:20 +0800 Subject: [PATCH] DEV: adds rake task "rake themes:advanced_search_banner:migrate_all" (#35981) Prefixes numbers to `themes:advanced_search_banner` rake task names to clarify their intended execution order: * `migrate_settings_to_welcome_banner` => `1_migrate_settings_to_welcome_banner` * `migrate_translations_to_welcome_banner` => `2_migrate_translations_to_welcome_banner` * `exclude_and_disable` => `3_exclude_and_disable` Also adds a combined rake task `themes:advanced_search_banner:migrate_all` to run all three sequentially. The output will look like this: migrate_all console output --- ...anced_search_banner_to_welcome_banner.rake | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/lib/tasks/migrate_advanced_search_banner_to_welcome_banner.rake b/lib/tasks/migrate_advanced_search_banner_to_welcome_banner.rake index e6ffe9718b0..69a8cfcc336 100644 --- a/lib/tasks/migrate_advanced_search_banner_to_welcome_banner.rake +++ b/lib/tasks/migrate_advanced_search_banner_to_welcome_banner.rake @@ -4,8 +4,17 @@ THEME_GIT_URL ||= "https://github.com/discourse/discourse-search-banner.git" REQUIRED_TRANSLATION_KEYS ||= %w[search_banner.headline search_banner.subhead] +desc "Run all Advanced Search Banner migration tasks" +task "themes:advanced_search_banner:migrate_all" => %w[ + themes:advanced_search_banner:1_migrate_settings_to_welcome_banner + themes:advanced_search_banner:2_migrate_translations_to_welcome_banner + themes:advanced_search_banner:3_exclude_and_disable + ] + desc "Migrate settings from Advanced Search Banner to core welcome banner" -task "themes:advanced_search_banner:migrate_settings_to_welcome_banner" => :environment do +task "themes:advanced_search_banner:1_migrate_settings_to_welcome_banner" => :environment do + puts "\n1. Migrating settings..." + puts "------------------------" components = find_all_components([:theme_settings]) if components.empty? @@ -17,7 +26,9 @@ task "themes:advanced_search_banner:migrate_settings_to_welcome_banner" => :envi end desc "Migrate translations from Advanced Search Banner to core welcome banner" -task "themes:advanced_search_banner:migrate_translations_to_welcome_banner" => :environment do +task "themes:advanced_search_banner:2_migrate_translations_to_welcome_banner" => :environment do + puts "\n2. Migrating translations..." + puts "----------------------------" components = find_all_components([:theme_translation_overrides]) if components.empty? @@ -29,7 +40,9 @@ task "themes:advanced_search_banner:migrate_translations_to_welcome_banner" => : end desc "Exclude and disable Advanced Search Banner theme component" -task "themes:advanced_search_banner:exclude_and_disable" => :environment do +task "themes:advanced_search_banner:3_exclude_and_disable" => :environment do + puts "\n3. Excluding and disabling..." + puts "-----------------------------" components = find_all_components if components.empty?