-
Notifications
You must be signed in to change notification settings - Fork 40
Fix missing feature flag status and enabled logic #525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| // Always on | ||
| keyValues.Add(new KeyValuePair<string, string>(featureFlagPath, true.ToString())); | ||
| // Add the AlwaysOn filter instead of setting the flag to "true" so feature management doesn't skip evaluating variants and telemetry when present | ||
| if (featureFlag.Variants != null || featureFlag.Telemetry != null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just want to mention that this condition could be removed so that we just always send AlwaysOn instead of setting the flag to true. It simplifies the logic and would better handle any future additions to the feature definition, but it would basically remove the optimization in the feature management library to skip evaluating the rest of the flag if it's set to true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer removing the optimization for simplicity / if we add more fields in the future, we don't have to update this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree on simplicity.
...ns.Configuration.AzureAppConfiguration/FeatureManagement/FeatureManagementKeyValueAdapter.cs
Outdated
Show resolved
Hide resolved
...ns.Configuration.AzureAppConfiguration/FeatureManagement/FeatureManagementKeyValueAdapter.cs
Outdated
Show resolved
Hide resolved
| { | ||
| keyValues.Add(new KeyValuePair<string, string>($"{FeatureManagementConstants.SectionName}:{featureFlag.Id}", false.ToString())); | ||
| // Only explicitly set the flag to false if there are no variants to override the enabled state | ||
| if (featureFlag.Variants == null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would need the same "Variants == null" && "Telemetry == null" logic as above.
But more importantly, I think we just remove this shortcut as well. Old FM will see no Filters and treat it as false, New FM will respect the status of Disabled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I agree with removing it now too
No description provided.