Skip to content

Load feature flags from new endpoint - #190

Open
linglingye001 wants to merge 1 commit into
release/v2.7.0-previewfrom
linglingye/load-new-flags
Open

Load feature flags from new endpoint#190
linglingye001 wants to merge 1 commit into
release/v2.7.0-previewfrom
linglingye/load-new-flags

Conversation

@linglingye001

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

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 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 AppConfigurationClient abstraction 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.

Comment on lines +219 to +227
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
return nil, err
} else if page.FeatureFlags != nil {
enhancedFeatureFlags = append(enhancedFeatureFlags, page.FeatureFlags...)
latestEtags = append(latestEtags, page.ETag)
}
}
Comment on lines 414 to 416
if err := csl.processSettings(ctx, snapshotSettings, nestedCtx); err != nil {
return err
}
Comment on lines +600 to 604
for i := len(featureFlags) - 1; i >= 0; i-- {
id, _ := featureFlags[i][FeatureFlagIdKey].(string)
if seen[id] {
continue
}
Comment on lines +118 to +121
if processor.RefreshOptions.enhancedFeatureFlagRefreshNeeded, err = (processor.Retriever).CheckIfEnhancedFeatureFlagsChanged(processor.Context, reconcileState.EnhancedFeatureFlagETags); err != nil {
return err
}

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