From 9d2d682a229f4dc01b954fe529b40b971967e227 Mon Sep 17 00:00:00 2001 From: Zhiyuan Liang <141655842+zhiyuanliang-ms@users.noreply.github.com> Date: Thu, 23 Nov 2023 15:17:41 +0800 Subject: [PATCH 1/9] Update FeatureManagement 3.1.0 release note --- releaseNotes/Microsoft.Featuremanagement.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/releaseNotes/Microsoft.Featuremanagement.md b/releaseNotes/Microsoft.Featuremanagement.md index 59d2fb6e..914debe5 100644 --- a/releaseNotes/Microsoft.Featuremanagement.md +++ b/releaseNotes/Microsoft.Featuremanagement.md @@ -4,6 +4,22 @@ # Microsoft.FeatureManagement.AspNetCore [Source code ][source_code_web] | [Package (NuGet)][package_web] | [Samples][samples_web] | [Product documentation][docs] +## 3.1.0 - November 23, 2023 + +### Changes + +* Exposing FeatureManager and ConfigurationFeatureDefinitionProvider to public. +The `FeatureManager` and `ConfigurationFeatureDefinitionProvider` classes are the core services of the feature management system. In the past, both of them were internal and could only be registered via the AddFeatureManagement() method, which relies on `Microsoft.Extensions.DependencyInjection`. This limitation prevented third-party DI container systems from registering these classes, making them incompatible with the entire feature management system. With this change, all Feature Management services have been made accessible to other DI containers. (Related issues: [#126](https://github.com/microsoft/FeatureManagement-Dotnet/issues/126) [#258](https://github.com/microsoft/FeatureManagement-Dotnet/issues/258)) + + Additionally, the recommended [way](https://learn.microsoft.com/en-us/aspnet/core/blazor/security/server/interactive-server-side-rendering?view=aspnetcore-7.0#ihttpcontextaccessorhttpcontext-in-razor-components) for accessing `HttpContext` in Blazor is through a scoped context provider service. The singleton `HttpContextAccessor` pattern, while works well in ASP.NET Core, becomes unreliable in Blazor environments. As a result, to use `Targeting` in Blazor, the targeting filter and targeting context accessor should be registered as scoped. (Related issue: [#15](https://github.com/microsoft/FeatureManagement-Dotnet/issues/15) [#258](https://github.com/microsoft/FeatureManagement-Dotnet/issues/258)) + +* AddScopedFeatureManagement +We have introduced an alternative way `AddScopedFeatureManagement()` to register the feature management system, where the feature manager and all feature filters will be registered as scoped. It ensures that the integration aligns with Blazor's best practices for handling `HttpContext` and enhances the overall ease of use. There is an ongoing PR to demonstrate how to use FeatureManagement in Blazor server app: [#306](https://github.com/microsoft/FeatureManagement-Dotnet/pull/306) + +### Bug Fixes +* Preserved the behavior in 2.x.x when passing a configuration section to `AddFeatureManagement(IConfiguration configuration)`. ([#308](https://github.com/microsoft/FeatureManagement-Dotnet/issues/308)) +* Preserved the behavior in 2.x.x when there is a contextual filter is specified, but there is no appropriate context provided during the feature flag evaluation. ([#313](https://github.com/microsoft/FeatureManagement-Dotnet/issues/313)) + ## 3.0.0 - October 27, 2023 ### Breaking Changes From 835036d24350f138cf38897ef4ee83c709450ca2 Mon Sep 17 00:00:00 2001 From: Zhiyuan Liang <141655842+zhiyuanliang-ms@users.noreply.github.com> Date: Fri, 24 Nov 2023 11:30:47 +0800 Subject: [PATCH 2/9] update --- releaseNotes/Microsoft.Featuremanagement.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/releaseNotes/Microsoft.Featuremanagement.md b/releaseNotes/Microsoft.Featuremanagement.md index 914debe5..fd62795e 100644 --- a/releaseNotes/Microsoft.Featuremanagement.md +++ b/releaseNotes/Microsoft.Featuremanagement.md @@ -18,7 +18,7 @@ We have introduced an alternative way `AddScopedFeatureManagement()` to register ### Bug Fixes * Preserved the behavior in 2.x.x when passing a configuration section to `AddFeatureManagement(IConfiguration configuration)`. ([#308](https://github.com/microsoft/FeatureManagement-Dotnet/issues/308)) -* Preserved the behavior in 2.x.x when there is a contextual filter is specified, but there is no appropriate context provided during the feature flag evaluation. ([#313](https://github.com/microsoft/FeatureManagement-Dotnet/issues/313)) +* Preserved the behavior in 2.x.x when there is a contextual filter specified, but there is no appropriate context provided during the feature flag evaluation. ([#313](https://github.com/microsoft/FeatureManagement-Dotnet/issues/313)) ## 3.0.0 - October 27, 2023 From 62ac7d9a910cabb7d3786fd90117b7769dad71ad Mon Sep 17 00:00:00 2001 From: Zhiyuan Liang <141655842+zhiyuanliang-ms@users.noreply.github.com> Date: Tue, 28 Nov 2023 09:55:24 +0800 Subject: [PATCH 3/9] update --- releaseNotes/Microsoft.Featuremanagement.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/releaseNotes/Microsoft.Featuremanagement.md b/releaseNotes/Microsoft.Featuremanagement.md index fd62795e..482d745e 100644 --- a/releaseNotes/Microsoft.Featuremanagement.md +++ b/releaseNotes/Microsoft.Featuremanagement.md @@ -8,16 +8,15 @@ ### Changes -* Exposing FeatureManager and ConfigurationFeatureDefinitionProvider to public. -The `FeatureManager` and `ConfigurationFeatureDefinitionProvider` classes are the core services of the feature management system. In the past, both of them were internal and could only be registered via the AddFeatureManagement() method, which relies on `Microsoft.Extensions.DependencyInjection`. This limitation prevented third-party DI container systems from registering these classes, making them incompatible with the entire feature management system. With this change, all Feature Management services have been made accessible to other DI containers. (Related issues: [#126](https://github.com/microsoft/FeatureManagement-Dotnet/issues/126) [#258](https://github.com/microsoft/FeatureManagement-Dotnet/issues/258)) +* FeatureManager and ConfigurationFeatureDefinitionProvider are now public. + * Enables usage of external dependency injection containers. + * Allows usage of feature manager without requiring dependency injection. - Additionally, the recommended [way](https://learn.microsoft.com/en-us/aspnet/core/blazor/security/server/interactive-server-side-rendering?view=aspnetcore-7.0#ihttpcontextaccessorhttpcontext-in-razor-components) for accessing `HttpContext` in Blazor is through a scoped context provider service. The singleton `HttpContextAccessor` pattern, while works well in ASP.NET Core, becomes unreliable in Blazor environments. As a result, to use `Targeting` in Blazor, the targeting filter and targeting context accessor should be registered as scoped. (Related issue: [#15](https://github.com/microsoft/FeatureManagement-Dotnet/issues/15) [#258](https://github.com/microsoft/FeatureManagement-Dotnet/issues/258)) - -* AddScopedFeatureManagement -We have introduced an alternative way `AddScopedFeatureManagement()` to register the feature management system, where the feature manager and all feature filters will be registered as scoped. It ensures that the integration aligns with Blazor's best practices for handling `HttpContext` and enhances the overall ease of use. There is an ongoing PR to demonstrate how to use FeatureManagement in Blazor server app: [#306](https://github.com/microsoft/FeatureManagement-Dotnet/pull/306) +* Alternative method `AddScopedFeatureManagement` to register the feature management services. + * Enables the registration of the feature manager and feature filters as scoped services. ### Bug Fixes -* Preserved the behavior in 2.x.x when passing a configuration section to `AddFeatureManagement(IConfiguration configuration)`. ([#308](https://github.com/microsoft/FeatureManagement-Dotnet/issues/308)) +* Preserved the behavior in 2.x.x when passing a configuration section to `AddFeatureManagement(configuration)`. ([#308](https://github.com/microsoft/FeatureManagement-Dotnet/issues/308)) * Preserved the behavior in 2.x.x when there is a contextual filter specified, but there is no appropriate context provided during the feature flag evaluation. ([#313](https://github.com/microsoft/FeatureManagement-Dotnet/issues/313)) ## 3.0.0 - October 27, 2023 From 4af54a6b874d05dc76819b42974e7632ce25d009 Mon Sep 17 00:00:00 2001 From: Zhiyuan Liang <141655842+zhiyuanliang-ms@users.noreply.github.com> Date: Tue, 28 Nov 2023 14:35:40 +0800 Subject: [PATCH 4/9] Resolve comments --- releaseNotes/Microsoft.Featuremanagement.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/releaseNotes/Microsoft.Featuremanagement.md b/releaseNotes/Microsoft.Featuremanagement.md index 482d745e..e978ba23 100644 --- a/releaseNotes/Microsoft.Featuremanagement.md +++ b/releaseNotes/Microsoft.Featuremanagement.md @@ -6,18 +6,19 @@ ## 3.1.0 - November 23, 2023 -### Changes +### Enhancements -* FeatureManager and ConfigurationFeatureDefinitionProvider are now public. +* `FeatureManager` and `ConfigurationFeatureDefinitionProvider` are now public. * Enables usage of external dependency injection containers. - * Allows usage of feature manager without requiring dependency injection. + * Allows usage of `FeatureManager` without requiring dependency injection. -* Alternative method `AddScopedFeatureManagement` to register the feature management services. - * Enables the registration of the feature manager and feature filters as scoped services. +* Added [Blazor](https://dotnet.microsoft.com/en-us/apps/aspnet/web-apps/blazor) support for [additional security scenarios](https://learn.microsoft.com/en-us/aspnet/core/blazor/security/server/additional-scenarios?view=aspnetcore-7.0#pass-tokens-to-a-server-side-blazor-app). + * Added `AddScopedFeatureManagement()` method to register the feature manager and feature filters as scoped by default. + * Allows usage of scoped feature filters with context provider services to mitigate the [security risk](https://learn.microsoft.com/en-us/aspnet/core/blazor/security/server/interactive-server-side-rendering?view=aspnetcore-7.0#ihttpcontextaccessorhttpcontext-in-razor-components) when using `HttpContextAccessor` in Blazor components. ### Bug Fixes -* Preserved the behavior in 2.x.x when passing a configuration section to `AddFeatureManagement(configuration)`. ([#308](https://github.com/microsoft/FeatureManagement-Dotnet/issues/308)) -* Preserved the behavior in 2.x.x when there is a contextual filter specified, but there is no appropriate context provided during the feature flag evaluation. ([#313](https://github.com/microsoft/FeatureManagement-Dotnet/issues/313)) +* Fixed a bug introduced in the previous release where feature flags cannot be loaded from a custom section of configuration. +* Fixed a bug introduced in the previous release where evaluation of a feature flag that references a contextual feature filter may throw an exception if there is no appropriate context provided during evaluation. ## 3.0.0 - October 27, 2023 @@ -26,7 +27,7 @@ * Dropped netcoreapp3.1 and net5.0 target frameworks since both have reached the end of their life cycle. https://github.com/microsoft/FeatureManagement-Dotnet/pull/267 * All feature flags must be defined in a `FeatureManagement` section within configuration. Previously flags were discovered at the top level of configuration if the `FeatureManagement` section was not defined, but this functionality has been removed. https://github.com/microsoft/FeatureManagement-Dotnet/pull/261 -### Changes +### Enhancements * Built-in filters are registered by default. https://github.com/microsoft/FeatureManagement-Dotnet/pull/287 This includes: From 67a99899c08dde693f3f872851eb4ef128f60c0f Mon Sep 17 00:00:00 2001 From: Zhiyuan Liang <141655842+zhiyuanliang-ms@users.noreply.github.com> Date: Wed, 29 Nov 2023 10:38:58 +0800 Subject: [PATCH 5/9] Update --- releaseNotes/Microsoft.Featuremanagement.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/releaseNotes/Microsoft.Featuremanagement.md b/releaseNotes/Microsoft.Featuremanagement.md index e978ba23..155a1c86 100644 --- a/releaseNotes/Microsoft.Featuremanagement.md +++ b/releaseNotes/Microsoft.Featuremanagement.md @@ -39,7 +39,7 @@ * Added netstandard 2.1 as a target framework in the Microsoft.FeatureManagement package. https://github.com/microsoft/FeatureManagement-Dotnet/pull/267 * Added net7.0 as a target framework in the Microsoft.FeatureManagement.AspNetCore package. https://github.com/microsoft/FeatureManagement-Dotnet/pull/267 -## Bug Fixes +### Bug Fixes * Prevents the usage of colon in Feature names. * Adjusts log level for noisy warning when feature definitions are not found. * Fixed an edge case in targeting if a user is allocated to exactly the 100th percentile (~1 in 2 billion chance) From dd927ae2232a50d605639d013267f2ee4c1f36bd Mon Sep 17 00:00:00 2001 From: Zhiyuan Liang <141655842+zhiyuanliang-ms@users.noreply.github.com> Date: Thu, 30 Nov 2023 09:27:25 +0800 Subject: [PATCH 6/9] Re-added issue references --- releaseNotes/Microsoft.Featuremanagement.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/releaseNotes/Microsoft.Featuremanagement.md b/releaseNotes/Microsoft.Featuremanagement.md index 155a1c86..2b7b6616 100644 --- a/releaseNotes/Microsoft.Featuremanagement.md +++ b/releaseNotes/Microsoft.Featuremanagement.md @@ -17,8 +17,8 @@ * Allows usage of scoped feature filters with context provider services to mitigate the [security risk](https://learn.microsoft.com/en-us/aspnet/core/blazor/security/server/interactive-server-side-rendering?view=aspnetcore-7.0#ihttpcontextaccessorhttpcontext-in-razor-components) when using `HttpContextAccessor` in Blazor components. ### Bug Fixes -* Fixed a bug introduced in the previous release where feature flags cannot be loaded from a custom section of configuration. -* Fixed a bug introduced in the previous release where evaluation of a feature flag that references a contextual feature filter may throw an exception if there is no appropriate context provided during evaluation. +* Fixed a bug introduced in the previous release where feature flags cannot be loaded from a custom section of configuration. ([#308](https://github.com/microsoft/FeatureManagement-Dotnet/issues/308)) +* Fixed a bug introduced in the previous release where evaluation of a feature flag that references a contextual feature filter may throw an exception if there is no appropriate context provided during evaluation. ([#313](https://github.com/microsoft/FeatureManagement-Dotnet/issues/313)) ## 3.0.0 - October 27, 2023 From 68e78beda687df4f82cbc42578326d80b4326a27 Mon Sep 17 00:00:00 2001 From: Zhiyuan Liang <141655842+zhiyuanliang-ms@users.noreply.github.com> Date: Thu, 30 Nov 2023 09:57:02 +0800 Subject: [PATCH 7/9] Rewrite the Blazor support section --- releaseNotes/Microsoft.Featuremanagement.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/releaseNotes/Microsoft.Featuremanagement.md b/releaseNotes/Microsoft.Featuremanagement.md index 2b7b6616..d0b2f1a6 100644 --- a/releaseNotes/Microsoft.Featuremanagement.md +++ b/releaseNotes/Microsoft.Featuremanagement.md @@ -12,9 +12,10 @@ * Enables usage of external dependency injection containers. * Allows usage of `FeatureManager` without requiring dependency injection. -* Added [Blazor](https://dotnet.microsoft.com/en-us/apps/aspnet/web-apps/blazor) support for [additional security scenarios](https://learn.microsoft.com/en-us/aspnet/core/blazor/security/server/additional-scenarios?view=aspnetcore-7.0#pass-tokens-to-a-server-side-blazor-app). - * Added `AddScopedFeatureManagement()` method to register the feature manager and feature filters as scoped by default. - * Allows usage of scoped feature filters with context provider services to mitigate the [security risk](https://learn.microsoft.com/en-us/aspnet/core/blazor/security/server/interactive-server-side-rendering?view=aspnetcore-7.0#ihttpcontextaccessorhttpcontext-in-razor-components) when using `HttpContextAccessor` in Blazor components. +* Added support for server-side Blazor apps, where the following API can be used in place of the existing `AddFeatureManagement()` API. The new API registers the feature manager and feature filters as scoped services, while the existing API registers them as singletons. ([#258](https://github.com/microsoft/FeatureManagement-Dotnet/issues/258)) +``` C# +public static IFeatureManagementBuilder AddScopedFeatureManagement(this IServiceCollection services) +``` ### Bug Fixes * Fixed a bug introduced in the previous release where feature flags cannot be loaded from a custom section of configuration. ([#308](https://github.com/microsoft/FeatureManagement-Dotnet/issues/308)) From 90b49ba11299c34ff7ccd47b4f40a55272582388 Mon Sep 17 00:00:00 2001 From: Zhiyuan Liang <141655842+zhiyuanliang-ms@users.noreply.github.com> Date: Thu, 30 Nov 2023 12:29:17 +0800 Subject: [PATCH 8/9] Add issue reference --- releaseNotes/Microsoft.Featuremanagement.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/releaseNotes/Microsoft.Featuremanagement.md b/releaseNotes/Microsoft.Featuremanagement.md index d0b2f1a6..69f18d11 100644 --- a/releaseNotes/Microsoft.Featuremanagement.md +++ b/releaseNotes/Microsoft.Featuremanagement.md @@ -8,7 +8,7 @@ ### Enhancements -* `FeatureManager` and `ConfigurationFeatureDefinitionProvider` are now public. +* `FeatureManager` and `ConfigurationFeatureDefinitionProvider` are now public. ([#126](https://github.com/microsoft/FeatureManagement-Dotnet/issues/126)) * Enables usage of external dependency injection containers. * Allows usage of `FeatureManager` without requiring dependency injection. From 5b5854947c66a6f9e2f177d19252272ada2c3139 Mon Sep 17 00:00:00 2001 From: Zhiyuan Liang <141655842+zhiyuanliang-ms@users.noreply.github.com> Date: Thu, 30 Nov 2023 12:35:06 +0800 Subject: [PATCH 9/9] Add indentation --- releaseNotes/Microsoft.Featuremanagement.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/releaseNotes/Microsoft.Featuremanagement.md b/releaseNotes/Microsoft.Featuremanagement.md index 69f18d11..a466b040 100644 --- a/releaseNotes/Microsoft.Featuremanagement.md +++ b/releaseNotes/Microsoft.Featuremanagement.md @@ -13,9 +13,9 @@ * Allows usage of `FeatureManager` without requiring dependency injection. * Added support for server-side Blazor apps, where the following API can be used in place of the existing `AddFeatureManagement()` API. The new API registers the feature manager and feature filters as scoped services, while the existing API registers them as singletons. ([#258](https://github.com/microsoft/FeatureManagement-Dotnet/issues/258)) -``` C# -public static IFeatureManagementBuilder AddScopedFeatureManagement(this IServiceCollection services) -``` + ``` C# + public static IFeatureManagementBuilder AddScopedFeatureManagement(this IServiceCollection services) + ``` ### Bug Fixes * Fixed a bug introduced in the previous release where feature flags cannot be loaded from a custom section of configuration. ([#308](https://github.com/microsoft/FeatureManagement-Dotnet/issues/308))