summaryrefslogtreecommitdiffstats
path: root/app/diagnostics.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-08-02 01:36:54 -0700
committerGitHub <noreply@github.com>2017-08-02 01:36:54 -0700
commit65817e13c7900ea81947e40e177459cfea8acee4 (patch)
tree8dfc88db36844e4186b4110753be8de976da6371 /app/diagnostics.go
parentc6bf235ec2a8613d8ef35607e2aeb8c0cb629f45 (diff)
downloadchat-65817e13c7900ea81947e40e177459cfea8acee4.tar.gz
chat-65817e13c7900ea81947e40e177459cfea8acee4.tar.bz2
chat-65817e13c7900ea81947e40e177459cfea8acee4.zip
PLT-6965 jira integration (plus plugin scaffolding) (#6918)
* plugin scaffolding / jira integration * add vendored testify packages * webhook fix * don't change i18n ids * support configuration watching * add basic jira plugin configuration to admin console * fix eslint errors * fix another eslint warning * polish * undo unintentional config.json commit >:( * test fix * add jira plugin diagnostics, remove dm support, add bot tag, generate web-safe secrets * rebase, implement requested changes * requested changes * remove tests and minimize makefile change * add missing license headers * add missing comma * remove bad line from Makefile
Diffstat (limited to 'app/diagnostics.go')
-rw-r--r--app/diagnostics.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/app/diagnostics.go b/app/diagnostics.go
index 603ceb8a5..a22e87587 100644
--- a/app/diagnostics.go
+++ b/app/diagnostics.go
@@ -4,6 +4,7 @@
package app
import (
+ "encoding/json"
"log"
"os"
"runtime"
@@ -38,6 +39,7 @@ const (
TRACK_CONFIG_ANALYTICS = "config_analytics"
TRACK_CONFIG_ANNOUNCEMENT = "config_announcement"
TRACK_CONFIG_ELASTICSEARCH = "config_elasticsearch"
+ TRACK_CONFIG_PLUGIN = "config_plugin"
TRACK_ACTIVITY = "activity"
TRACK_LICENSE = "license"
@@ -87,6 +89,23 @@ func isDefault(setting interface{}, defaultValue interface{}) bool {
return false
}
+func pluginSetting(plugin, key string, defaultValue interface{}) interface{} {
+ settings, ok := utils.Cfg.PluginSettings.Plugins[plugin]
+ if !ok {
+ return defaultValue
+ }
+ var m map[string]interface{}
+ if b, err := json.Marshal(settings); err != nil {
+ return defaultValue
+ } else {
+ json.Unmarshal(b, &m)
+ }
+ if value, ok := m[key]; ok {
+ return value
+ }
+ return defaultValue
+}
+
func trackActivity() {
var userCount int64
var activeUserCount int64
@@ -393,6 +412,10 @@ func trackConfig() {
"enable_searching": *utils.Cfg.ElasticsearchSettings.EnableSearching,
"sniff": *utils.Cfg.ElasticsearchSettings.Sniff,
})
+
+ SendDiagnostic(TRACK_CONFIG_PLUGIN, map[string]interface{}{
+ "enable_jira": pluginSetting("jira", "enabled", false),
+ })
}
func trackLicense() {