Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 820b506

Browse files
authored
DEV: Hide soon to be deprecated modules settings (#872)
1 parent 945f04b commit 820b506

File tree

8 files changed

+19
-4
lines changed

8 files changed

+19
-4
lines changed

config/settings.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ discourse_ai:
66
ai_toxicity_enabled:
77
default: false
88
client: true
9+
hidden: true
910
ai_toxicity_inference_service_api_endpoint:
10-
default: "https://disorder-testing.demo-by-discourse.com"
11+
default: ""
1112
ai_toxicity_inference_service_api_endpoint_srv:
1213
default: ""
1314
hidden: true
@@ -72,9 +73,11 @@ discourse_ai:
7273
- sentiment
7374
- emotion
7475

75-
ai_nsfw_detection_enabled: false
76+
ai_nsfw_detection_enabled:
77+
default: false
78+
hidden: true
7679
ai_nsfw_inference_service_api_endpoint:
77-
default: "https://nsfw-testing.demo-by-discourse.com"
80+
default: ""
7881
ai_nsfw_inference_service_api_endpoint_srv:
7982
default: ""
8083
hidden: true

spec/lib/modules/toxicity/jobs/regular/toxicity_classify_chat_message_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
before do
88
SiteSetting.ai_toxicity_enabled = true
99
SiteSetting.ai_toxicity_flag_automatically = true
10+
SiteSetting.ai_toxicity_inference_service_api_endpoint = "http://example.com"
1011
end
1112

1213
fab!(:chat_message)

spec/lib/modules/toxicity/jobs/regular/toxicity_classify_post_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
before do
99
SiteSetting.ai_toxicity_enabled = true
1010
SiteSetting.ai_toxicity_flag_automatically = true
11+
SiteSetting.ai_toxicity_inference_service_api_endpoint = "http://example.com"
1112
end
1213

1314
fab!(:post)

spec/lib/modules/toxicity/toxicity_classification_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
describe DiscourseAi::Toxicity::ToxicityClassification do
66
fab!(:target) { Fabricate(:post) }
77

8+
before { SiteSetting.ai_toxicity_inference_service_api_endpoint = "http://example.com" }
9+
810
describe "#request" do
911
it "returns the classification and the model used for it" do
1012
ToxicityInferenceStubs.stub_post_classification(target, toxic: false)

spec/plugin_spec.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
require_relative "support/toxicity_inference_stubs"
44

55
describe Plugin::Instance do
6-
before { SiteSetting.discourse_ai_enabled = true }
6+
before do
7+
SiteSetting.discourse_ai_enabled = true
8+
SiteSetting.ai_toxicity_inference_service_api_endpoint = "http://example.com"
9+
end
710

811
describe "on reviewable_transitioned_to event" do
912
fab!(:post)

spec/shared/chat_message_classificator_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
let(:model) { DiscourseAi::Toxicity::ToxicityClassification.new }
99
let(:classification) { described_class.new(model) }
1010

11+
before { SiteSetting.ai_toxicity_inference_service_api_endpoint = "http://example.com" }
12+
1113
describe "#classify!" do
1214
before { ToxicityInferenceStubs.stub_chat_message_classification(chat_message, toxic: true) }
1315

spec/shared/post_classificator_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
let(:model) { DiscourseAi::Toxicity::ToxicityClassification.new }
99
let(:classification) { described_class.new(model) }
1010

11+
before { SiteSetting.ai_toxicity_inference_service_api_endpoint = "http://example.com" }
12+
1113
describe "#classify!" do
1214
before { ToxicityInferenceStubs.stub_post_classification(post, toxic: true) }
1315

spec/system/toxicity/reviewable_ai_chat_message_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
sign_in(admin)
1111
SiteSetting.ai_toxicity_enabled = true
1212
SiteSetting.ai_toxicity_flag_automatically = true
13+
SiteSetting.ai_toxicity_inference_service_api_endpoint = "http://example.com"
1314

1415
ToxicityInferenceStubs.stub_chat_message_classification(chat_message, toxic: true)
1516

0 commit comments

Comments
 (0)