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:
<img width="814" height="517" alt="migrate_all console output"
src="https://github.com/user-attachments/assets/5452c038-7d5f-4ae3-a1d0-3b40bf2cb4e6"
/>
This commit is contained in:
Yuriy Kurant
2025-11-12 14:52:20 +08:00
committed by GitHub
parent d231d60fe8
commit 89d948737c
@@ -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?