From fe3bad864323731a6c3f904741d3b7d9f19675d4 Mon Sep 17 00:00:00 2001 From: Jason Blais <13119842+jasonblais@users.noreply.github.com> Date: Tue, 21 May 2019 17:51:15 -0400 Subject: [PATCH] Add missing diagnostics for 5.12 (#10868) 1. NotificationLogSettings added with https://github.com/mattermost/mattermost-server/commit/5b252e87366c22df73e335d4623e5a1ef3eeb117#diff-2279f86634da3f787f279961af76713a 1. ServiceSettings.CreateBotAccounts added with https://github.com/mattermost/mattermost-server/commit/30061df0360489f5ebf0be4236be8ec2182f0c3e#diff-2279f86634da3f787f279961af76713a 2. PluginSettings.EnableHealthCheck added with https://github.com/mattermost/mattermost-server/commit/43e95b0b2b90fcceaffdf75ab1d3a11a83be0092#diff-2279f86634da3f787f279961af76713a 3. Change "jira" state diagnostics to be consistent with NPS and Zoom plugins --- app/diagnostics.go | 25 +++++++++++++++++++------ app/diagnostics_test.go | 1 + 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/app/diagnostics.go b/app/diagnostics.go index 1d008dbbba..e13186e3c5 100644 --- a/app/diagnostics.go +++ b/app/diagnostics.go @@ -21,6 +21,7 @@ const ( TRACK_CONFIG_CLIENT_REQ = "config_client_requirements" TRACK_CONFIG_SQL = "config_sql" TRACK_CONFIG_LOG = "config_log" + TRACK_CONFIG_NOTIFICATION_LOG = "config_notifications_log" TRACK_CONFIG_FILE = "config_file" TRACK_CONFIG_RATE = "config_rate" TRACK_CONFIG_EMAIL = "config_email" @@ -291,6 +292,7 @@ func (a *App) trackConfig() { "experimental_channel_organization": *cfg.ServiceSettings.ExperimentalChannelOrganization, "experimental_ldap_group_sync": *cfg.ServiceSettings.ExperimentalLdapGroupSync, "disable_bots_when_owner_is_deactivated": *cfg.ServiceSettings.DisableBotsWhenOwnerIsDeactivated, + "enable_bot_account_creation": *cfg.ServiceSettings.CreateBotAccounts, }) a.SendDiagnostic(TRACK_CONFIG_TEAM, map[string]interface{}{ @@ -357,6 +359,16 @@ func (a *App) trackConfig() { "isdefault_file_location": isDefault(cfg.LogSettings.FileLocation, ""), }) + a.SendDiagnostic(TRACK_CONFIG_NOTIFICATION_LOG, map[string]interface{}{ + "enable_console": *cfg.NotificationLogSettings.EnableConsole, + "console_level": *cfg.NotificationLogSettings.ConsoleLevel, + "console_json": *cfg.NotificationLogSettings.ConsoleJson, + "enable_file": *cfg.NotificationLogSettings.EnableFile, + "file_level": *cfg.NotificationLogSettings.FileLevel, + "file_json": *cfg.NotificationLogSettings.FileJson, + "isdefault_file_location": isDefault(*cfg.NotificationLogSettings.FileLocation, ""), + }) + a.SendDiagnostic(TRACK_CONFIG_PASSWORD, map[string]interface{}{ "minimum_length": *cfg.PasswordSettings.MinimumLength, "lowercase": *cfg.PasswordSettings.Lowercase, @@ -562,12 +574,13 @@ func (a *App) trackConfig() { }) a.SendDiagnostic(TRACK_CONFIG_PLUGIN, map[string]interface{}{ - "enable_jira": pluginSetting(&cfg.PluginSettings, "jira", "enabled", false), - "enable_nps": pluginActivated(cfg.PluginSettings.PluginStates, "com.mattermost.nps"), - "enable_nps_survey": pluginSetting(&cfg.PluginSettings, "com.mattermost.nps", "enablesurvey", false), - "enable_zoom": pluginActivated(cfg.PluginSettings.PluginStates, "zoom"), - "enable": *cfg.PluginSettings.Enable, - "enable_uploads": *cfg.PluginSettings.EnableUploads, + "enable_jira": pluginActivated(cfg.PluginSettings.PluginStates, "jira"), + "enable_nps": pluginActivated(cfg.PluginSettings.PluginStates, "com.mattermost.nps"), + "enable_nps_survey": pluginSetting(&cfg.PluginSettings, "com.mattermost.nps", "enablesurvey", false), + "enable_zoom": pluginActivated(cfg.PluginSettings.PluginStates, "zoom"), + "enable": *cfg.PluginSettings.Enable, + "enable_uploads": *cfg.PluginSettings.EnableUploads, + "enable_health_check": *cfg.PluginSettings.EnableHealthCheck, }) a.SendDiagnostic(TRACK_CONFIG_DATA_RETENTION, map[string]interface{}{ diff --git a/app/diagnostics_test.go b/app/diagnostics_test.go index 0ee95a2e24..9bc82a7489 100644 --- a/app/diagnostics_test.go +++ b/app/diagnostics_test.go @@ -120,6 +120,7 @@ func TestDiagnostics(t *testing.T) { TRACK_CONFIG_TEAM, TRACK_CONFIG_SQL, TRACK_CONFIG_LOG, + TRACK_CONFIG_NOTIFICATION_LOG, TRACK_CONFIG_FILE, TRACK_CONFIG_RATE, TRACK_CONFIG_EMAIL,