Azure / azure-sdk-for-js

This repository is for active development of the Azure SDK for JavaScript (NodeJS & Browser). For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/javascript/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-js.
MIT License
2.07k stars 1.19k forks source link

Feature flags are missing prop requirement_type after using parseFeatureFlag #31446

Open iPrytz opened 5 days ago

iPrytz commented 5 days ago

Describe the bug I am consuming the app-configuration package to get feature flags from our App Config. Everyting works great to fetch the config and to use parseFeatureFlag. I get all the data exept for the property conditions.requirement_type. Here is the problem, only selecting conditions.client_filters : https://github.com/Azure/azure-sdk-for-js/blob/113b188eba7cc41cd79de8a7b6d886208c9e3165/sdk/appconfiguration/app-configuration/src/featureFlag.ts#L115

To Reproduce Steps to reproduce the behavior:

  1. create a feature flag in app config in azure portal
  2. install and use the @azure/app-configuration in node to set up the client to be able to fetch the config
  3. use the client.getConfigurationSetting to fetch the feature flag
  4. use parseFeatureFlag to parse the GetConfigurationSettingResponse
  5. data.value.conditions.requirement_type dosn't exist

Expected behavior I expect the json data data.value.conditions.requirement_type to be inluded in the parsed object,

Screenshots This is the parsed json without using the built in parseFeatureFlag:

{
    "client_filters": [
        {
            "name": "Microsoft.Targeting",
            "parameters": {
                "Audience": {
                    "Users": [
                        "dev-user"
                    ],
                    "Groups": [
                        {
                            "Name": "dev-group",
                            "RolloutPercentage": 100
                        }
                    ],
                    "DefaultRolloutPercentage": 50
                }
            }
        },
        {
            "name": "Microsoft.TimeWindow",
            "parameters": {
                "Start": "Tue, 15 Oct 2024 22:00:00 GMT",
                "End": "Tue, 29 Oct 2024 23:00:00 GMT"
            }
        },
        {
            "name": "My-Filter",
            "parameters": {
                "ID": 0
            }
        }
    ],
    "requirement_type": "All"
}

Additional context

minhanh-phan commented 5 days ago

Hi @iPrytz, thank you for raising the issue. Please be patient as we take a look at it and get back to you as soon as possible. Please let us know if you have any questions in the meantime. Thank you!