Skip to content

Releases: microsoft/FeatureManagement-Dotnet

2.3.0

21 May 18:03
df0f9d2
Compare
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
Compare
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
Compare
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
Compare
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
Compare
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.

2.0.0-preview-010610001-1263

28 Nov 01:02
dd7b9f6
Compare
Choose a tag to compare

Microsoft.FeatureManagement Updates

The packages associated with this release are

Major Version Bump

This release introduces some new features and some breaking changes, thus the major version has been bumped to 2.

Features

Async Feature Filters

Support for async feature filters has been added. This results in the entire feature management pipeline being asynchronous. Async feature filters pave the way to performing async workloads in feature filters if desired.

Before

IFeatureManager fm;

if (fm.IsEnabled("MyFeature"))
{

}

After

IFeatureManager fm;

if (await fm.IsEnabledAsync("MyFeature"))
{

}

Floating Context Support

The original design for the feature management library relied on applications to have an ambient context. An application's ambient context could be used in feature filters to obtain information such as user identity and other information relevant when toggling features. This led to a disconnect in console applications which do not have an ambient context in most cases. Now application's without an ambient context can float a context into the feature management system by using the new IFeatureManager.IsEnabledAsync<TContext>(string feature, TContext context) method. The context parameter is able to be consumed by feature filters that implement IContextualFeatureFilter.

Consumption

The ability to pass a context when evaluating a feature has been added to IFeatureManager.

IFeatureManager fm = services.GetRequiredService<IFeatureManager>();

await fm.IsEnabledAsync("featureName", new MyApplicationContext
{
  UserId = "someUser"
});

Contextual Feature Filters

Contextual feature filters are feature filters that can utilize a context provided by the application when evaluating whether a feature is on or off. Contextual feature filters are a generic type. Their generic type parameter describes the interface that the passed in context must implement for the filter to be able to evaluate it.

As an example, IContextualFeatureFilter<IAccountContext> requires a context that implements IAccountContext to be passed in. If a feature is checked for enabled and a context is provided that does not implement IAccountContext then the previously mentioned filter would not run.

IFeatureFilterMetadata

With the introduction of IContextualFeatureFilter there are now two types of feature filters including IFeatureFilter. The two types of feature filters both inherit IFeatureFilterMetadata. IFeatureFilterMetadata is a marker interface and does not actually provide any feature filtering capabilities. It is used as the new parameter type for IFeatureManagementBuilder.AddFeatureFilter.

Breaking Changes

  • IFeatureManager.IsEnabled is now asynchronous
    • IsEnabled was renamed to IsEnabledAsync.
    • IFeatureManagerSnapshot.IsEnabled is also affected.
  • IFeatureFilter.Evaluate is now asynchronous
    • Evaluate was renamed to EvaluateAsync.
  • Mvc.Filters.FilterCollection.AddForFeature now only accepts
    IAsyncActionFilter rather than any type of filter.
  • AddRouteForFeature has been removed.
  • ISessionManager is now an async interface.

1.0.0-preview-009000001-1251

26 Nov 00:20
c6ff04d
Compare
Choose a tag to compare
Added some missing commas in readme json. (#6)