From 07e794c312a16da2423237222d8ef6d6bdb9d356 Mon Sep 17 00:00:00 2001 From: Ryan McKinley Date: Tue, 23 May 2023 07:42:22 -0700 Subject: [PATCH] FeatureFlags: Do not allow spaces in descriptions (#68852) --- pkg/services/featuremgmt/registry.go | 2 +- pkg/services/featuremgmt/toggles_gen.go | 2 +- pkg/services/featuremgmt/toggles_gen_test.go | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/services/featuremgmt/registry.go b/pkg/services/featuremgmt/registry.go index e92c94f7277..8c218e6102f 100644 --- a/pkg/services/featuremgmt/registry.go +++ b/pkg/services/featuremgmt/registry.go @@ -507,7 +507,7 @@ var ( }, { Name: "faroDatasourceSelector", - Description: "Enable the data source selector within the Frontend Apps section of the Frontend Observability ", + Description: "Enable the data source selector within the Frontend Apps section of the Frontend Observability", State: FeatureStateBeta, FrontendOnly: true, Owner: appO11ySquad, diff --git a/pkg/services/featuremgmt/toggles_gen.go b/pkg/services/featuremgmt/toggles_gen.go index 3aaf3320dc9..58b8c4c23f1 100644 --- a/pkg/services/featuremgmt/toggles_gen.go +++ b/pkg/services/featuremgmt/toggles_gen.go @@ -308,7 +308,7 @@ const ( FlagAdvancedDataSourcePicker = "advancedDataSourcePicker" // FlagFaroDatasourceSelector - // Enable the data source selector within the Frontend Apps section of the Frontend Observability + // Enable the data source selector within the Frontend Apps section of the Frontend Observability FlagFaroDatasourceSelector = "faroDatasourceSelector" // FlagEnableDatagridEditing diff --git a/pkg/services/featuremgmt/toggles_gen_test.go b/pkg/services/featuremgmt/toggles_gen_test.go index 6f8a0af4c50..ea8620501dc 100644 --- a/pkg/services/featuremgmt/toggles_gen_test.go +++ b/pkg/services/featuremgmt/toggles_gen_test.go @@ -39,6 +39,12 @@ func TestFeatureToggleFiles(t *testing.T) { if flag.State == FeatureStateUnknown { t.Errorf("standard toggles should not have an unknown state. See: %s", flag.Name) } + if flag.Description != strings.TrimSpace(flag.Description) { + t.Errorf("flag Description should not start/end with spaces. See: %s", flag.Name) + } + if flag.Name != strings.TrimSpace(flag.Name) { + t.Errorf("flag Name should not start/end with spaces. See: %s", flag.Name) + } } })