Skip to content

Commit

Permalink
Fully deprecate CallsEnabled feature flag (mattermost#27826)
Browse files Browse the repository at this point in the history
Co-authored-by: Mattermost Build <[email protected]>
  • Loading branch information
streamer45 and mattermost-build authored Aug 1, 2024
1 parent 499977d commit 453eabb
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 64 deletions.
4 changes: 0 additions & 4 deletions server/channels/app/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -1226,10 +1226,6 @@ func (ch *Channels) getPluginStateOverride(pluginID string) (bool, bool) {
if !ch.cfgSvc.Config().FeatureFlags.AppsEnabled {
return true, false
}
case model.PluginIdCalls:
if !ch.cfgSvc.Config().FeatureFlags.CallsEnabled {
return true, false
}
}

return false, false
Expand Down
56 changes: 0 additions & 56 deletions server/channels/app/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1378,62 +1378,6 @@ func TestGetPluginStateOverride(t *testing.T) {
require.False(t, value)
})

t.Run("calls override", func(t *testing.T) {
t.Run("on-prem", func(t *testing.T) {
overrides, value := th.App.ch.getPluginStateOverride("com.mattermost.calls")
require.False(t, overrides)
require.False(t, value)
})

t.Run("Cloud, without enabled flag", func(t *testing.T) {
os.Setenv("MM_CLOUD_INSTALLATION_ID", "test")
defer os.Unsetenv("MM_CLOUD_INSTALLATION_ID")
overrides, value := th.App.ch.getPluginStateOverride("com.mattermost.calls")
require.False(t, overrides)
require.False(t, value)
})

t.Run("Cloud, with enabled flag set to true", func(t *testing.T) {
os.Setenv("MM_CLOUD_INSTALLATION_ID", "test")
defer os.Unsetenv("MM_CLOUD_INSTALLATION_ID")
os.Setenv("MM_FEATUREFLAGS_CALLSENABLED", "true")
defer os.Unsetenv("MM_FEATUREFLAGS_CALLSENABLED")

th2 := Setup(t)
defer th2.TearDown()

overrides, value := th2.App.ch.getPluginStateOverride("com.mattermost.calls")
require.False(t, overrides)
require.False(t, value)
})

t.Run("Cloud, with enabled flag set to false", func(t *testing.T) {
os.Setenv("MM_CLOUD_INSTALLATION_ID", "test")
defer os.Unsetenv("MM_CLOUD_INSTALLATION_ID")
os.Setenv("MM_FEATUREFLAGS_CALLSENABLED", "false")
defer os.Unsetenv("MM_FEATUREFLAGS_CALLSENABLED")

th2 := Setup(t)
defer th2.TearDown()

overrides, value := th2.App.ch.getPluginStateOverride("com.mattermost.calls")
require.True(t, overrides)
require.False(t, value)
})

t.Run("On-prem, with enabled flag set to false", func(t *testing.T) {
os.Setenv("MM_FEATUREFLAGS_CALLSENABLED", "false")
defer os.Unsetenv("MM_FEATUREFLAGS_CALLSENABLED")

th2 := Setup(t)
defer th2.TearDown()

overrides, value := th2.App.ch.getPluginStateOverride("com.mattermost.calls")
require.True(t, overrides)
require.False(t, value)
})
})

t.Run("apps override", func(t *testing.T) {
t.Run("without enabled flag", func(t *testing.T) {
overrides, value := th.App.ch.getPluginStateOverride("com.mattermost.apps")
Expand Down
4 changes: 0 additions & 4 deletions server/public/model/feature_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ type FeatureFlags struct {

PermalinkPreviews bool

// CallsEnabled controls whether or not the Calls plugin should be enabled
CallsEnabled bool

NormalizeLdapDNs bool

// Enable WYSIWYG text editor
Expand Down Expand Up @@ -63,7 +60,6 @@ func (f *FeatureFlags) SetDefaults() {
f.EnableRemoteClusterService = false
f.AppsEnabled = false
f.NormalizeLdapDNs = false
f.CallsEnabled = true
f.DeprecateCloudFree = false
f.WysiwygEditor = false
f.OnboardingTourTips = true
Expand Down

0 comments on commit 453eabb

Please sign in to comment.