From ebf3102244c3def64cba69da55a5fe0e0dfa95be Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Wed, 8 Nov 2023 15:06:01 +0100 Subject: [PATCH] chore: add detect segment usage in CRs flag (#5302) As the title says, this PR adds a flag to unleash for detecting segment usage in CRs. --- src/lib/__snapshots__/create-config.test.ts.snap | 1 + src/lib/types/experimental.ts | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/__snapshots__/create-config.test.ts.snap b/src/lib/__snapshots__/create-config.test.ts.snap index 90f9fe4ea22d..5c07d1b07efe 100644 --- a/src/lib/__snapshots__/create-config.test.ts.snap +++ b/src/lib/__snapshots__/create-config.test.ts.snap @@ -77,6 +77,7 @@ exports[`should create default config 1`] = ` "customRootRolesKillSwitch": false, "demo": false, "dependentFeatures": false, + "detectSegmentUsageInChangeRequests": false, "disableBulkToggle": false, "disableEnvsOnRevive": false, "disableMetrics": false, diff --git a/src/lib/types/experimental.ts b/src/lib/types/experimental.ts index 690d584c5a19..5832ff7f64e6 100644 --- a/src/lib/types/experimental.ts +++ b/src/lib/types/experimental.ts @@ -36,7 +36,8 @@ export type IFlagKey = | 'featureSwitchRefactor' | 'featureSearchAPI' | 'featureSearchFrontend' - | 'scheduledConfigurationChanges'; + | 'scheduledConfigurationChanges' + | 'detectSegmentUsageInChangeRequests'; export type IFlags = Partial<{ [key in IFlagKey]: boolean | Variant }>; @@ -172,6 +173,11 @@ const flags: IFlags = { process.env.UNLEASH_EXPERIMENTAL_SCHEDULED_CONFIGURATION_CHANGES, false, ), + detectSegmentUsageInChangeRequests: parseEnvVarBoolean( + process.env + .UNLEASH_EXPERIMENTAL_DETECT_SEGMENT_USAGE_IN_CHANGE_REQUESTS, + false, + ), }; export const defaultExperimentalOptions: IExperimentalOptions = {