Chore: remove unused feature flag showFeatureFlagsInUI (#62908)
This commit is contained in:
@@ -4,6 +4,9 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
// this import is needed for github.com/grafana/grafana/pkg/web hack_wrap to work
|
||||
_ "github.com/grafana/grafana/pkg/api/response"
|
||||
)
|
||||
|
||||
func TestReduce(t *testing.T) {
|
||||
|
||||
@@ -3,12 +3,9 @@ package featuremgmt
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"reflect"
|
||||
|
||||
"github.com/grafana/grafana/pkg/api/response"
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model"
|
||||
"github.com/grafana/grafana/pkg/services/licensing"
|
||||
)
|
||||
|
||||
@@ -151,20 +148,6 @@ func (fm *FeatureManager) GetFlags() []FeatureFlag {
|
||||
return v
|
||||
}
|
||||
|
||||
func (fm *FeatureManager) HandleGetSettings(c *contextmodel.ReqContext) {
|
||||
res := make(map[string]interface{}, 3)
|
||||
res["enabled"] = fm.GetEnabled(c.Req.Context())
|
||||
|
||||
vv := make([]*FeatureFlag, 0, len(fm.flags))
|
||||
for _, v := range fm.flags {
|
||||
vv = append(vv, v)
|
||||
}
|
||||
|
||||
res["info"] = vv
|
||||
|
||||
response.JSON(http.StatusOK, res).WriteTo(c)
|
||||
}
|
||||
|
||||
// WithFeatures is used to define feature toggles for testing.
|
||||
// The arguments are a list of strings that are optionally followed by a boolean value for example:
|
||||
// WithFeatures([]interface{}{"my_feature", "other_feature"}) or WithFeatures([]interface{}{"my_feature", true})
|
||||
|
||||
@@ -61,12 +61,6 @@ var (
|
||||
Description: "Experimental. Allow override default AAD audience for Azure Prometheus endpoint",
|
||||
State: FeatureStateBeta,
|
||||
},
|
||||
{
|
||||
Name: "showFeatureFlagsInUI",
|
||||
Description: "Show feature flags in the settings UI",
|
||||
State: FeatureStateAlpha,
|
||||
RequiresDevMode: true,
|
||||
},
|
||||
{
|
||||
Name: "publicDashboards",
|
||||
Description: "Enables public access to dashboards",
|
||||
|
||||
@@ -47,10 +47,6 @@ const (
|
||||
// Experimental. Allow override default AAD audience for Azure Prometheus endpoint
|
||||
FlagPrometheusAzureOverrideAudience = "prometheusAzureOverrideAudience"
|
||||
|
||||
// FlagShowFeatureFlagsInUI
|
||||
// Show feature flags in the settings UI
|
||||
FlagShowFeatureFlagsInUI = "showFeatureFlagsInUI"
|
||||
|
||||
// FlagPublicDashboards
|
||||
// Enables public access to dashboards
|
||||
FlagPublicDashboards = "publicDashboards"
|
||||
|
||||
@@ -13,18 +13,16 @@ func TestFeatureUsageStats(t *testing.T) {
|
||||
"database_metrics",
|
||||
"dashboardPreviews",
|
||||
"live-config",
|
||||
"showFeatureFlagsInUI",
|
||||
"UPPER_SNAKE_CASE",
|
||||
"feature.with.a.dot",
|
||||
)
|
||||
|
||||
require.Equal(t, map[string]interface{}{
|
||||
"stats.features.trim_defaults.count": 1,
|
||||
"stats.features.database_metrics.count": 1,
|
||||
"stats.features.dashboard_previews.count": 1,
|
||||
"stats.features.live_config.count": 1,
|
||||
"stats.features.show_feature_flags_in_ui.count": 1,
|
||||
"stats.features.upper_snake_case.count": 1,
|
||||
"stats.features.feature_with_a_dot.count": 1,
|
||||
"stats.features.trim_defaults.count": 1,
|
||||
"stats.features.database_metrics.count": 1,
|
||||
"stats.features.dashboard_previews.count": 1,
|
||||
"stats.features.live_config.count": 1,
|
||||
"stats.features.upper_snake_case.count": 1,
|
||||
"stats.features.feature_with_a_dot.count": 1,
|
||||
}, featureManagerWithAllFeatures.GetUsageStats(context.Background()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user