Skip to content

load feature flags from new endpoint - #341

Open
linglingye001 wants to merge 14 commits into
previewfrom
linglingye/load-new-flag
Open

load feature flags from new endpoint#341
linglingye001 wants to merge 14 commits into
previewfrom
linglingye/load-new-flag

Conversation

@linglingye001

Copy link
Copy Markdown
Member

Summary
Adds support for loading feature flags from new endpoint (via FeatureFlagClient.listFeatureFlags), in addition to the classic key-value path. When feature flags are enabled, the provider now loads flags from both sources and merges them, with flags from the new endpoint taking precedence over classic ones of the same name. Reference Azure/AppConfiguration-DotnetProvider#738

Key changes

  • Added appConfigClient.ts: an IAppConfigurationClient interface plus AppConfigClient implementation that wraps both AppConfigurationClient (classic KV) and FeatureFlagClient (new FF endpoint). Each method applies request tracing before delegating to the underlying SDK client.

  • Added featureFlagConverter.ts with convertToMicrosoftSchema(), which maps the SDK's typed FeatureFlag (camelCase) into the Microsoft Feature Management schema consumed by feature_management.feature_flags.

  • Load and merge on init and on refresh: #loadClassicFeatureFlags() + #loadFeatureFlags() → #setFeatureFlags() dedups by name (new endpoint supersedes classic).

  • Change detection covers both paths

Comment thread src/featureManagement/featureFlagConverter.ts
Comment thread src/requestTracing/utils.ts
Comment thread test/requestTracing.test.ts Outdated
Comment thread src/appConfigClient.ts Outdated
Comment thread src/configurationClientManager.ts Outdated
Comment thread src/appConfigClient.ts Outdated
Comment thread test/utils/testHelper.ts Outdated
Comment thread test/utils/testHelper.ts Outdated
Comment thread test/utils/testHelper.ts Outdated
Comment thread test/utils/testHelper.ts
Comment thread test/afd.test.ts
Comment thread src/featureManagement/featureFlagConverter.ts Outdated
Comment thread src/featureManagement/featureFlagConverter.ts Outdated
Comment thread src/featureManagement/featureFlagConverter.ts Outdated
Comment thread src/appConfigurationImpl.ts
Comment thread src/appConfigurationImpl.ts
Comment thread src/appConfigurationImpl.ts Outdated
Comment thread src/appConfigurationImpl.ts
Comment thread src/appConfigurationImpl.ts Outdated
Comment thread src/appConfigurationImpl.ts
Comment thread src/appConfigurationImpl.ts
Comment thread src/featureManagement/featureFlagConverter.ts Outdated
Comment thread src/requestTracing/utils.ts
Comment thread src/featureManagement/featureFlagConverter.ts Outdated
Comment thread src/featureManagement/featureFlagConverter.ts
}

return {
...options,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not allow user to override apiversion for feature flag client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants