Set feature flag default to true (#34374)

This commit is contained in:
Harshil Sharma 2025-11-04 09:24:49 +01:00 committed by GitHub
parent 519fb5faf0
commit 00374ae456
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 10 additions and 57 deletions

View file

@ -8,7 +8,6 @@ import (
"encoding/json"
"fmt"
"net/http"
"os"
"sort"
"strings"
"testing"
@ -1633,10 +1632,6 @@ func TestDeleteGroupChannel(t *testing.T) {
func TestGetChannel(t *testing.T) {
mainHelper.Parallel(t)
os.Setenv("MM_FEATUREFLAGS_ContentFlagging", "true")
defer func() {
os.Unsetenv("MM_FEATUREFLAGS_ContentFlagging")
}()
th := Setup(t).InitBasic()
defer th.TearDown()

View file

@ -6,7 +6,6 @@ package api4
import (
"context"
"net/http"
"os"
"testing"
"github.com/mattermost/mattermost/server/public/model"
@ -33,12 +32,8 @@ func setBasicCommonReviewerConfig(th *TestHelper) *model.AppError {
}
func TestGetFlaggingConfiguration(t *testing.T) {
os.Setenv("MM_FEATUREFLAGS_ContentFlagging", "true")
th := Setup(t)
defer func() {
th.TearDown()
os.Unsetenv("MM_FEATUREFLAGS_ContentFlagging")
}()
defer th.TearDown()
client := th.Client
@ -74,12 +69,8 @@ func TestGetFlaggingConfiguration(t *testing.T) {
}
func TestSaveContentFlaggingSettings(t *testing.T) {
os.Setenv("MM_FEATUREFLAGS_ContentFlagging", "true")
th := Setup(t).InitBasic()
defer func() {
th.TearDown()
os.Unsetenv("MM_FEATUREFLAGS_ContentFlagging")
}()
defer th.TearDown()
client := th.Client
@ -158,12 +149,8 @@ func TestSaveContentFlaggingSettings(t *testing.T) {
}
func TestGetContentFlaggingSettings(t *testing.T) {
os.Setenv("MM_FEATUREFLAGS_ContentFlagging", "true")
th := Setup(t).InitBasic()
defer func() {
th.TearDown()
os.Unsetenv("MM_FEATUREFLAGS_ContentFlagging")
}()
defer th.TearDown()
t.Run("Should return 403 when user does not have manage system permission", func(t *testing.T) {
th.App.Srv().SetLicense(model.NewTestLicenseSKU(model.LicenseShortSkuEnterpriseAdvanced))
@ -201,12 +188,8 @@ func TestGetContentFlaggingSettings(t *testing.T) {
}
func TestGetPostPropertyValues(t *testing.T) {
os.Setenv("MM_FEATUREFLAGS_ContentFlagging", "true")
th := Setup(t).InitBasic()
defer func() {
th.TearDown()
os.Unsetenv("MM_FEATUREFLAGS_ContentFlagging")
}()
defer th.TearDown()
client := th.Client
@ -288,12 +271,8 @@ func TestGetPostPropertyValues(t *testing.T) {
}
func TestGetFlaggedPost(t *testing.T) {
os.Setenv("MM_FEATUREFLAGS_ContentFlagging", "true")
th := Setup(t).InitBasic()
defer func() {
th.TearDown()
os.Unsetenv("MM_FEATUREFLAGS_ContentFlagging")
}()
defer th.TearDown()
client := th.Client
@ -442,12 +421,8 @@ func TestGetFlaggedPost(t *testing.T) {
}
func TestFlagPost(t *testing.T) {
os.Setenv("MM_FEATUREFLAGS_ContentFlagging", "true")
th := Setup(t).InitBasic()
defer func() {
th.TearDown()
os.Unsetenv("MM_FEATUREFLAGS_ContentFlagging")
}()
defer th.TearDown()
client := th.Client
@ -588,12 +563,8 @@ func TestFlagPost(t *testing.T) {
}
func TestGetTeamPostReportingFeatureStatus(t *testing.T) {
os.Setenv("MM_FEATUREFLAGS_ContentFlagging", "true")
th := Setup(t)
defer func() {
th.TearDown()
os.Unsetenv("MM_FEATUREFLAGS_ContentFlagging")
}()
defer th.TearDown()
client := th.Client
@ -671,12 +642,8 @@ func TestGetTeamPostReportingFeatureStatus(t *testing.T) {
}
func TestSearchReviewers(t *testing.T) {
os.Setenv("MM_FEATUREFLAGS_ContentFlagging", "true")
th := Setup(t).InitBasic()
defer func() {
th.TearDown()
os.Unsetenv("MM_FEATUREFLAGS_ContentFlagging")
}()
defer th.TearDown()
client := th.Client
@ -789,12 +756,8 @@ func TestSearchReviewers(t *testing.T) {
}
func TestAssignContentFlaggingReviewer(t *testing.T) {
os.Setenv("MM_FEATUREFLAGS_ContentFlagging", "true")
th := Setup(t).InitBasic()
defer func() {
th.TearDown()
os.Unsetenv("MM_FEATUREFLAGS_ContentFlagging")
}()
defer th.TearDown()
client := th.Client

View file

@ -10,7 +10,6 @@ import (
"encoding/json"
"fmt"
"net/http"
"os"
"strconv"
"strings"
"testing"
@ -239,10 +238,6 @@ func TestCreateTeamSanitization(t *testing.T) {
func TestGetTeam(t *testing.T) {
mainHelper.Parallel(t)
os.Setenv("MM_FEATUREFLAGS_ContentFlagging", "true")
defer func() {
os.Unsetenv("MM_FEATUREFLAGS_ContentFlagging")
}()
th := Setup(t).InitBasic()
defer th.TearDown()

View file

@ -113,7 +113,7 @@ func (f *FeatureFlags) SetDefaults() {
f.ExperimentalAuditSettingsSystemConsoleUI = true
f.CustomProfileAttributes = true
f.AttributeBasedAccessControl = true
f.ContentFlagging = false
f.ContentFlagging = true
f.InteractiveDialogAppsForm = true
f.EnableMattermostEntry = true