Feature Management: Define HideFromAdminPage and AllowSelfServe configs (#77580)

* Feature Management: Define HideFromAdminPage and AllowSelfServe configs

* update tests

* add constraint for self-serve

* Update pkg/services/featuremgmt/models.go

Co-authored-by: Michael Mandrus <41969079+mmandrus@users.noreply.github.com>

---------

Co-authored-by: Michael Mandrus <41969079+mmandrus@users.noreply.github.com>
This commit is contained in:
João Calisto 2023-11-03 15:59:07 +00:00 committed by GitHub
parent 3dac37380d
commit ade140c161
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 259 additions and 193 deletions

View File

@ -98,7 +98,7 @@ func isFeatureHidden(flag featuremgmt.FeatureFlag, hideCfg map[string]struct{})
if _, ok := hideCfg[flag.Name]; ok { if _, ok := hideCfg[flag.Name]; ok {
return true return true
} }
return flag.Stage == featuremgmt.FeatureStageUnknown || flag.Stage == featuremgmt.FeatureStageExperimental || flag.Stage == featuremgmt.FeatureStagePrivatePreview return flag.Stage == featuremgmt.FeatureStageUnknown || flag.Stage == featuremgmt.FeatureStageExperimental || flag.Stage == featuremgmt.FeatureStagePrivatePreview || flag.HideFromAdminPage
} }
// isFeatureWriteable returns whether a toggle on the admin page can be updated by the user. // isFeatureWriteable returns whether a toggle on the admin page can be updated by the user.
@ -110,7 +110,8 @@ func isFeatureWriteable(flag featuremgmt.FeatureFlag, readOnlyCfg map[string]str
if flag.Name == featuremgmt.FlagFeatureToggleAdminPage { if flag.Name == featuremgmt.FlagFeatureToggleAdminPage {
return false return false
} }
return flag.Stage == featuremgmt.FeatureStageGeneralAvailability || flag.Stage == featuremgmt.FeatureStageDeprecated allowSelfServe := flag.AllowSelfServe != nil && *flag.AllowSelfServe
return flag.Stage == featuremgmt.FeatureStageGeneralAvailability && allowSelfServe || flag.Stage == featuremgmt.FeatureStageDeprecated
} }
// isFeatureEditingAllowed checks if the backend is properly configured to allow feature toggle changes from the UI // isFeatureEditingAllowed checks if the backend is properly configured to allow feature toggle changes from the UI

View File

