-
Notifications
You must be signed in to change notification settings - Fork 39
Add environment variable to disable feature management schema compatibility logic #676
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
Add environment variable to disable feature management schema compatibility logic #676
Conversation
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.
Pull Request Overview
This PR introduces an environment variable to disable schema compatibility logic in the feature management provider, forcing all feature flags to use the Microsoft schema when enabled.
- Add
AZURE_APP_CONFIGURATION_FM_SCHEMA_COMPATIBILITY_DISABLED
support inFeatureManagementKeyValueAdapter
- Update conditional logic to respect the new environment variable
- Add a new unit test covering forced Microsoft schema behavior
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
src/Microsoft.Extensions.Configuration.AzureAppConfiguration/FeatureManagement/FeatureManagementKeyValueAdapter.cs | Read the new environment variable and adjust schema selection logic |
tests/Tests.AzureAppConfiguration/Unit/FeatureManagementTests.cs | Add test verifying behavior when the environment variable is set or unset |
Comments suppressed due to low confidence (2)
src/Microsoft.Extensions.Configuration.AzureAppConfiguration/FeatureManagement/FeatureManagementKeyValueAdapter.cs:22
- [nitpick] Consider renaming this constant to
DisableFmSchemaCompatibilityEnvironmentVariableName
to clearly indicate it holds the environment variable name.
private const string DisableFmSchemaCompatibilityEnvironmentVariable = "AZURE_APP_CONFIGURATION_FM_SCHEMA_COMPATIBILITY_DISABLED";
tests/Tests.AzureAppConfiguration/Unit/FeatureManagementTests.cs:2345
- Add a unit test for explicitly setting the environment variable to an invalid value (e.g., "notabool") to verify the default behavior fallback.
// Act - Verify normal behavior when environment variable is not set
...ns.Configuration.AzureAppConfiguration/FeatureManagement/FeatureManagementKeyValueAdapter.cs
Outdated
Show resolved
Hide resolved
...ns.Configuration.AzureAppConfiguration/FeatureManagement/FeatureManagementKeyValueAdapter.cs
Show resolved
Hide resolved
…eatureManagement/FeatureManagementKeyValueAdapter.cs Co-authored-by: Copilot <[email protected]>
...ns.Configuration.AzureAppConfiguration/FeatureManagement/FeatureManagementKeyValueAdapter.cs
Outdated
Show resolved
Hide resolved
…//github.com/Azure/AppConfiguration-DotnetProvider into ajusupovic/add-fmschema-compatibility-envvar
This PR adds the environment variable
AZURE_APP_CONFIGURATION_FM_SCHEMA_COMPATIBILITY_DISABLED
. When set totrue
, the provider will process and output all feature flags as the newer Microsoft schema. If false, the provider will function as it does today where a flag is only processed in the Microsoft schema if any of thevariants
,allocation
, ortelemetry
properties are present.