-
Notifications
You must be signed in to change notification settings - Fork 119
Enhances FeatureManager to throw an exception for missing feature filters. #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhances FeatureManager to throw an exception for missing feature filters. #50
Conversation
…r and the feature hasn't been registered, an exception will be thrown when the feature will be evaluated. (microsoft#13)
…thrown when a filter is missing.
| { | ||
| /// <summary> | ||
| /// Controls the behavior of feature evaluation when dependent feature filters are missing. | ||
| /// If missing features filters are not ignored an exception will be thrown when attempting to evaluate a feature that depends on a missing feature filter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: ... features filters ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks ! I'll update before merge.
zhenlan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
![]()
| _logger = loggerFactory.CreateLogger<FeatureManager>(); | ||
| _filterMetadataCache = new ConcurrentDictionary<string, IFeatureFilterMetadata>(); | ||
| _contextualFeatureFilterCache = new ConcurrentDictionary<string, ContextualFeatureFilterEvaluator>(); | ||
| _options = options?.Value ?? throw new ArgumentNullException(nameof(options)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
options?.Value [](start = 23, length = 14)
so we don't expect a default value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default value should be returned by Value.
The current feature manager implementation only logs a warning when a feature filter is missing for a given feature. This makes missing feature filters tricky to diagnose and can lead to unintended behavior. This enhancement changes the default behavior of the feature manager so that it will throw a
FeatureManagementExceptionwhen it encounters a missing feature filter.This new behavior can be disabled by configuring the feature management options.
This resolves #13
@codapus-co