mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: remove unused feature flag showFeatureFlagsInUI (#62908)
This commit is contained in:
parent
c8ee2f9d9e
commit
804bd08f11
@ -98,7 +98,6 @@ The following toggles require explicitly setting Grafana's [app mode]({{< relref
|
||||
|
||||
| Feature toggle name | Description |
|
||||
| ------------------------------ | ----------------------------------------------------------------------- |
|
||||
| `showFeatureFlagsInUI` | Show feature flags in the settings UI |
|
||||
| `publicDashboardsEmailSharing` | Allows public dashboard sharing to be restricted to only allowed emails |
|
||||
| `k8s` | Explore native k8s integrations |
|
||||
| `k8sDashboards` | Save dashboards via k8s |
|
||||
|
2
go.mod
2
go.mod
@ -130,7 +130,7 @@ require (
|
||||
gopkg.in/square/go-jose.v2 v2.5.1
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
xorm.io/builder v0.3.6 // indirect
|
||||
xorm.io/builder v0.3.6
|
||||
xorm.io/core v0.7.3
|
||||
xorm.io/xorm v0.8.2
|
||||
)
|
||||
|
@ -26,7 +26,6 @@ export interface FeatureToggles {
|
||||
queryOverLive?: boolean;
|
||||
panelTitleSearch?: boolean;
|
||||
prometheusAzureOverrideAudience?: boolean;
|
||||
showFeatureFlagsInUI?: boolean;
|
||||
publicDashboards?: boolean;
|
||||
publicDashboardsEmailSharing?: boolean;
|
||||
lokiLive?: boolean;
|
||||
|
@ -629,9 +629,6 @@ func (hs *HTTPServer) registerRoutes() {
|
||||
// admin api
|
||||
r.Group("/api/admin", func(adminRoute routing.RouteRegister) {
|
||||
adminRoute.Get("/settings", authorize(reqGrafanaAdmin, ac.EvalPermission(ac.ActionSettingsRead)), routing.Wrap(hs.AdminGetSettings))
|
||||
if hs.Features.IsEnabled(featuremgmt.FlagShowFeatureFlagsInUI) {
|
||||
adminRoute.Get("/settings/features", authorize(reqGrafanaAdmin, ac.EvalPermission(ac.ActionSettingsRead)), hs.Features.HandleGetSettings)
|
||||
}
|
||||
adminRoute.Get("/stats", authorize(reqGrafanaAdmin, ac.EvalPermission(ac.ActionServerStatsRead)), routing.Wrap(hs.AdminGetStats))
|
||||
adminRoute.Post("/pause-all-alerts", reqGrafanaAdmin, routing.Wrap(hs.PauseAllAlerts(setting.AlertingEnabled)))
|
||||
|
||||
|
@ -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()))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user