-
Notifications
You must be signed in to change notification settings - Fork 4
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Feature flags are provided by IFeatureFlagProvider.
FeatureManagement-JavaScript/src/featureProvider.ts
Lines 7 to 18 in b70bbd3
| export interface IFeatureFlagProvider { | |
| /** | |
| * Get all feature flags. | |
| */ | |
| getFeatureFlags(): Promise<FeatureFlag[]>; | |
| /** | |
| * Get a feature flag by name. | |
| * @param featureName The name of the feature flag. | |
| */ | |
| getFeatureFlag(featureName: string): Promise<FeatureFlag | undefined>; | |
| } |
We have two impl of feature flag providers for map-based and object-based usage. Data source can be arbitrary data but none of them validate whether a feature flag is valid according to the schema, which is not as robust as expected.
Two follow-up actions:
- In our built-in IFeatureFlagProvider impl, add validation and throw errors when data source itself is invalid.
- As customers can impl their own provider (potentially provide invalid data), in our impl of public APIs like
isEnabledandgetVariant, we can add validation after getting a feature flag from the provider, ensure we don't encounter unexpected error later.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request