@ -20,6 +20,15 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )
func boolPtr(b bool) *bool {
return &b
}
var (
truePtr = boolPtr(true)
falsePtr = boolPtr(false)
)
func TestGetFeatureToggles(t *testing.T) { func TestGetFeatureToggles(t *testing.T) {
readPermissions := []accesscontrol.Permission{{Action: accesscontrol.ActionFeatureManagementRead}} readPermissions := []accesscontrol.Permission{{Action: accesscontrol.ActionFeatureManagementRead}}
@ -107,20 +116,27 @@ func TestGetFeatureToggles(t *testing.T) {
Name: "toggle3", Name: "toggle3",
Stage: featuremgmt.FeatureStagePrivatePreview, Stage: featuremgmt.FeatureStagePrivatePreview,
}, { }, {
Name: "toggle4", Name: "toggle4",
Stage: featuremgmt.FeatureStagePublicPreview, Stage: featuremgmt.FeatureStagePublicPreview,
AllowSelfServe: truePtr,
}, { }, {
Name: "toggle5", Name: "toggle5",
Stage: featuremgmt.FeatureStageGeneralAvailability, Stage: featuremgmt.FeatureStageGeneralAvailability,
AllowSelfServe: truePtr,
}, { }, {
Name: "toggle6", Name: "toggle6",
Stage: featuremgmt.FeatureStageDeprecated, Stage: featuremgmt.FeatureStageDeprecated,
AllowSelfServe: truePtr,
}, {
Name: "toggle7",
Stage: featuremgmt.FeatureStageGeneralAvailability,
AllowSelfServe: falsePtr,
}, },
} }
t.Run("unknown, experimental, and private preview toggles are hidden by default", func(t *testing.T) { t.Run("unknown, experimental, and private preview toggles are hidden by default", func(t *testing.T) {
result := runGetScenario(t, features, setting.FeatureMgmtSettings{}, readPermissions, http.StatusOK) result := runGetScenario(t, features, setting.FeatureMgmtSettings{}, readPermissions, http.StatusOK)
assert.Len(t, result, 3) assert.Len(t, result, 4)
_, ok := findResult(t, result, "toggle1") _, ok := findResult(t, result, "toggle1")
assert.False(t, ok) assert.False(t, ok)
@ -130,13 +146,13 @@ func TestGetFeatureToggles(t *testing.T) {
assert.False(t, ok) assert.False(t, ok)
}) })
t.Run("only public preview and GA are writeable by default", func(t *testing.T) { t.Run("only public preview and GA with AllowSelfServe are writeable", func(t *testing.T) {
settings := setting.FeatureMgmtSettings{ settings := setting.FeatureMgmtSettings{
AllowEditing: true, AllowEditing: true,
UpdateWebhook: "bogus", UpdateWebhook: "bogus",
} }
result := runGetScenario(t, features, settings, readPermissions, http.StatusOK) result := runGetScenario(t, features, settings, readPermissions, http.StatusOK)
assert.Len(t, result, 3) assert.Len(t, result, 4)
t4, ok := findResult(t, result, "toggle4") t4, ok := findResult(t, result, "toggle4")
assert.True(t, ok) assert.True(t, ok)
@ -155,7 +171,7 @@ func TestGetFeatureToggles(t *testing.T) {
UpdateWebhook: "", UpdateWebhook: "",
} }
result := runGetScenario(t, features, settings, readPermissions, http.StatusOK) result := runGetScenario(t, features, settings, readPermissions, http.StatusOK)
assert.Len(t, result, 3) assert.Len(t, result, 4)
t4, ok := findResult(t, result, "toggle4") t4, ok := findResult(t, result, "toggle4")
assert.True(t, ok) assert.True(t, ok)
@ -305,13 +321,15 @@ func TestSetFeatureToggles(t *testing.T) {
Enabled: false, Enabled: false,
Stage: featuremgmt.FeatureStageGeneralAvailability, Stage: featuremgmt.FeatureStageGeneralAvailability,
}, { }, {
Name: "toggle4", Name: "toggle4",
Enabled: false, Enabled: false,
Stage: featuremgmt.FeatureStageGeneralAvailability, Stage: featuremgmt.FeatureStageGeneralAvailability,
AllowSelfServe: truePtr,
}, { }, {
Name: "toggle5", Name: "toggle5",
Enabled: false, Enabled: false,
Stage: featuremgmt.FeatureStageDeprecated, Stage: featuremgmt.FeatureStageDeprecated,
AllowSelfServe: truePtr,
}, },
} }

View File

@ -110,10 +110,12 @@ type FeatureFlag struct {
// Special behavior flags // Special behavior flags
RequiresDevMode bool `json:"requiresDevMode,omitempty"` // can not be enabled in production RequiresDevMode bool `json:"requiresDevMode,omitempty"` // can not be enabled in production
// This flag is currently unused. // This flag is currently unused.
RequiresRestart bool `json:"requiresRestart,omitempty"` // The server must be initialized with the value RequiresRestart bool `json:"requiresRestart,omitempty"` // The server must be initialized with the value
RequiresLicense bool `json:"requiresLicense,omitempty"` // Must be enabled in the license RequiresLicense bool `json:"requiresLicense,omitempty"` // Must be enabled in the license
FrontendOnly bool `json:"frontend,omitempty"` // change is only seen in the frontend FrontendOnly bool `json:"frontend,omitempty"` // change is only seen in the frontend
HideFromDocs bool `json:"hideFromDocs,omitempty"` // don't add the values to docs HideFromDocs bool `json:"hideFromDocs,omitempty"` // don't add the values to docs
HideFromAdminPage bool `json:"hideFromAdminPage,omitempty"` // don't display the feature in the admin page - add a comment with the reasoning
AllowSelfServe *bool `json:"allowSelfServe,omitempty"` // allow admin users to toggle the feature state from the admin page; this is required for GA toggles only
// This field is only for the feature management API. To enable your feature toggle by default, use `Expression`. // This field is only for the feature management API. To enable your feature toggle by default, use `Expression`.
Enabled bool `json:"enabled,omitempty"` Enabled bool `json:"enabled,omitempty"`

View File

@ -7,13 +7,16 @@
package featuremgmt package featuremgmt
var ( var (
falsePtr = boolPtr(false)
truePtr = boolPtr(true)
// Register each toggle here // Register each toggle here
standardFeatureFlags = []FeatureFlag{ standardFeatureFlags = []FeatureFlag{
{ {
Name: "disableEnvelopeEncryption", Name: "disableEnvelopeEncryption",
Description: "Disable envelope encryption (emergency only)", Description: "Disable envelope encryption (emergency only)",
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
Owner: grafanaAsCodeSquad, Owner: grafanaAsCodeSquad,
AllowSelfServe: falsePtr,
}, },
{ {
Name: "live-service-web-worker", Name: "live-service-web-worker",
@ -36,11 +39,12 @@ var (
Owner: grafanaAppPlatformSquad, Owner: grafanaAppPlatformSquad,
}, },
{ {
Name: "publicDashboards", Name: "publicDashboards",
Description: "Enables public access to dashboards", Description: "Enables public access to dashboards",
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
Owner: grafanaSharingSquad, Owner: grafanaSharingSquad,
Expression: "true", // enabled by default Expression: "true", // enabled by default
AllowSelfServe: truePtr,
}, },
{ {
Name: "publicDashboardsEmailSharing", Name: "publicDashboardsEmailSharing",
@ -57,10 +61,11 @@ var (
Owner: grafanaObservabilityLogsSquad, Owner: grafanaObservabilityLogsSquad,
}, },
{ {
Name: "featureHighlights", Name: "featureHighlights",
Description: "Highlight Grafana Enterprise features", Description: "Highlight Grafana Enterprise features",
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
Owner: grafanaAsCodeSquad, Owner: grafanaAsCodeSquad,
AllowSelfServe: falsePtr,
}, },
{ {
Name: "migrationLocking", Name: "migrationLocking",
@ -81,12 +86,13 @@ var (
Owner: grafanaExploreSquad, Owner: grafanaExploreSquad,
}, },
{ {
Name: "exploreContentOutline", Name: "exploreContentOutline",
Description: "Content outline sidebar", Description: "Content outline sidebar",
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
Owner: grafanaExploreSquad, Owner: grafanaExploreSquad,
Expression: "true", // enabled by default Expression: "true", // enabled by default
FrontendOnly: true, FrontendOnly: true,
AllowSelfServe: falsePtr,
}, },
{ {
Name: "datasourceQueryMultiStatus", Name: "datasourceQueryMultiStatus",
@ -149,11 +155,12 @@ var (
Owner: hostedGrafanaTeam, Owner: hostedGrafanaTeam,
}, },
{ {
Name: "dataConnectionsConsole", Name: "dataConnectionsConsole",
Description: "Enables a new top-level page called Connections. This page is an experiment that provides a better experience when you install and configure data sources and other plugins.", Description: "Enables a new top-level page called Connections. This page is an experiment that provides a better experience when you install and configure data sources and other plugins.",
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
Expression: "true", // turned on by default Expression: "true", // turned on by default
Owner: grafanaPluginsPlatformSquad, Owner: grafanaPluginsPlatformSquad,
AllowSelfServe: falsePtr,
}, },
{ {
// Some plugins rely on topnav feature flag being enabled, so we cannot remove this until we // Some plugins rely on topnav feature flag being enabled, so we cannot remove this until we
@ -185,26 +192,29 @@ var (
Owner: grafanaAppPlatformSquad, Owner: grafanaAppPlatformSquad,
}, },
{ {
Name: "cloudWatchCrossAccountQuerying", Name: "cloudWatchCrossAccountQuerying",
Description: "Enables cross-account querying in CloudWatch datasources", Description: "Enables cross-account querying in CloudWatch datasources",
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
Expression: "true", // enabled by default Expression: "true", // enabled by default
Owner: awsDatasourcesSquad, Owner: awsDatasourcesSquad,
AllowSelfServe: falsePtr,
}, },
{ {
Name: "redshiftAsyncQueryDataSupport", Name: "redshiftAsyncQueryDataSupport",
Description: "Enable async query data support for Redshift", Description: "Enable async query data support for Redshift",
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
Expression: "true", // enabled by default Expression: "true", // enabled by default
Owner: awsDatasourcesSquad, Owner: awsDatasourcesSquad,
AllowSelfServe: falsePtr,
}, },
{ {
Name: "athenaAsyncQueryDataSupport", Name: "athenaAsyncQueryDataSupport",
Description: "Enable async query data support for Athena", Description: "Enable async query data support for Athena",
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
Expression: "true", // enabled by default Expression: "true", // enabled by default
FrontendOnly: true, FrontendOnly: true,
Owner: awsDatasourcesSquad, Owner: awsDatasourcesSquad,
AllowSelfServe: falsePtr,
}, },
{ {
Name: "cloudwatchNewRegionsHandler", Name: "cloudwatchNewRegionsHandler",
@ -237,32 +247,36 @@ var (
Owner: grafanaBackendPlatformSquad, Owner: grafanaBackendPlatformSquad,
}, },
{ {
Name: "nestedFolderPicker", Name: "nestedFolderPicker",
Description: "Enables the new folder picker to work with nested folders. Requires the nestedFolders feature toggle", Description: "Enables the new folder picker to work with nested folders. Requires the nestedFolders feature toggle",
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
Owner: grafanaFrontendPlatformSquad, Owner: grafanaFrontendPlatformSquad,
FrontendOnly: true, FrontendOnly: true,
Expression: "true", // enabled by default Expression: "true", // enabled by default
AllowSelfServe: falsePtr,
}, },
{ {
Name: "accessTokenExpirationCheck", Name: "accessTokenExpirationCheck",
Description: "Enable OAuth access_token expiration check and token refresh using the refresh_token", Description: "Enable OAuth access_token expiration check and token refresh using the refresh_token",
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
Owner: identityAccessTeam, Owner: identityAccessTeam,
AllowSelfServe: falsePtr,
}, },
{ {
Name: "emptyDashboardPage", Name: "emptyDashboardPage",
Description: "Enable the redesigned user interface of a dashboard page that includes no panels", Description: "Enable the redesigned user interface of a dashboard page that includes no panels",
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
FrontendOnly: true, FrontendOnly: true,
Expression: "true", // enabled by default Expression: "true", // enabled by default
Owner: grafanaDashboardsSquad, Owner: grafanaDashboardsSquad,
AllowSelfServe: falsePtr,
}, },
{ {
Name: "disablePrometheusExemplarSampling", Name: "disablePrometheusExemplarSampling",
Description: "Disable Prometheus exemplar sampling", Description: "Disable Prometheus exemplar sampling",
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
Owner: grafanaObservabilityMetricsSquad, Owner: grafanaObservabilityMetricsSquad,
AllowSelfServe: falsePtr,
}, },
{ {
Name: "alertingBacktesting", Name: "alertingBacktesting",
@ -285,20 +299,22 @@ var (
Owner: grafanaAlertingSquad, Owner: grafanaAlertingSquad,
}, },
{ {
Name: "logsContextDatasourceUi", Name: "logsContextDatasourceUi",
Description: "Allow datasource to provide custom UI for context view", Description: "Allow datasource to provide custom UI for context view",
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
FrontendOnly: true, FrontendOnly: true,
Owner: grafanaObservabilityLogsSquad, Owner: grafanaObservabilityLogsSquad,
Expression: "true", // turned on by default Expression: "true", // turned on by default
AllowSelfServe: falsePtr,
}, },
{ {
Name: "lokiQuerySplitting", Name: "lokiQuerySplitting",
Description: "Split large interval queries into subqueries with smaller time intervals", Description: "Split large interval queries into subqueries with smaller time intervals",
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
FrontendOnly: true, FrontendOnly: true,
Owner: grafanaObservabilityLogsSquad, Owner: grafanaObservabilityLogsSquad,
Expression: "true", // turned on by default Expression: "true", // turned on by default
AllowSelfServe: falsePtr,
}, },
{ {
Name: "lokiQuerySplittingConfig", Name: "lokiQuerySplittingConfig",
@ -314,26 +330,29 @@ var (
Owner: grafanaBackendPlatformSquad, Owner: grafanaBackendPlatformSquad,
}, },
{ {
Name: "gcomOnlyExternalOrgRoleSync", Name: "gcomOnlyExternalOrgRoleSync",
Description: "Prohibits a user from changing organization roles synced with Grafana Cloud auth provider", Description: "Prohibits a user from changing organization roles synced with Grafana Cloud auth provider",
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
Owner: identityAccessTeam, Owner: identityAccessTeam,
AllowSelfServe: falsePtr,
}, },
{ {
Name: "prometheusMetricEncyclopedia", Name: "prometheusMetricEncyclopedia",
Description: "Adds the metrics explorer component to the Prometheus query builder as an option in metric select", Description: "Adds the metrics explorer component to the Prometheus query builder as an option in metric select",
Expression: "true", Expression: "true",
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
FrontendOnly: true, FrontendOnly: true,
Owner: grafanaObservabilityMetricsSquad, Owner: grafanaObservabilityMetricsSquad,
AllowSelfServe: falsePtr,
}, },
{ {
Name: "influxdbBackendMigration", Name: "influxdbBackendMigration",
Description: "Query InfluxDB InfluxQL without the proxy", Description: "Query InfluxDB InfluxQL without the proxy",
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
FrontendOnly: true, FrontendOnly: true,
Owner: grafanaObservabilityMetricsSquad, Owner: grafanaObservabilityMetricsSquad,
Expression: "true", // enabled by default Expression: "true", // enabled by default
AllowSelfServe: falsePtr,
}, },
{ {
Name: "clientTokenRotation", Name: "clientTokenRotation",
@ -342,18 +361,20 @@ var (
Owner: identityAccessTeam, Owner: identityAccessTeam,
}, },
{ {
Name: "prometheusDataplane", Name: "prometheusDataplane",
Description: "Changes responses to from Prometheus to be compliant with the dataplane specification. In particular, when this feature toggle is active, the numeric `Field.Name` is set from 'Value' to the value of the `__name__` label.", Description: "Changes responses to from Prometheus to be compliant with the dataplane specification. In particular, when this feature toggle is active, the numeric `Field.Name` is set from 'Value' to the value of the `__name__` label.",
Expression: "true", Expression: "true",
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
Owner: grafanaObservabilityMetricsSquad, Owner: grafanaObservabilityMetricsSquad,
AllowSelfServe: falsePtr,
}, },
{ {
Name: "lokiMetricDataplane", Name: "lokiMetricDataplane",
Description: "Changes metric responses from Loki to be compliant with the dataplane specification.", Description: "Changes metric responses from Loki to be compliant with the dataplane specification.",
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
Expression: "true", Expression: "true",
Owner: grafanaObservabilityLogsSquad, Owner: grafanaObservabilityLogsSquad,
AllowSelfServe: falsePtr,
}, },
{ {
Name: "lokiLogsDataplane", Name: "lokiLogsDataplane",
@ -362,12 +383,13 @@ var (
Owner: grafanaObservabilityLogsSquad, Owner: grafanaObservabilityLogsSquad,
}, },
{ {
Name: "dataplaneFrontendFallback", Name: "dataplaneFrontendFallback",
Description: "Support dataplane contract field name change for transformations and field name matchers where the name is different", Description: "Support dataplane contract field name change for transformations and field name matchers where the name is different",
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
FrontendOnly: true, FrontendOnly: true,
Expression: "true", Expression: "true",
Owner: grafanaObservabilityMetricsSquad, Owner: grafanaObservabilityMetricsSquad,
AllowSelfServe: falsePtr,
}, },
{ {
Name: "disableSSEDataplane", Name: "disableSSEDataplane",
@ -382,12 +404,13 @@ var (
Owner: grafanaAlertingSquad, Owner: grafanaAlertingSquad,
}, },
{ {
Name: "alertingNotificationsPoliciesMatchingInstances", Name: "alertingNotificationsPoliciesMatchingInstances",
Description: "Enables the preview of matching instances for notification policies", Description: "Enables the preview of matching instances for notification policies",
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
FrontendOnly: true, FrontendOnly: true,
Expression: "true", // enabled by default Expression: "true", // enabled by default
Owner: grafanaAlertingSquad, Owner: grafanaAlertingSquad,
AllowSelfServe: falsePtr,
}, },
{ {
Name: "alertStateHistoryLokiPrimary", Name: "alertStateHistoryLokiPrimary",
@ -433,21 +456,24 @@ var (
Owner: grafanaOperatorExperienceSquad, Owner: grafanaOperatorExperienceSquad,
RequiresRestart: true, RequiresRestart: true,
Expression: "true", // enabled by default Expression: "true", // enabled by default
AllowSelfServe: falsePtr,
}, },
{ {
Name: "enableElasticsearchBackendQuerying", Name: "enableElasticsearchBackendQuerying",
Description: "Enable the processing of queries and responses in the Elasticsearch data source through backend", Description: "Enable the processing of queries and responses in the Elasticsearch data source through backend",
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
Owner: grafanaObservabilityLogsSquad, Owner: grafanaObservabilityLogsSquad,
Expression: "true", // enabled by default Expression: "true", // enabled by default
AllowSelfServe: falsePtr,
}, },
{ {
Name: "advancedDataSourcePicker", Name: "advancedDataSourcePicker",
Description: "Enable a new data source picker with contextual information, recently used order and advanced mode", Description: "Enable a new data source picker with contextual information, recently used order and advanced mode",
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
FrontendOnly: true, FrontendOnly: true,
Expression: "true", // enabled by default Expression: "true", // enabled by default
Owner: grafanaDashboardsSquad, Owner: grafanaDashboardsSquad,
AllowSelfServe: falsePtr,
}, },
{ {
Name: "faroDatasourceSelector", Name: "faroDatasourceSelector",
@ -520,12 +546,13 @@ var (
Owner: grafanaObservabilityLogsSquad, Owner: grafanaObservabilityLogsSquad,
}, },
{ {
Name: "cloudWatchLogsMonacoEditor", Name: "cloudWatchLogsMonacoEditor",
Description: "Enables the Monaco editor for CloudWatch Logs queries", Description: "Enables the Monaco editor for CloudWatch Logs queries",
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
FrontendOnly: true, FrontendOnly: true,
Expression: "true", // enabled by default Expression: "true", // enabled by default
Owner: awsDatasourcesSquad, Owner: awsDatasourcesSquad,
AllowSelfServe: falsePtr,
}, },
{ {
Name: "exploreScrollableLogsContainer", Name: "exploreScrollableLogsContainer",
@ -535,11 +562,12 @@ var (
Owner: grafanaObservabilityLogsSquad, Owner: grafanaObservabilityLogsSquad,
}, },
{ {
Name: "recordedQueriesMulti", Name: "recordedQueriesMulti",
Description: "Enables writing multiple items from a single query within Recorded Queries", Description: "Enables writing multiple items from a single query within Recorded Queries",
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
Expression: "true", Expression: "true",
Owner: grafanaObservabilityMetricsSquad, Owner: grafanaObservabilityMetricsSquad,
AllowSelfServe: falsePtr,
}, },
{ {
Name: "pluginsDynamicAngularDetectionPatterns", Name: "pluginsDynamicAngularDetectionPatterns",
@ -576,12 +604,13 @@ var (
Owner: awsDatasourcesSquad, Owner: awsDatasourcesSquad,
}, },
{ {
Name: "transformationsRedesign", Name: "transformationsRedesign",
Description: "Enables the transformations redesign", Description: "Enables the transformations redesign",
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
FrontendOnly: true, FrontendOnly: true,
Expression: "true", // enabled by default Expression: "true", // enabled by default
Owner: grafanaObservabilityMetricsSquad, Owner: grafanaObservabilityMetricsSquad,
AllowSelfServe: falsePtr,
}, },
{ {
Name: "mlExpressions", Name: "mlExpressions",
@ -641,11 +670,12 @@ var (
RequiresRestart: true, RequiresRestart: true,
}, },
{ {
Name: "azureMonitorDataplane", Name: "azureMonitorDataplane",
Description: "Adds dataplane compliant frame metadata in the Azure Monitor datasource", Description: "Adds dataplane compliant frame metadata in the Azure Monitor datasource",
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
Owner: grafanaPartnerPluginsSquad, Owner: grafanaPartnerPluginsSquad,
Expression: "true", // on by default Expression: "true", // on by default
AllowSelfServe: falsePtr,
}, },
{ {
Name: "traceToProfiles", Name: "traceToProfiles",
@ -661,11 +691,12 @@ var (
Owner: grafanaBackendPlatformSquad, Owner: grafanaBackendPlatformSquad,
}, },
{ {
Name: "prometheusConfigOverhaulAuth", Name: "prometheusConfigOverhaulAuth",
Description: "Update the Prometheus configuration page with the new auth component", Description: "Update the Prometheus configuration page with the new auth component",
Owner: grafanaObservabilityMetricsSquad, Owner: grafanaObservabilityMetricsSquad,
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
Expression: "true", // on by default Expression: "true", // on by default
AllowSelfServe: falsePtr,
}, },
{ {
Name: "configurableSchedulerTick", Name: "configurableSchedulerTick",
@ -701,12 +732,13 @@ var (
Owner: grafanaPluginsPlatformSquad, Owner: grafanaPluginsPlatformSquad,
}, },
{ {
Name: "dashgpt", Name: "dashgpt",
Description: "Enable AI powered features in dashboards", Description: "Enable AI powered features in dashboards",
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
FrontendOnly: true, FrontendOnly: true,
Owner: grafanaDashboardsSquad, Owner: grafanaDashboardsSquad,
Expression: "true", // on by default Expression: "true", // on by default
AllowSelfServe: falsePtr,
}, },
{ {
Name: "reportingRetries", Name: "reportingRetries",
@ -717,12 +749,13 @@ var (
RequiresRestart: true, RequiresRestart: true,
}, },
{ {
Name: "newBrowseDashboards", Name: "newBrowseDashboards",
Description: "New browse/manage dashboards UI", Description: "New browse/manage dashboards UI",
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
Owner: grafanaFrontendPlatformSquad, Owner: grafanaFrontendPlatformSquad,
FrontendOnly: true, FrontendOnly: true,
Expression: "true", // on by default Expression: "true", // on by default
AllowSelfServe: falsePtr,
}, },
{ {
Name: "sseGroupByDatasource", Name: "sseGroupByDatasource",
@ -760,12 +793,13 @@ var (
Owner: hostedGrafanaTeam, Owner: hostedGrafanaTeam,
}, },
{ {
Name: "alertingInsights", Name: "alertingInsights",
Description: "Show the new alerting insights landing page", Description: "Show the new alerting insights landing page",
FrontendOnly: true, FrontendOnly: true,
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
Owner: grafanaAlertingSquad, Owner: grafanaAlertingSquad,
Expression: "true", // enabled by default Expression: "true", // enabled by default
AllowSelfServe: falsePtr,
}, },
{ {
Name: "alertingContactPointsV2", Name: "alertingContactPointsV2",
@ -803,11 +837,12 @@ var (
RequiresDevMode: true, RequiresDevMode: true,
}, },
{ {
Name: "cloudWatchWildCardDimensionValues", Name: "cloudWatchWildCardDimensionValues",
Description: "Fetches dimension values from CloudWatch to correctly label wildcard dimensions", Description: "Fetches dimension values from CloudWatch to correctly label wildcard dimensions",
Stage: FeatureStageGeneralAvailability, Stage: FeatureStageGeneralAvailability,
Expression: "true", // enabled by default Expression: "true", // enabled by default
Owner: awsDatasourcesSquad, Owner: awsDatasourcesSquad,
AllowSelfServe: falsePtr,
}, },
{ {
Name: "externalServiceAccounts", Name: "externalServiceAccounts",
@ -991,3 +1026,7 @@ var (
}, },
} }
) )
func boolPtr(b bool) *bool {
return &b
}

View File

@ -45,6 +45,12 @@ func TestFeatureToggleFiles(t *testing.T) {
if flag.Name != strings.TrimSpace(flag.Name) { if flag.Name != strings.TrimSpace(flag.Name) {
t.Errorf("flag Name should not start/end with spaces. See: %s", flag.Name) t.Errorf("flag Name should not start/end with spaces. See: %s", flag.Name)
} }
if flag.Stage == FeatureStageGeneralAvailability && flag.AllowSelfServe == nil {
t.Errorf("feature stage FeatureStageGeneralAvailability should have the AllowSelfServe field defined")
}
if flag.AllowSelfServe != nil && flag.Stage != FeatureStageGeneralAvailability {
t.Errorf("only allow self-serving GA toggles")
}
} }
}) })