Add feature flag for apps (#16851)
* Add feature flag for apps * Update default to false * Add plugin version Feature Flag * Fix typo * Only force shutdown, and leave the enable status dependant on the user (defaulting to enable) * Remove unneeded tracking of status * Handle plugin init on startup for locally installed plugin
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
1fb7f512ff
Коммит
9d997dbbde
@@ -97,6 +97,13 @@ func (a *App) SyncPluginsActiveState() {
|
||||
pluginEnabled = state.Enable
|
||||
}
|
||||
|
||||
// Tie Apps proxy disabled status to the feature flag.
|
||||
if pluginID == "com.mattermost.apps" {
|
||||
if !a.Config().FeatureFlags.AppsEnabled {
|
||||
pluginEnabled = false
|
||||
}
|
||||
}
|
||||
|
||||
if pluginEnabled {
|
||||
enabledPlugins = append(enabledPlugins, plugin)
|
||||
} else {
|
||||
|
||||
@@ -373,6 +373,9 @@ func (a *App) installExtractedPlugin(manifest *model.Manifest, fromPluginDir str
|
||||
// Activate the plugin if enabled.
|
||||
pluginState := a.Config().PluginSettings.PluginStates[manifest.Id]
|
||||
if pluginState != nil && pluginState.Enable {
|
||||
if manifest.Id == "com.mattermost.apps" && !a.Config().FeatureFlags.AppsEnabled {
|
||||
return manifest, nil
|
||||
}
|
||||
updatedManifest, _, err := pluginsEnvironment.Activate(manifest.Id)
|
||||
if err != nil {
|
||||
return nil, model.NewAppError("installExtractedPlugin", "app.plugin.restart.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
|
||||
@@ -19,8 +19,13 @@ type FeatureFlags struct {
|
||||
// Toggle on and off support for Collapsed Threads
|
||||
CollapsedThreads bool
|
||||
|
||||
// AppsEnabled toggle the Apps framework functionalities both in server and client side
|
||||
AppsEnabled bool
|
||||
|
||||
// Feature flags to control plugin versions
|
||||
PluginIncidentManagement string `plugin_id:"com.mattermost.plugin-incident-management"`
|
||||
PluginApps string `plugin_id:"com.mattermost.apps"`
|
||||
|
||||
// Toggle on and off support for Files search
|
||||
FilesSearch bool
|
||||
// Feature flag to control setting the TCP_NO_DELAY setting for websockets.
|
||||
@@ -33,7 +38,10 @@ func (f *FeatureFlags) SetDefaults() {
|
||||
f.CloudDelinquentEmailJobsEnabled = false
|
||||
f.CollapsedThreads = false
|
||||
f.FilesSearch = false
|
||||
f.AppsEnabled = false
|
||||
|
||||
f.PluginIncidentManagement = "1.7.0"
|
||||
f.PluginApps = ""
|
||||
f.WebSocketDelay = false
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user