Releases: microsoft/FeatureManagement-Dotnet
2.6.0-preview
Feature - RequirementType
Features can now declare a RequirementType. The default RequirementType is Any, which means if any of it's filters evaluate to true, then the feature will be enabled. Declaring a RequirementType of All means that every filter must evaluate to true in order for the feature to be enabled. Added in #221.
"FeatureW": {
"RequirementType": "All",
"EnabledFor": []
}For more details read here
Targeting Exclusion
Targeting filters define an Audience. Now, Audiences can be fine tuned to exclude certain users and groups. By adding an Exclusion to an Audience, targeting filters will evaluate to false for users that are either directly defined, or a part of a group that is defined within the Exclusion. This takes priority over any other section of the Audience. Added in #218.
"Exclusion": {
"Users": [
"Mark"
],
"Groups": [
"Admins"
]
}For more details read here
3.0.0-preview
DEPRECATED
This release was deprecated. The dynamic feature functionality will be re-introduced in a later version with some design changes.
Microsoft.FeatureManagement Updates
The packages associated with this release are
Preview Release
A new set of APIs has been added to support dynamic features. The dynamic feature experience can be considered to be in preview.
Features
Dynamic Features
Dynamic features are a tool that can be used to surface different variants of a feature to different segments of an audience. Previously, this library only worked with feature flags. Feature flags are limited to boolean values, as they are either enabled or disabled. Dynamic features have dynamic values. They can be string, int, a complex object, or any other type.
//
// Modify view based off multiple possible variants
model.BackgroundUrl = dynamicFeatureManager.GetVariantAsync<string>("HomeBackground", cancellationToken);
return View(model);For more details read here.
Cancellation token support
Version 2 of Microsoft.FeatureManagement has an asynchronous pipeline, but cancellation token support was not added. Adding support for this in v2 would have required changing interfaces, thus a breaking change. V3 introduces this breaking change, and now proper cancellation is supported through the pipeline.
New Configuration Schema
The original schema of the "FeatureManagement" configuration section treated all sub objects as feature flags. Now there are dynamic features alongside feature flags. Additionally, there are other switches that are expected to be added in the future to customize global feature management state. To make room for this the schema has been updated.
{
"FeatureManagement": {
"FeatureFlags": {
},
"DynamicFeatures": {
}
}
}For more details read here.
Breaking Changes
IFeatureFilter.EvaluateAsyncnow accepts a cancellation token.IFeatureFilter.EvaluateAsync(FeatureFilterEvaluationContext)->IFeatureFilter.EvaluateAsync(FeatureFilterEvaluationContext, CancellationToken)- All built-in feature filters
EvaluateAsyncmethod now require a cancellation token. - An equivalent change applies to
IContextualFeatureFilter.
ITargetingContextAccessor.GetContextAsyncnow accepts a cancellation token.ITargetingContextAccessor.GetContextAsync()->ITargetingContextAccessor.GetContextAsync(CancellationToken).
- All async
IFeatureManagermethods now accept a cancellation token. IFeatureManager.GetFeatureNamesAsynchas been renamed toIFeatureManager.GetFeatureFlagNamesAsync.IFeatureDefinitionProviderhas been renamed toIFeatureFlagDefinitionProvider.- All methods now accept cancellation token.
ISessionManagernow accepts cancellation token.FeatureDefinitionrenamed toFeatureFlagDefinition.IFeatureManagementBuildernow declaresAddFeatureVariantAssigner.FeatureFilterEvaluationContext.FeatureNamerenamed toFeatureFilterEvaluationContext.FeatureFlagName
2.5.1
Microsoft.FeatureManagement Updates
The packages associated with this release are
Bug fix
- Updated summary on
FeatureGateAttributeto mention that it is usable on Razor pages. (#170)
2.5.0
Microsoft.FeatureManagement Updates
The packages associated with this release are
Enhancements
- Updated
FeatureGateAttributeto support Razor pages. This attribute can be placed on Razor page handlers to control access to the page based on whether a feature flag is on or off. (#166)
Bug fix
- Fixed an issue in
PercentageFilterwhere a feature may occasionally be considered as on even when the filter is set to 0 percent. (#156)
2.4.0
Microsoft.FeatureManagement Updates
The packages associated with this release are
Enhancements
- Added option to throw when attempting to evaluate a missing feature. (#140)
IFeatureManagementSnapshotis now thread-safe. (#141)
Bug fix
FilterAliasAttributenow uses the proper parameter name in anArgumentNullExceptionifaliasis null.
2.3.0
Microsoft.FeatureManagement Updates
The packages associated with this release are
Features
net5.0 Targeting
The net5.0 framework has been added to the list of target frameworks. This change resolves dependency issues for ASP.NET Core 5.0 applications.
Bug fix
- The license URL for these packages has been fixed.
2.2.0
Microsoft.FeatureManagement Updates
The packages associated with this release are
Stable Release
No changes have been made in this version. This is the first stable release with the targeting feature filter (introduced in 2.1.0-preview) and custom feature providers (introduced in 2.2.0-preview).
2.2.0-preview
Microsoft.FeatureManagement Updates
The packages associated with this release are
Preview Release
A new set of APIs has been added to support custom feature providers. These APIs can be considered to be in preview.
Features
Custom Feature Providers
Implementing a custom feature provider enables developers to to read feature flags from sources such as a database or a feature management service. For more information on the concept of custom feature providers and how to use this new feature take a look at the project's readme.
Netcoreapp3.1 Targeting
The netcoreapp3.1 framework has been added to the list of target frameworks. This change resolves dependency issues for ASP.NET Core 3.1 applications.
2.1.0-preview
Microsoft.FeatureManagement Updates
The packages associated with this release are
Preview Release
A new set of APIs has been added to support targeting. The targeting experience can be considered to be in preview.
Features
Targeting
Targeting enables developers to progressively roll out features to a target audience that can be increased gradually. For more information on the concept of targeting and how to use this new feature take a look at the project's readme.
2.0.0
Microsoft.FeatureManagement Updates
The packages associated with this release are
Stable Release
This release is the first stable release of the Microsoft.FeatureManagement libraries.
Features
Enumerating Feature Names
The IFeatureManager interface now exposes a way to enumerate all feature names that are registered in the system. This enables work flows where the states of all known features need to be evaluated.
IFeatureManager fm;
await foreach (string featureName in fm.GetFeatureNamesAsync())
{
await IsEnabledAsync(featureName);
}
Important: Using the await foreach syntax requires using version 8.0 or above of C#.
Missing Feature Filters
When the feature manager tries to evaluate the state of a feature that depends on a missing feature filter it will now throw a FeatureManagementException with the error MissingFeatureFilter.
The new fail-fast behavior can be disabled via feature management options if the old behavior to ignore missing feature filters is desired.
services.Configure<FeatureManagementOptions>(options =>
{
options.IgnoreMissingFeatureFilters = true;
});
Breaking Changes
- FeatureManager now throws a
FeatureManagementExceptionwith errorAmbiguousFeatureFilter, instead ofInvalidOperationException, if a feature makes an ambiguous reference to two or more feature filters. Task<bool> ISessionManager.TryGetAsync(string featureName, out bool enabled)has been changed toTask<bool?> ISessionManager.GetAsync(string featureName)to enable async implementations.