Closed zhenlan closed 8 months ago
@zhenlan I assume you are using Microsoft Feature Flag schema. I don't know whether this is the reason, but I found you used "StatusOverride" instead of "status_override".
I think this is because .NET provider/ feature management lib cannot find the StatusOverride field.
@zhenlan I tested this on my side with the following feature flag configuration:
{
"FeatureManagement": {
"Greeting": {
"Variants": [
{
"Name": "Off",
"ConfigurationValue": "false",
"StatusOverride": "Disabled"
},
{
"Name": "On",
"ConfigurationValue": "true",
"StatusOverride": "Enabled"
}
],
"Allocation": {
"Percentile": [
{
"Variant": "Off",
"From": 0,
"To": 80
},
{
"Variant": "On",
"From": 80,
"To": 100
}
],
"DefaultWhenEnabled": "Off",
"DefaultWhenDisabled": "Off"
},
"EnabledFor": [
{
"Name": "AlwaysOn"
}
]
}
}
}
and
{
"feature_management": {
"feature_flags": [
{
"id": "Greeting",
"description": "",
"enabled": true,
"variants": [
{
"name": "Off",
"configuration_value": "false",
"status_override": "Disabled"
},
{
"name": "On",
"configuration_value": "true",
"status_override": "Enabled"
}
],
"allocation": {
"percentile": [
{
"variant": "Off",
"from": 0,
"to": 80
},
{
"variant": "On",
"from": 80,
"to": 100
}
],
"default_when_enabled": "Off",
"default_when_disabled": "Off"
},
"telemetry": {
"enabled": true
}
}
]
}
}
Both gave me false for showGreeting2
.
@zhenlan I assume you are using Microsoft Feature Flag schema. I don't know whether this is the reason, but I found you used "StatusOverride" instead of "status_override
No, I loaded the feature flag from AppConfig. But you are right, this does the trick.
This is so confusing. Maybe we should rethink the support for Pascal casing of new properties in .NET.
Maybe we should rethink the support for Pascal casing of new properties in .NET.
Do you mean to consider no longer adding new properties to the .NET feature flag schema?
Maybe we should rethink the support for Pascal casing of new properties in .NET.
Do you mean to consider no longer adding new properties to the .NET feature flag schema?
Correct. The alternative is to use the snake casing there too, but it may look weird.
The alternative is to use the snake casing there too, but it may look weird.
Agree, if anything it's just that we deprecate the .NET flag schema in a major version bump.
@zhiyuanliang-ms if we reached consensus that we will not support new properties in the old schema, we should open a new issue (given this one is closed) to clean them up.
@zhenlan Agree.
Hi, the
StatusOverride
doesn't work for me. May I get some help?Here is my feature flag
Here is my code for a razor page
When "Off" variant is assigned, the
IsEnabledAsync
is expected to return false, but I always got true from it. This is their values under the debuggerHere are my project dependencies
Do I miss anything?