Skip to content

Releases: microsoft/FeatureManagement-Dotnet

2.6.0-preview

24 Apr 22:36
5c3e941

Choose a tag to compare

2.6.0-preview Pre-release
Pre-release

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

17 Jun 23:31
bf76ce6

Choose a tag to compare

3.0.0-preview Pre-release
Pre-release

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.EvaluateAsync now accepts a cancellation token.
    • IFeatureFilter.EvaluateAsync(FeatureFilterEvaluationContext) -> IFeatureFilter.EvaluateAsync(FeatureFilterEvaluationContext, CancellationToken)
    • All built-in feature filters EvaluateAsync method now require a cancellation token.
    • An equivalent change applies to IContextualFeatureFilter.
  • ITargetingContextAccessor.GetContextAsync now accepts a cancellation token.
    • ITargetingContextAccessor.GetContextAsync() -> ITargetingContextAccessor.GetContextAsync(CancellationToken).
  • All async IFeatureManager methods now accept a cancellation token.
  • IFeatureManager.GetFeatureNamesAsync has been renamed to IFeatureManager.GetFeatureFlagNamesAsync.
  • IFeatureDefinitionProvider has been renamed to IFeatureFlagDefinitionProvider.
    • All methods now accept cancellation token.
  • ISessionManager now accepts cancellation token.
  • FeatureDefinition renamed to FeatureFlagDefinition.
  • IFeatureManagementBuilder now declares AddFeatureVariantAssigner.
  • FeatureFilterEvaluationContext.FeatureName renamed to FeatureFilterEvaluationContext.FeatureFlagName

2.5.1

06 Apr 21:25
572769b

Choose a tag to compare

Microsoft.FeatureManagement Updates

The packages associated with this release are

Bug fix

  • Updated summary on FeatureGateAttribute to mention that it is usable on Razor pages. (#170)

2.5.0

05 Apr 22:12
0b16694

Choose a tag to compare

Microsoft.FeatureManagement Updates

The packages associated with this release are

Enhancements

  • Updated FeatureGateAttribute to 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 PercentageFilter where a feature may occasionally be considered as on even when the filter is set to 0 percent. (#156)

2.4.0

05 Oct 23:16
8d1774f

Choose a tag to compare

Microsoft.FeatureManagement Updates

The packages associated with this release are

Enhancements

  • Added option to throw when attempting to evaluate a missing feature. (#140)
  • IFeatureManagementSnapshot is now thread-safe. (#141)

Bug fix

  • FilterAliasAttribute now uses the proper parameter name in an ArgumentNullException if alias is null.

2.3.0

21 May 18:03
df0f9d2

Choose a tag to compare

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

16 Sep 23:32
d29b699

Choose a tag to compare

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

10 Jul 23:35
d91bf9d

Choose a tag to compare

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

22 Apr 23:39
f7fbd2e

Choose a tag to compare

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

27 Feb 22:33
a0b31b3

Choose a tag to compare

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 FeatureManagementException with error AmbiguousFeatureFilter, instead of InvalidOperationException, 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 to Task<bool?> ISessionManager.GetAsync(string featureName) to enable async implementations.