Feature Toggles: Add two test feature toggles to test potential AB test setup (#98844)

* add two dummy feature toggles to use for testing potential AB testing setup

* update betterer

* update auto generated files

* fix camelcase test case
This commit is contained in:
Nathan Marrs 2025-01-13 14:13:13 -07:00 committed by GitHub
parent 1c67f4084c
commit 009d7f42b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 59 additions and 11 deletions

View File

@ -3079,11 +3079,6 @@ exports[`better eslint`] = {
[0, 0, 0, "No untranslated strings in text props. Wrap text with <Trans /> or use t()", "0"],
[0, 0, 0, "No untranslated strings in text props. Wrap text with <Trans /> or use t()", "1"]
],
"public/app/features/dashboard-scene/edit-pane/VizPanelEditPaneBehavior.tsx:5381": [
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "0"],
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "1"],
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "2"]
],
"public/app/features/dashboard-scene/embedding/EmbeddedDashboard.tsx:5381": [
[0, 0, 0, "No untranslated strings in text props. Wrap text with <Trans /> or use t()", "0"]
],
@ -3304,11 +3299,6 @@ exports[`better eslint`] = {
"public/app/features/dashboard-scene/scene/UnlinkModal.tsx:5381": [
[0, 0, 0, "No untranslated strings in text props. Wrap text with <Trans /> or use t()", "0"]
],
"public/app/features/dashboard-scene/scene/layout-rows/RowItem.tsx:5381": [
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "0"],
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "1"],
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "2"]
],
"public/app/features/dashboard-scene/scene/row-actions/RowActions.tsx:5381": [
[0, 0, 0, "No untranslated strings in text props. Wrap text with <Trans /> or use t()", "0"],
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "1"],

View File

@ -249,4 +249,6 @@ export interface FeatureToggles {
k8SFolderMove?: boolean;
improvedExternalSessionHandlingSAML?: boolean;
teamHttpHeadersMimir?: boolean;
ABTestFeatureToggleA?: boolean;
ABTestFeatureToggleB?: boolean;
}

View File

@ -256,7 +256,6 @@ func (_m *FakeDashboardStore) GetAllDashboardsByOrgId(ctx context.Context, orgID
return r0, r1
}
// GetDashboard provides a mock function with given fields: ctx, query
func (_m *FakeDashboardStore) GetDashboard(ctx context.Context, query *GetDashboardQuery) (*Dashboard, error) {
ret := _m.Called(ctx, query)

View File

@ -1721,6 +1721,22 @@ var (
AllowSelfServe: false,
Owner: identityAccessTeam,
},
{
Name: "ABTestFeatureToggleA",
Description: "Test feature toggle to see how cohorts could be set up AB testing",
Stage: FeatureStageExperimental,
Owner: grafanaSharingSquad,
Expression: "false",
HideFromDocs: true,
},
{
Name: "ABTestFeatureToggleB",
Description: "Test feature toggle to see how cohorts could be set up AB testing",
Stage: FeatureStageExperimental,
Owner: grafanaSharingSquad,
Expression: "false",
HideFromDocs: true,
},
}
)

View File

@ -230,3 +230,5 @@ k8SFolderCounts,experimental,@grafana/search-and-storage,false,false,false
k8SFolderMove,experimental,@grafana/search-and-storage,false,false,false
improvedExternalSessionHandlingSAML,preview,@grafana/identity-access-team,false,false,false
teamHttpHeadersMimir,experimental,@grafana/identity-access-team,false,false,false
ABTestFeatureToggleA,experimental,@grafana/sharing-squad,false,false,false
ABTestFeatureToggleB,experimental,@grafana/sharing-squad,false,false,false

1 Name Stage Owner requiresDevMode RequiresRestart FrontendOnly
230 k8SFolderMove experimental @grafana/search-and-storage false false false
231 improvedExternalSessionHandlingSAML preview @grafana/identity-access-team false false false
232 teamHttpHeadersMimir experimental @grafana/identity-access-team false false false
233 ABTestFeatureToggleA experimental @grafana/sharing-squad false false false
234 ABTestFeatureToggleB experimental @grafana/sharing-squad false false false

View File

@ -930,4 +930,12 @@ const (
// FlagTeamHttpHeadersMimir
// Enables LBAC for datasources for Mimir to apply LBAC filtering of metrics to the client requests for users in teams
FlagTeamHttpHeadersMimir = "teamHttpHeadersMimir"
// FlagABTestFeatureToggleA
// Test feature toggle to see how cohorts could be set up AB testing
FlagABTestFeatureToggleA = "ABTestFeatureToggleA"
// FlagABTestFeatureToggleB
// Test feature toggle to see how cohorts could be set up AB testing
FlagABTestFeatureToggleB = "ABTestFeatureToggleB"
)

View File

@ -3,6 +3,34 @@
"apiVersion": "featuretoggle.grafana.app/v0alpha1",
"metadata": {},
"items": [
{
"metadata": {
"name": "ABTestFeatureToggleA",
"resourceVersion": "1736782112674",
"creationTimestamp": "2025-01-13T15:28:32Z"
},
"spec": {
"description": "Test feature toggle to see how cohorts could be set up AB testing",
"stage": "experimental",
"codeowner": "@grafana/sharing-squad",
"hideFromDocs": true,
"expression": "false"
}
},
{
"metadata": {
"name": "ABTestFeatureToggleB",
"resourceVersion": "1736782112674",
"creationTimestamp": "2025-01-13T15:28:32Z"
},
"spec": {
"description": "Test feature toggle to see how cohorts could be set up AB testing",
"stage": "experimental",
"codeowner": "@grafana/sharing-squad",
"hideFromDocs": true,
"expression": "false"
}
},
{
"metadata": {
"name": "accessActionSets",

View File

@ -167,6 +167,9 @@ func TestFeatureToggleFiles(t *testing.T) {
func verifyFlagsConfiguration(t *testing.T) {
legacyNames := map[string]bool{
"live-service-web-worker": true,
// TODO: Remove this when removing feature toggles
"ABTestFeatureToggleA": true,
"ABTestFeatureToggleB": true,
}
invalidNames := make([]string, 0)