MM-53355: tidy up plugins (#24194)
* remove feature flag managed plugins * remove unneeded plugin blocklist * remove unnecessary wrappers * documentation and logging improvements * avoid use of global logger * leverage wrapped loggers (e.g. consistently log `plugin_id`) * promote some logs from `Debug` to `Info` for better visibility. * extract installPluginToFilestore * rename some variables for consistency / clarity * make generated
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
0e30d0abb8
Коммит
8372267739
@@ -22,12 +22,6 @@ type FeatureFlags struct {
|
||||
// AppsEnabled toggles the Apps framework functionalities both in server and client side
|
||||
AppsEnabled bool
|
||||
|
||||
// Feature flags to control plugin versions
|
||||
PluginPlaybooks string `plugin_id:"playbooks"`
|
||||
PluginApps string `plugin_id:"com.mattermost.apps"`
|
||||
PluginFocalboard string `plugin_id:"focalboard"`
|
||||
PluginCalls string `plugin_id:"com.mattermost.calls"`
|
||||
|
||||
PermalinkPreviews bool
|
||||
|
||||
// CallsEnabled controls whether or not the Calls plugin should be enabled
|
||||
@@ -64,8 +58,6 @@ func (f *FeatureFlags) SetDefaults() {
|
||||
f.TestBoolFeature = false
|
||||
f.EnableRemoteClusterService = false
|
||||
f.AppsEnabled = true
|
||||
f.PluginApps = ""
|
||||
f.PluginFocalboard = ""
|
||||
f.BoardsDataRetention = false
|
||||
f.NormalizeLdapDNs = false
|
||||
f.GraphQL = false
|
||||
@@ -79,26 +71,6 @@ func (f *FeatureFlags) SetDefaults() {
|
||||
f.DataRetentionConcurrencyEnabled = true
|
||||
}
|
||||
|
||||
func (f *FeatureFlags) Plugins() map[string]string {
|
||||
rFFVal := reflect.ValueOf(f).Elem()
|
||||
rFFType := reflect.TypeOf(f).Elem()
|
||||
|
||||
pluginVersions := make(map[string]string)
|
||||
for i := 0; i < rFFVal.NumField(); i++ {
|
||||
rFieldVal := rFFVal.Field(i)
|
||||
rFieldType := rFFType.Field(i)
|
||||
|
||||
pluginId, hasPluginId := rFieldType.Tag.Lookup("plugin_id")
|
||||
if !hasPluginId {
|
||||
continue
|
||||
}
|
||||
|
||||
pluginVersions[pluginId] = rFieldVal.String()
|
||||
}
|
||||
|
||||
return pluginVersions
|
||||
}
|
||||
|
||||
// ToMap returns the feature flags as a map[string]string
|
||||
// Supports boolean and string feature flags.
|
||||
func (f *FeatureFlags) ToMap() map[string]string {
|
||||
|
||||
Ссылка в новой задаче
Block a user