Comments (8)
Thank you all for your quick responses, it is greatly appreciated!
@hilljaycie14 You reference an example feature "TEST-123". What filters is that feature registered to use?
The registration is as follows, some code omitted for privacy concerns:
return services.AddFeatureManagement()
.AddFeatureFilter<MyContextualFilter>()
.AddFeatureFilter<MyFeatureFilter>()
@zhiyuanliang-ms thank you for your workaround && getting a quick PR up! Greatly appreciated!
from featuremanagement-dotnet.
@MoazAlkharfan Yes, this is a breaking change. This PR #314 fixed it. We are going to release 3.1.0 in the following days. 3.1.0 will include bug fix and some other new features.
from featuremanagement-dotnet.
Fixed in release 3.1.0
from featuremanagement-dotnet.
@hilljaycie14 You reference an example feature "TEST-123". What filters is that feature registered to use?
from featuremanagement-dotnet.
@hilljaycie14 I took a look and here's what I've found.
Version 3.0 has introduced a behavior change, perhaps one we can consider a regression/bug.
In version 2.6.1 it was fine for a feature to reference a contextual feature filter and not use it. The system would detect that the contextual filter referenced does exist, but since no app context was provided it would simply ignore evaluating the contextual filter. It's debatable whether or not this was the right behavior to be implemented, but nonetheless it's how it worked.
v3.0 changed this. Now, if a contextual filter is referenced, but no context that can be used for the filter is passed, then the system errors.
At a glance, it seems we should allow things to work as they did in 2.6.1
from featuremanagement-dotnet.
@hilljaycie14 A work around solution is to set the IgnoreMissingFeatureFilters option as true.
services.Configure<FeatureManagementOptions>(options => options.IgnoreMissingFeatureFilters = true);
I am working on a PR to resolve this issue and make the behavior consistent with 2.6.1.
Sorry for the inconvenience.
from featuremanagement-dotnet.
I checked the behavior in 2.6.1.
Let's say you have a non-contextual filter called FilterA and a contextual filters FilterB which accepts TypeT.
You also have a feature flag "MyFeature" which references FilterA and FilterB.
Assume that IgnoreMissingFeatureFilter is false.
When you call IsEnabledAsync("MyFeature")
In 2.6.1:
The metadata of FilterA and FilterB can be found by the feature manager. No exception will be thrown.
The context is not provided, feature manager will just ignore the FilterB.
In 3.0.0:
The metadata of FilterB cannot be found by the feature manager. In 3.0.0, context type and filter alias are both needed to get the metadata of a contextual filter. An exception will be thrown.
When you call IsEnabledAsync("MyFeature", context), if context's type is TypeT
The behaviors are the same.
When you call IsEnabledAsync("MyFeature", context), if context's type is TypeF
In 2.6.1:
The metadata of FilterA and FilterB can be found by the feature manager. No exception will be thrown.
The context type TypeF cannot be consumed by FilterB, feature manager will not find a ContextualFeatureFilterEvaluator for FilterB. The evaluation of FilterB will be skipped.
In 3.0.0:
The metadata of FilterB cannot be found by the feature manager. In 3.0.0, context type and filter alias are both needed to get the metadata of a contextual filter. An exception will be thrown.
from featuremanagement-dotnet.
Breaking change was not reported for the following scenario
With the below configuration, when using IFeatureManager.IsEnabledAsync("FeatureToCheck")
throws an exception for the ContextualFilter
instead of skipping the ContextualFilter
. but when using IFeatureManager.IsEnabledAsync("FeatureToCheck", context)
works fine.
"FeatureManagement": {
"FeatureToCheck": {
"RequirementType": "Any",
"EnabledFor": [
{
"Name": "ContextualFilter"
},
{
"Name": "NonContextualFilter"
}
]
}
}
from featuremanagement-dotnet.
Related Issues (20)
- Silent failure in TargetingTelemetryInitializer HOT 10
- The TargetingId should be included in the FeatureEvaluation event even if it's null/empty. HOT 4
- Targeting evaluation is CPU dependent. HOT 4
- Remove the support for variants and telemetry from the .NET feature flag schema HOT 14
- Include Targeting Information on outgoing telemetry HOT 2
- Support .NET 8 Targeting framework in Microsoft.FeatureManagement.Telemetry.ApplicationInsights.AspNetCore
- Target netstandard2.* in Microsoft.FeatureManagement.Telemetry.ApplicationInsights
- The approach to telemetry (using custom `ITelemetryPublisher`) seems overengineered and counter to modern OpenTelemetry abstractions HOT 37
- Add Default Http Targeting Context Accessor
- Consider moving `TargetingHttpContextMiddleware` to the App Insights package HOT 2
- No instance of ITargetingContextAccessor is available for variant assignment. HOT 6
- FeatureManagerSnapshot should snapshot TargetingContext as well
- EvaluationDataToApplicationInsights example
- Can't Set FeatureFilters In FeatureManager In .NET Framework Application HOT 7
- Update Package metadata
- Add a link to preview on main readme
- Cannot use the TargetingFilter in .NET class library project HOT 3
- Nuget "Microsoft.FeatureManagement.AspNetCore" Version 3.3.0 - Multiple feature filters match the configured filter named 'Microsoft.TimeWindow' HOT 8
- Consider using `TimeProvider` using Microsoft.Bcl.TimeProvider nuget package HOT 2
- Bug 4.0.0-preview: NullReferenceException when TargetingContext.UserId is null and TargetingEvaluationOption.IgnoreCase = true
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from featuremanagement-dotnet.