SPEC: check the existence of logs_url in topic custom field.

SPEC: check the existence of logs_url in topic custom field.

diff --git a/app/controllers/discourse_prometheus_alert_receiver/receiver_controller.rb b/app/controllers/discourse_prometheus_alert_receiver/receiver_controller.rb
index 27910eb..c71f534 100644
--- a/app/controllers/discourse_prometheus_alert_receiver/receiver_controller.rb
+++ b/app/controllers/discourse_prometheus_alert_receiver/receiver_controller.rb
@@ -67,7 +67,7 @@ module DiscoursePrometheusAlertReceiver
     def receive_grouped_alerts
       find_receiver_from_token
 
-      log("Grouped Alert: #{params.except(:data).inspect}")
+      # log("Grouped Alert: #{params.except(:data).inspect}")
 
       Jobs.enqueue(:process_grouped_alerts,
         token: @token,
diff --git a/spec/integration/discourse_prometheus_alert_receiver/receiver_controller_spec.rb b/spec/integration/discourse_prometheus_alert_receiver/receiver_controller_spec.rb
index 457d217..ed6d165 100644
--- a/spec/integration/discourse_prometheus_alert_receiver/receiver_controller_spec.rb
+++ b/spec/integration/discourse_prometheus_alert_receiver/receiver_controller_spec.rb
@@ -709,6 +709,7 @@ RSpec.describe DiscoursePrometheusAlertReceiver::ReceiverController do
 
       let(:response_sla) { '4hours' }
       let(:external_url) { "supposed.to.be.a.url" }
+      let(:logs_url) { "https://logs.example.com/path" }
 
       let!(:assignee) do
         Fabricate(:user).tap do |u|
@@ -721,6 +722,7 @@ RSpec.describe DiscoursePrometheusAlertReceiver::ReceiverController do
           "version" => "4",
           "status" => "firing",
           "externalURL" => external_url,
+          "logsURL" => logs_url,
           "groupKey" => group_key,
           "groupLabels" => {
             "foo" => "bar",
@@ -802,6 +804,7 @@ RSpec.describe DiscoursePrometheusAlertReceiver::ReceiverController do
                 'id' => "somethingfunny",
                 'starts_at' => "2020-01-02T03:04:05.12345678Z",
                 'graph_url' => "http://alerts.example.com/graph?g0.expr=lolrus",
+                'logs_url' => logs_url,
                 'status' => 'firing',
                 'description' => 'some description',
                 'datacenter' => datacenter,
@@ -953,7 +956,7 @@ RSpec.describe DiscoursePrometheusAlertReceiver::ReceiverController do
                 'ends_at' => "2020-01-02T09:08:07.09876543Z",
                 "grafana_url" => "http://graphs.example.com/d/xyzabcefg",
                 'graph_url' => "http://alerts.example.com/graph?g0.expr=lolrus",
-                'logs_url' => "http://logs.example.com/app",
+                'logs_url' => logs_url,
                 'status' => 'resolved',
                 'description' => 'some description',
                 'datacenter' => datacenter,
@@ -986,7 +989,7 @@ RSpec.describe DiscoursePrometheusAlertReceiver::ReceiverController do
           expect(raw).to match(/somethingfunny.*date=2020-01-02 time=09:08:07/)
 
           expect(raw).to include(
-            "[:file_folder:](http://logs.example.com/app#/discover?_g=(time:(from:'2020-01-02T03:04:05Z',mode:absolute,to:'2020-01-02T09:08:07Z')))"
+            "[:file_folder:](#{logs_url}#/discover?_g=(time:(from:'2020-01-02T03:04:05Z',mode:absolute,to:'2020-01-02T09:08:07Z')))"
           )
 
           expect(raw).to include(
@@ -1064,6 +1067,7 @@ RSpec.describe DiscoursePrometheusAlertReceiver::ReceiverController do
                 'id' => "oldalert",
                 'starts_at' => "2020-01-02T03:04:05.12345678Z",
                 'graph_url' => "http://alerts.example.com/graph?g0.expr=lolrus",
+                'logs_url' => logs_url,
                 'status' => 'firing',
                 'description' => 'some description',
                 'datacenter' => datacenter,
@@ -1073,6 +1077,7 @@ RSpec.describe DiscoursePrometheusAlertReceiver::ReceiverController do
                 'id' => "newalert",
                 'starts_at' => "2020-12-31T23:59:59.75645342Z",
                 'graph_url' => "http://alerts.example.com/graph?g0.expr=lolrus",
+                'logs_url' => logs_url,
                 'status' => 'firing',
                 'description' => 'some description',
                 'datacenter' => datacenter,
@@ -1176,6 +1181,7 @@ RSpec.describe DiscoursePrometheusAlertReceiver::ReceiverController do
                   'id' => "oldalert",
                   'starts_at' => "2020-12-31T23:59:59.75645342Z",
                   'graph_url' => "http://alerts.example.com/graph?g0.expr=lolrus",
+                  'logs_url' => logs_url,
                   'status' => 'firing',
                   'description' => 'some description',
                   'datacenter' => datacenter2,
@@ -1256,6 +1262,7 @@ RSpec.describe DiscoursePrometheusAlertReceiver::ReceiverController do
                 'id' => "somethingfunny",
                 'starts_at' => "2020-01-02T03:04:05.12345678Z",
                 'graph_url' => "http://alerts.example.com/graph?g0.expr=lolrus",
+                'logs_url' => logs_url,
                 'status' => 'firing',
                 'description' => 'some description',
                 'datacenter' => datacenter,
@@ -1279,6 +1286,7 @@ RSpec.describe DiscoursePrometheusAlertReceiver::ReceiverController do
                 'id' => "somethingfunny",
                 'starts_at' => "2020-01-02T03:04:05.12345678Z",
                 'graph_url' => "http://alerts.example.com/graph?g0.expr=lolrus",
+                'logs_url' => logs_url,
                 'status' => 'firing',
                 'description' => 'some description',
                 'datacenter' => datacenter,
@@ -1379,6 +1387,7 @@ RSpec.describe DiscoursePrometheusAlertReceiver::ReceiverController do
                 'id' => "anotheralert",
                 'starts_at' => "2020-12-31T23:59:59.98765Z",
                 'graph_url' => "http://alerts.example.com/graph?g0.expr=lolrus",
+                'logs_url' => logs_url,
                 'status' => 'firing',
                 'description' => 'some description',
                 'datacenter' => datacenter,

GitHub sha: 874a1c79