Load feature flags from new endpoint - #190
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for loading “enhanced” feature flags from the dedicated Azure App Configuration feature-flag endpoint, merges them with classic feature flags (with enhanced taking precedence), and propagates the new refresh/ETag tracking through the controller reconciliation flow.
Changes:
- Introduces an
AppConfigurationClientabstraction that wraps both key-value and feature-flag endpoint clients. - Adds enhanced feature-flag loading + ETag change detection, and merges enhanced/classic feature flags into the existing feature management output.
- Extends tracing/telemetry plumbing and controller refresh state to account for enhanced feature flags.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/loader/settings_client.go | Adds enhanced feature-flag settings + ETag-check clients using the dedicated feature-flag pager. |
| internal/loader/request_tracing.go | Adds correlation-context telemetry flag for enhanced feature flags. |
| internal/loader/mocks/mock_configuration_settings_retriever.go | Extends retriever mock with enhanced feature-flag change-check method. |
| internal/loader/feature_flag_converter.go | Converts enhanced endpoint schema into Microsoft feature management schema (snake_case). |
| internal/loader/feature_flag_converter_test.go | Adds unit tests for schema conversion and enhanced endpoint paging/ETag behavior. |
| internal/loader/configuration_setting_loader.go | Loads classic + enhanced feature flags, merges/deduplicates them, and tracks enhanced ETags. |
| internal/loader/configuration_client_manager.go | Switches client wrapper to use AppConfigurationClient and new constructors. |
| internal/loader/configuraiton_setting_loader_test.go | Updates tests/mocks to new client wrapper and additional enhanced calls. |
| internal/loader/app_configuration_client.go | New wrapper that creates/holds both azappconfig.Client and FeatureFlagClient. |
| internal/controller/suite_test.go | Stubs enhanced change check in controller test suite defaults. |
| internal/controller/processor.go | Adds refresh-state plumbing for enhanced feature flags during feature-flag refresh. |
| internal/controller/processor_test.go | Stubs enhanced change check in processor tests. |
| internal/controller/appconfigurationprovider_controller.go | Extends reconciliation state with enhanced feature-flag ETags. |
Files not reviewed (1)
- internal/loader/mocks/mock_configuration_settings_retriever.go: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| func (csl *ConfigurationSettingLoader) getFeatureFlagSettings(ctx context.Context) (map[string]interface{}, map[acpv1.ComparableSelector][]*azcore.ETag, error) { | ||
| func (csl *ConfigurationSettingLoader) CheckIfEnhancedFeatureFlagsChanged(ctx context.Context, eTags map[acpv1.ComparableSelector][]*azcore.ETag) (bool, error) { | ||
| settingsClient := csl.SettingsClient |
There was a problem hiding this comment.
Any reason we use SettingClient for enhanced feature flagchange check instead of directly using &EnhancedFeatureFlagEtagsClient?
There was a problem hiding this comment.
The interface separates request behavior from failover behavior, lets the loader apply endpoint rotation/backoff uniformly to all request types. Also, in test a mock SettingsClient can be injected to return controlled responses.
In prod, SettingsClient is normally nil so enhanced FF client is created.
No description provided.