A platform for community discussion. Free, open, simple.
FEATURE: Add `enable_discourse_workflows` upcoming change (#41541)
Joffrey JAFFEUX2e8b5f94a91c
diff --git a/db/structure.sql b/db/structure.sqlindex c65799d93ee..94d9144015e 100644--- a/db/structure.sql+++ b/db/structure.sql@@ -22469,6 +22469,7 @@ ALTER TABLE ONLY public.ad_plugin_house_ads_groupsSET search_path TO "$user", public;INSERT INTO "schema_migrations" (version) VALUES+('20260708095336'),('20260708080308'),('20260707013407'),('20260702102111'),diff --git a/plugins/chat/app/services/chat/workflows/approval/resume.rb b/plugins/chat/app/services/chat/workflows/approval/resume.rbindex e7279ec8ca4..63cc795852a 100644--- a/plugins/chat/app/services/chat/workflows/approval/resume.rb+++ b/plugins/chat/app/services/chat/workflows/approval/resume.rb@@ -23,7 +23,7 @@ module Chatprivatedef workflows_enabled- SiteSetting.discourse_workflows_enabled+ SiteSetting.enable_discourse_workflowsenddef fetch_resume_request(params:)diff --git a/plugins/chat/plugin.rb b/plugins/chat/plugin.rbindex fb95365468d..59355f1dbfe 100644--- a/plugins/chat/plugin.rb+++ b/plugins/chat/plugin.rb@@ -124,7 +124,7 @@ after_initialize doendon(:chat_message_interaction) do |interaction|- next unless SiteSetting.discourse_workflows_enabled+ next unless SiteSetting.enable_discourse_workflowsaction_id = interaction.action&.dig("action_id").to_snext if action_id.blank?diff --git a/plugins/chat/spec/integration/workflows_chat_approval_spec.rb b/plugins/chat/spec/integration/workflows_chat_approval_spec.rbindex 8a12c433548..1c2bf709895 100644--- a/plugins/chat/spec/integration/workflows_chat_approval_spec.rb+++ b/plugins/chat/spec/integration/workflows_chat_approval_spec.rb@@ -7,7 +7,7 @@ RSpec.describe "Wait for Approval end-to-end" dobefore doSiteSetting.chat_enabled = true- SiteSetting.discourse_workflows_enabled = true+ SiteSetting.enable_discourse_workflows = trueenddef run_pending_approval_jobdiff --git a/plugins/chat/spec/integration/workflows_chat_interaction_spec.rb b/plugins/chat/spec/integration/workflows_chat_interaction_spec.rbindex 24c05fdf56c..c04b9bce876 100644--- a/plugins/chat/spec/integration/workflows_chat_interaction_spec.rb+++ b/plugins/chat/spec/integration/workflows_chat_interaction_spec.rb@@ -7,7 +7,7 @@ RSpec.describe "Chat interaction listener for workflow approvals" dobefore doSiteSetting.chat_enabled = true- SiteSetting.discourse_workflows_enabled = true+ SiteSetting.enable_discourse_workflows = trueendit "enqueues ResumeWorkflowApproval when an approve button is clicked" dodiff --git a/plugins/chat/spec/integration/workflows_chat_message_created_spec.rb b/plugins/chat/spec/integration/workflows_chat_message_created_spec.rbindex 5839777a20b..d66a11bcc54 100644--- a/plugins/chat/spec/integration/workflows_chat_message_created_spec.rb+++ b/plugins/chat/spec/integration/workflows_chat_message_created_spec.rb@@ -7,7 +7,7 @@ RSpec.describe "Chat message created workflow trigger" dobefore doSiteSetting.chat_enabled = true- SiteSetting.discourse_workflows_enabled = true+ SiteSetting.enable_discourse_workflows = trueendit "enqueues matching workflows when a chat message is created" dodiff --git a/plugins/chat/spec/services/chat/workflows/approval/resume_spec.rb b/plugins/chat/spec/services/chat/workflows/approval/resume_spec.rbindex 4c250b4e14e..6d11280a0e7 100644--- a/plugins/chat/spec/services/chat/workflows/approval/resume_spec.rb+++ b/plugins/chat/spec/services/chat/workflows/approval/resume_spec.rb@@ -26,11 +26,11 @@ RSpec.describe Chat::Workflows::Approval::Resume dobefore doSiteSetting.chat_enabled = true- SiteSetting.discourse_workflows_enabled = true+ SiteSetting.enable_discourse_workflows = trueendcontext "when plugin is disabled" do- before { SiteSetting.discourse_workflows_enabled = false }+ before { SiteSetting.enable_discourse_workflows = false }it { is_expected.to fail_a_policy(:workflows_enabled) }enddiff --git a/plugins/discourse-assign/spec/lib/assigner_spec.rb b/plugins/discourse-assign/spec/lib/assigner_spec.rbindex 65267b342c6..011ee42d4dd 100644--- a/plugins/discourse-assign/spec/lib/assigner_spec.rb+++ b/plugins/discourse-assign/spec/lib/assigner_spec.rb@@ -157,7 +157,7 @@ RSpec.describe Assigner doendit "enqueues assigned workflows matching the assignment target" do- SiteSetting.discourse_workflows_enabled = true+ SiteSetting.enable_discourse_workflows = trueJobs::DiscourseWorkflows::ExecuteWorkflow.jobs.clearDiscourseWorkflows::Registry.reset_indexes!diff --git a/plugins/discourse-assign/spec/lib/discourse_workflows/nodes/assign_topic/v1_spec.rb b/plugins/discourse-assign/spec/lib/discourse_workflows/nodes/assign_topic/v1_spec.rbindex 784cf7e2c76..93ffede9cc5 100644--- a/plugins/discourse-assign/spec/lib/discourse_workflows/nodes/assign_topic/v1_spec.rb+++ b/plugins/discourse-assign/spec/lib/discourse_workflows/nodes/assign_topic/v1_spec.rb@@ -11,7 +11,7 @@ RSpec.describe DiscourseWorkflows::Nodes::AssignTopic::V1 doafter { sandbox.dispose }before do- SiteSetting.discourse_workflows_enabled = true+ SiteSetting.enable_discourse_workflows = trueSiteSetting.assign_enabled = trueenddiff --git a/plugins/discourse-assign/spec/lib/discourse_workflows/nodes/assigned/v1_spec.rb b/plugins/discourse-assign/spec/lib/discourse_workflows/nodes/assigned/v1_spec.rbindex fd8cf89310a..262c07057b9 100644--- a/plugins/discourse-assign/spec/lib/discourse_workflows/nodes/assigned/v1_spec.rb+++ b/plugins/discourse-assign/spec/lib/discourse_workflows/nodes/assigned/v1_spec.rb@@ -9,7 +9,7 @@ RSpec.describe DiscourseWorkflows::Nodes::Assigned::V1 dobefore doSiteSetting.assign_enabled = true- SiteSetting.discourse_workflows_enabled = true+ SiteSetting.enable_discourse_workflows = trueenddescribe "#valid?" dodiff --git a/plugins/discourse-workflows/app/jobs/regular/discourse_workflows/execute_manual_workflow.rb b/plugins/discourse-workflows/app/jobs/regular/discourse_workflows/execute_manual_workflow.rbindex 7a4293da32e..0b99722187c 100644--- a/plugins/discourse-workflows/app/jobs/regular/discourse_workflows/execute_manual_workflow.rb+++ b/plugins/discourse-workflows/app/jobs/regular/discourse_workflows/execute_manual_workflow.rb@@ -10,7 +10,7 @@ module Jobs)return if !execution&.pending?- if !SiteSetting.discourse_workflows_enabled+ if !SiteSetting.enable_discourse_workflowsexecution.update!(status: :skipped, finished_at: Time.current)returnenddiff --git a/plugins/discourse-workflows/app/jobs/regular/discourse_workflows/resume_waiting_execution.rb b/plugins/discourse-workflows/app/jobs/regular/discourse_workflows/resume_waiting_execution.rbindex e41cba33ecd..a8d4de109e1 100644--- a/plugins/discourse-workflows/app/jobs/regular/discourse_workflows/resume_waiting_execution.rb+++ b/plugins/discourse-workflows/app/jobs/regular/discourse_workflows/resume_waiting_execution.rb@@ -4,7 +4,7 @@ module Jobsmodule DiscourseWorkflowsclass ResumeWaitingExecution < ::Jobs::Basedef execute(args)- return unless SiteSetting.discourse_workflows_enabled+ return unless SiteSetting.enable_discourse_workflowsexecution = ::DiscourseWorkflows::Execution.find_by(id: args[:execution_id])return if execution.nil? || !execution.waiting?diff --git a/plugins/discourse-workflows/app/jobs/regular/discourse_workflows/resume_webhook_waiting.rb b/plugins/discourse-workflows/app/jobs/regular/discourse_workflows/resume_webhook_waiting.rbindex c5db7987d06..dc625b5e0a4 100644--- a/plugins/discourse-workflows/app/jobs/regular/discourse_workflows/resume_webhook_waiting.rb+++ b/plugins/discourse-workflows/app/jobs/regular/discourse_workflows/resume_webhook_waiting.rb@@ -4,7 +4,7 @@ module Jobsmodule DiscourseWorkflowsclass ResumeWebhookWaiting < ::Jobs::Basedef execute(args)- return unless SiteSetting.discourse_workflows_enabled+ return unless SiteSetting.enable_discourse_workflowsexecution =::DiscourseWorkflows::Execution.find_by(id: args[:execution_id], status: :waiting)diff --git a/plugins/discourse-workflows/app/services/discourse_workflows/policy/workflows_enabled.rb b/plugins/discourse-workflows/app/services/discourse_workflows/policy/workflows_enabled.rbindex 176cfb71c14..ffcc7cded98 100644--- a/plugins/discourse-workflows/app/services/discourse_workflows/policy/workflows_enabled.rb+++ b/plugins/discourse-workflows/app/services/discourse_workflows/policy/workflows_enabled.rb@@ -3,7 +3,7 @@module DiscourseWorkflowsclass Policy::WorkflowsEnabled < Service::PolicyBasedef call- SiteSetting.discourse_workflows_enabled+ SiteSetting.enable_discourse_workflowsenddef reasondiff --git a/plugins/discourse-workflows/config/locales/server.en.yml b/plugins/discourse-workflows/config/locales/server.en.ymlindex 18e3255a6c0..fc863661c68 100644--- a/plugins/discourse-workflows/config/locales/server.en.yml+++ b/plugins/discourse-workflows/config/locales/server.en.yml@@ -146,7 +146,7 @@ en:split_out:field_not_found: "The field '%{field}' wasn't found in any input item."site_settings:- discourse_workflows_enabled: "Enable the discourse-workflows plugin."+ enable_discourse_workflows: "Enable the discourse-workflows plugin."discourse_workflows_ai_authoring_enabled: "Enable AI-assisted workflow authoring."discourse_workflows_ai_authoring_max_prompt_length: "Maximum length for AI workflow authoring prompts."discourse_workflows_ai_authoring_rate_limit_per_minute: "Maximum AI workflow authoring requests per minute per user."diff --git a/plugins/discourse-workflows/config/settings.yml b/plugins/discourse-workflows/config/settings.ymlindex 7bda0b7dcdb..43a73303c0d 100644--- a/plugins/discourse-workflows/config/settings.yml+++ b/plugins/discourse-workflows/config/settings.yml@@ -1,8 +1,14 @@plugins:- discourse_workflows_enabled:+ enable_discourse_workflows:default: falseclient: truehidden: true+ upcoming_change:+ status: "experimental"+ impact: "feature,admins"+ learn_more_url: "https://meta.discourse.org/t/-/406990"+ allow_enabled_for:+ - everyonediscourse_workflows_ai_authoring_enabled:default: falseclient: truediff --git a/plugins/discourse-workflows/db/migrate/20260708095336_rename_discourse_workflows_enabled_site_setting.rb b/plugins/discourse-workflows/db/migrate/20260708095336_rename_discourse_workflows_enabled_site_setting.rbnew file mode 100644index 00000000000..ad97da1e24a--- /dev/null+++ b/plugins/discourse-workflows/db/migrate/20260708095336_rename_discourse_workflows_enabled_site_setting.rb@@ -0,0 +1,11 @@+# frozen_string_literal: true++class RenameDiscourseWorkflowsEnabledSiteSetting < ActiveRecord::Migration[8.0]+ def up+ execute "UPDATE site_settings SET name = 'enable_discourse_workflows' WHERE name = 'discourse_workflows_enabled'"+ end++ def down+ execute "UPDATE site_settings SET name = 'discourse_workflows_enabled' WHERE name = 'enable_discourse_workflows'"+ end+enddiff --git a/plugins/discourse-workflows/lib/discourse_workflows/ai_authoring_enqueuer.rb b/plugins/discourse-workflows/lib/discourse_workflows/ai_authoring_enqueuer.rbindex 115c065e447..60bb074a9c7 100644--- a/plugins/discourse-workflows/lib/discourse_workflows/ai_authoring_enqueuer.rb+++ b/plugins/discourse-workflows/lib/discourse_workflows/ai_authoring_enqueuer.rb@@ -3,7 +3,7 @@module DiscourseWorkflowsclass AiAuthoringEnqueuerdef self.enabled?- SiteSetting.discourse_workflows_enabled &&+ SiteSetting.enable_discourse_workflows &&SiteSetting.discourse_workflows_ai_authoring_enabled && defined?(DiscourseAi).present?enddiff --git a/plugins/discourse-workflows/lib/discourse_workflows/dev_populator.rb b/plugins/discourse-workflows/lib/discourse_workflows/dev_populator.rbindex 8d347610b63..6333a3b962b 100644--- a/plugins/discourse-workflows/lib/discourse_workflows/dev_populator.rb+++ b/plugins/discourse-workflows/lib/discourse_workflows/dev_populator.rb@@ -14,9 +14,7 @@ module DiscourseWorkflowsraise "Workflow examples are only supported in development environment"end- if !SiteSetting.discourse_workflows_enabled- SiteSetting.set(:discourse_workflows_enabled, true)- end+ SiteSetting.set(:enable_discourse_workflows, true) if !SiteSetting.enable_discourse_workflowsensure_manual_log_workflow!ensure_topic_admin_button_workflow!diff --git a/plugins/discourse-workflows/lib/discourse_workflows/event_listener.rb b/plugins/discourse-workflows/lib/discourse_workflows/event_listener.rbindex d9a83f4cf93..77bb9c9c854 100644--- a/plugins/discourse-workflows/lib/discourse_workflows/event_listener.rb+++ b/plugins/discourse-workflows/lib/discourse_workflows/event_listener.rb@@ -3,7 +3,7 @@module DiscourseWorkflowsclass EventListenerdef self.handle(trigger_class, *args)- return unless SiteSetting.discourse_workflows_enabled+ return unless SiteSetting.enable_discourse_workflowsreturn if WorkflowDependency.active_node_types.exclude?(trigger_class.identifier)trigger = trigger_class.new(*args)diff --git a/plugins/discourse-workflows/lib/discourse_workflows/workflow_call_continuation.rb b/plugins/discourse-workflows/lib/discourse_workflows/workflow_call_continuation.rbindex 6b9f554ef35..863e765de11 100644--- a/plugins/discourse-workflows/lib/discourse_workflows/workflow_call_continuation.rb+++ b/plugins/discourse-workflows/lib/discourse_workflows/workflow_call_continuation.rb@@ -22,7 +22,7 @@ module DiscourseWorkflowsenddef run!(run_id:)- return unless SiteSetting.discourse_workflows_enabled+ return unless SiteSetting.enable_discourse_workflowsrun = WorkflowCallRun.find_by(id: run_id)return if run.blank?diff --git a/plugins/discourse-workflows/plugin.rb b/plugins/discourse-workflows/plugin.rbindex d227fc94e86..836fe7f4a59 100644--- a/plugins/discourse-workflows/plugin.rb+++ b/plugins/discourse-workflows/plugin.rb@@ -2,12 +2,12 @@# name: discourse-workflows# about: Workflow automation system for Discourse-# meta_topic_id: 402418+# meta_topic_id: 406990# version: 0.1# authors: Discourse# url: https://github.com/discourse/discourse-workflows-enabled_site_setting :discourse_workflows_enabled+enabled_site_setting :enable_discourse_workflowsmodule ::DiscourseWorkflowsPLUGIN_NAME = "discourse-workflows"@@ -131,9 +131,21 @@ after_initialize doendon(:site_setting_changed) do |name, old_value, new_value|- next if name != :discourse_workflows_enabled+ next if name != :enable_discourse_workflowsnext unless new_value && !old_valueDiscourseWorkflows::PluginEnableHandler.handle!end++ # Automatic promotion of an upcoming change does not write the site setting,+ # so :site_setting_changed never fires for it. See UpcomingChanges::NotifyPromotion.+ on(:upcoming_change_enabled) do |name|+ next if name != :enable_discourse_workflows++ # A manual opt-in writes the setting before this event fires, so the+ # :site_setting_changed hook above has already run.+ next if SiteSetting.setting_modified_from_default?(:enable_discourse_workflows)++ DiscourseWorkflows::PluginEnableHandler.handle!+ endenddiff --git a/plugins/discourse-workflows/public/images/upcoming_changes/enable_discourse_workflows.png b/plugins/discourse-workflows/public/images/upcoming_changes/enable_discourse_workflows.pngnew file mode 100644index 00000000000..c62d36720e9Binary files /dev/null and b/plugins/discourse-workflows/public/images/upcoming_changes/enable_discourse_workflows.png differdiff --git a/plugins/discourse-workflows/spec/db/migrate/rename_discourse_workflows_enabled_site_setting_spec.rb b/plugins/discourse-workflows/spec/db/migrate/rename_discourse_workflows_enabled_site_setting_spec.rbnew file mode 100644index 00000000000..80118454a35--- /dev/null+++ b/plugins/discourse-workflows/spec/db/migrate/rename_discourse_workflows_enabled_site_setting_spec.rb@@ -0,0 +1,57 @@+# frozen_string_literal: true++require Rails.root.join(+ "plugins/discourse-workflows/db/migrate/20260708095336_rename_discourse_workflows_enabled_site_setting",+ )++RSpec.describe RenameDiscourseWorkflowsEnabledSiteSetting do+ subject(:migration) { described_class.new }++ let(:connection) { ActiveRecord::Base.connection }++ around { |example| ActiveRecord::Migration.suppress_messages { example.run } }++ before { delete_workflow_settings }++ after { delete_workflow_settings }++ def delete_workflow_settings+ connection.execute(<<~SQL)+ DELETE FROM site_settings+ WHERE name IN ('discourse_workflows_enabled', 'enable_discourse_workflows')+ SQL+ end++ def store_setting(name, value)+ connection.execute(<<~SQL)+ INSERT INTO site_settings (name, data_type, value, created_at, updated_at)+ VALUES ('#{name}', 5, '#{value}', NOW(), NOW())+ SQL+ end++ def setting_value(name)+ DB.query_single("SELECT value FROM site_settings WHERE name = :name", name: name).first+ end++ it "preserves enabled customer opt-ins" do+ store_setting("discourse_workflows_enabled", "t")++ migration.up++ aggregate_failures do+ expect(setting_value("discourse_workflows_enabled")).to be_nil+ expect(setting_value("enable_discourse_workflows")).to eq("t")+ end+ end++ it "restores the old setting name on rollback" do+ store_setting("enable_discourse_workflows", "t")++ migration.down++ aggregate_failures do+ expect(setting_value("enable_discourse_workflows")).to be_nil+ expect(setting_value("discourse_workflows_enabled")).to eq("t")+ end+ end+enddiff --git a/plugins/discourse-workflows/spec/integration/plugin_enable_hook_spec.rb b/plugins/discourse-workflows/spec/integration/plugin_enable_hook_spec.rbindex 9f9ea7364e5..e853783540f 100644--- a/plugins/discourse-workflows/spec/integration/plugin_enable_hook_spec.rb+++ b/plugins/discourse-workflows/spec/integration/plugin_enable_hook_spec.rb@@ -1,6 +1,6 @@# frozen_string_literal: true-describe "discourse_workflows_enabled site setting hook" do+describe "enable_discourse_workflows site setting hook" dofab!(:workflow) { Fabricate(:discourse_workflows_workflow, published: true) }fab!(:execution) doFabricate(@@ -12,29 +12,29 @@ describe "discourse_workflows_enabled site setting hook" doendit "reschedules waiting executions when the setting flips false to true" do- SiteSetting.discourse_workflows_enabled = false+ SiteSetting.enable_discourse_workflows = falseexpect_enqueued_with(job: Jobs::DiscourseWorkflows::ResumeWaitingExecution,args: {execution_id: execution.id,},- ) { SiteSetting.discourse_workflows_enabled = true }+ ) { SiteSetting.enable_discourse_workflows = true }endit "does not reschedule when the setting flips true to false" do- SiteSetting.discourse_workflows_enabled = true+ SiteSetting.enable_discourse_workflows = trueexpect_not_enqueued_with(job: Jobs::DiscourseWorkflows::ResumeWaitingExecution,args: {execution_id: execution.id,},- ) { SiteSetting.discourse_workflows_enabled = false }+ ) { SiteSetting.enable_discourse_workflows = false }endit "does not reschedule for unrelated setting changes" do- SiteSetting.discourse_workflows_enabled = true+ SiteSetting.enable_discourse_workflows = trueexpect_not_enqueued_with(job: Jobs::DiscourseWorkflows::ResumeWaitingExecution,@@ -43,4 +43,51 @@ describe "discourse_workflows_enabled site setting hook" do},) { SiteSetting.title = "Different title" }end++ describe "when the upcoming change is automatically promoted" do+ # Promotion leaves no override in the database, so :site_setting_changed never+ # fires. The setting reads as enabled purely because the change has reached+ # promote_upcoming_changes_on_status.+ before do+ SiteSetting.remove_override!(:enable_discourse_workflows)+ SiteSetting.promote_upcoming_changes_on_status = :experimental+ end++ after { SiteSetting.promote_upcoming_changes_on_status = :beta }++ it "reschedules waiting executions" do+ expect_enqueued_with(+ job: Jobs::DiscourseWorkflows::ResumeWaitingExecution,+ args: {+ execution_id: execution.id,+ },+ ) { DiscourseEvent.trigger(:upcoming_change_enabled, :enable_discourse_workflows) }+ end++ it "does nothing for an unrelated upcoming change" do+ DiscourseWorkflows::PluginEnableHandler.expects(:handle!).never++ DiscourseEvent.trigger(:upcoming_change_enabled, :enable_upload_debug_mode)+ end+ end++ describe "when an admin manually opts in to the upcoming change" do+ fab!(:admin)++ before { SiteSetting.remove_override!(:enable_discourse_workflows) }++ it "handles the enable exactly once" do+ # Toggle writes the setting (firing :site_setting_changed) and then fires+ # :upcoming_change_enabled, so the handler must not run twice.+ DiscourseWorkflows::PluginEnableHandler.expects(:handle!).once++ UpcomingChanges::Toggle.call(+ params: {+ setting_name: :enable_discourse_workflows,+ enabled: true,+ },+ guardian: admin.guardian,+ )+ end+ endenddiff --git a/plugins/discourse-workflows/spec/jobs/regular/discourse_workflows/execute_manual_workflow_spec.rb b/plugins/discourse-workflows/spec/jobs/regular/discourse_workflows/execute_manual_workflow_spec.rbindex c21fa585ef4..84aaf5bdf06 100644--- a/plugins/discourse-workflows/spec/jobs/regular/discourse_workflows/execute_manual_workflow_spec.rb+++ b/plugins/discourse-workflows/spec/jobs/regular/discourse_workflows/execute_manual_workflow_spec.rb@@ -37,7 +37,7 @@ RSpec.describe Jobs::DiscourseWorkflows::ExecuteManualWorkflow doendit "skips the execution when the plugin is disabled" do- SiteSetting.discourse_workflows_enabled = false+ SiteSetting.enable_discourse_workflows = falseworkflow = Fabricate(:discourse_workflows_workflow, created_by: admin)execution = pending_execution(workflow: workflow)diff --git a/plugins/discourse-workflows/spec/jobs/regular/discourse_workflows/resume_waiting_execution_spec.rb b/plugins/discourse-workflows/spec/jobs/regular/discourse_workflows/resume_waiting_execution_spec.rbindex a8a0421f258..2aecc7f9f21 100644--- a/plugins/discourse-workflows/spec/jobs/regular/discourse_workflows/resume_waiting_execution_spec.rb+++ b/plugins/discourse-workflows/spec/jobs/regular/discourse_workflows/resume_waiting_execution_spec.rb@@ -12,7 +12,7 @@ RSpec.describe Jobs::DiscourseWorkflows::ResumeWaitingExecution doendit "leaves the execution waiting when the plugin is disabled" do- SiteSetting.discourse_workflows_enabled = false+ SiteSetting.enable_discourse_workflows = falsebefore_updated_at = execution.updated_atdescribed_class.new.execute(execution_id: execution.id)diff --git a/plugins/discourse-workflows/spec/jobs/regular/discourse_workflows/resume_webhook_waiting_spec.rb b/plugins/discourse-workflows/spec/jobs/regular/discourse_workflows/resume_webhook_waiting_spec.rbindex d046169e997..c334384c778 100644--- a/plugins/discourse-workflows/spec/jobs/regular/discourse_workflows/resume_webhook_waiting_spec.rb+++ b/plugins/discourse-workflows/spec/jobs/regular/discourse_workflows/resume_webhook_waiting_spec.rb@@ -7,7 +7,7 @@ RSpec.describe Jobs::DiscourseWorkflows::ResumeWebhookWaiting doendit "leaves the execution waiting when the plugin is disabled" do- SiteSetting.discourse_workflows_enabled = false+ SiteSetting.enable_discourse_workflows = falsebefore_updated_at = execution.updated_atdescribed_class.new.execute(execution_id: execution.id)diff --git a/plugins/discourse-workflows/spec/lib/discourse_workflows/event_listener_spec.rb b/plugins/discourse-workflows/spec/lib/discourse_workflows/event_listener_spec.rbindex c13a1452063..3782e5f6e08 100644--- a/plugins/discourse-workflows/spec/lib/discourse_workflows/event_listener_spec.rb+++ b/plugins/discourse-workflows/spec/lib/discourse_workflows/event_listener_spec.rb@@ -29,7 +29,7 @@ RSpec.describe DiscourseWorkflows::EventListener doendit "does not enqueue when plugin is disabled" do- SiteSetting.discourse_workflows_enabled = false+ SiteSetting.enable_discourse_workflows = falsegraph = build_workflow_graph { |g| g.node "trigger-1", "trigger:topic_closed" }workflow = Fabricate(:discourse_workflows_workflow, created_by: user, published: true, **graph)diff --git a/plugins/discourse-workflows/spec/lib/discourse_workflows/executor_spec.rb b/plugins/discourse-workflows/spec/lib/discourse_workflows/executor_spec.rbindex fa137f7690f..2cbea60ccb7 100644--- a/plugins/discourse-workflows/spec/lib/discourse_workflows/executor_spec.rb+++ b/plugins/discourse-workflows/spec/lib/discourse_workflows/executor_spec.rb@@ -677,7 +677,7 @@ RSpec.describe DiscourseWorkflows::Executor dolet(:plugin) dop = Plugin::Instance.new- p.enabled_site_setting(:discourse_workflows_enabled)+ p.enabled_site_setting(:enable_discourse_workflows)penddiff --git a/plugins/discourse-workflows/spec/plugin_helper.rb b/plugins/discourse-workflows/spec/plugin_helper.rbindex d4ab6753775..f270130b524 100644--- a/plugins/discourse-workflows/spec/plugin_helper.rb+++ b/plugins/discourse-workflows/spec/plugin_helper.rb@@ -7,7 +7,7 @@ module DiscourseWorkflowsSpecHelperincluded dobefore do- SiteSetting.discourse_workflows_enabled = true+ SiteSetting.enable_discourse_workflows = trueSiteSetting.external_system_avatars_url = "https://example.com/avatar/{username}.png"DiscourseWorkflows::Registry.reset_indexes!Jobs::DiscourseWorkflows::ExecuteWorkflow.jobs.cleardiff --git a/plugins/discourse-workflows/spec/requests/discourse_workflows/webhooks_controller_spec.rb b/plugins/discourse-workflows/spec/requests/discourse_workflows/webhooks_controller_spec.rbindex d4f8b74af11..0de1e122e69 100644--- a/plugins/discourse-workflows/spec/requests/discourse_workflows/webhooks_controller_spec.rb+++ b/plugins/discourse-workflows/spec/requests/discourse_workflows/webhooks_controller_spec.rb@@ -57,7 +57,7 @@ RSpec.describe DiscourseWorkflows::WebhooksController doendit "returns 404 when plugin is disabled" do- SiteSetting.discourse_workflows_enabled = false+ SiteSetting.enable_discourse_workflows = falsepost "/workflows/webhooks/my-hook.json"expect(response).to have_http_status(:not_found)enddiff --git a/plugins/discourse-workflows/spec/services/discourse_workflows/execution/check_schedules_spec.rb b/plugins/discourse-workflows/spec/services/discourse_workflows/execution/check_schedules_spec.rbindex 24312d23e06..77f351f3f7b 100644--- a/plugins/discourse-workflows/spec/services/discourse_workflows/execution/check_schedules_spec.rb+++ b/plugins/discourse-workflows/spec/services/discourse_workflows/execution/check_schedules_spec.rb@@ -25,7 +25,7 @@ RSpec.describe DiscourseWorkflows::Execution::CheckSchedules doendcontext "when plugin is disabled" do- before { SiteSetting.discourse_workflows_enabled = false }+ before { SiteSetting.enable_discourse_workflows = false }it { is_expected.to fail_a_policy(:workflows_enabled) }enddiff --git a/plugins/discourse-workflows/spec/services/discourse_workflows/execution/check_stale_topics_spec.rb b/plugins/discourse-workflows/spec/services/discourse_workflows/execution/check_stale_topics_spec.rbindex f5f3955a5ae..fa1e25f311d 100644--- a/plugins/discourse-workflows/spec/services/discourse_workflows/execution/check_stale_topics_spec.rb+++ b/plugins/discourse-workflows/spec/services/discourse_workflows/execution/check_stale_topics_spec.rb@@ -15,7 +15,7 @@ RSpec.describe DiscourseWorkflows::Execution::CheckStaleTopics doendcontext "when plugin is disabled" do- before { SiteSetting.discourse_workflows_enabled = false }+ before { SiteSetting.enable_discourse_workflows = false }it { is_expected.to fail_a_policy(:workflows_enabled) }enddiff --git a/plugins/discourse-workflows/spec/services/discourse_workflows/execution/expire_waiting_spec.rb b/plugins/discourse-workflows/spec/services/discourse_workflows/execution/expire_waiting_spec.rbindex a46aa3c52ae..fb7137ab69d 100644--- a/plugins/discourse-workflows/spec/services/discourse_workflows/execution/expire_waiting_spec.rb+++ b/plugins/discourse-workflows/spec/services/discourse_workflows/execution/expire_waiting_spec.rb@@ -28,7 +28,7 @@ RSpec.describe DiscourseWorkflows::Execution::ExpireWaiting doendcontext "when plugin is disabled" do- before { SiteSetting.discourse_workflows_enabled = false }+ before { SiteSetting.enable_discourse_workflows = false }it { is_expected.to fail_a_policy(:workflows_enabled) }enddiff --git a/plugins/discourse-workflows/spec/services/discourse_workflows/workflow/execute_spec.rb b/plugins/discourse-workflows/spec/services/discourse_workflows/workflow/execute_spec.rbindex 9e74e2a1a51..a115b0d5b95 100644--- a/plugins/discourse-workflows/spec/services/discourse_workflows/workflow/execute_spec.rb+++ b/plugins/discourse-workflows/spec/services/discourse_workflows/workflow/execute_spec.rb@@ -23,7 +23,7 @@ RSpec.describe DiscourseWorkflows::Workflow::Execute doendcontext "when workflows are not enabled" do- before { SiteSetting.discourse_workflows_enabled = false }+ before { SiteSetting.enable_discourse_workflows = false }it { is_expected.to fail_a_policy(:can_execute) }end