Skip to content

Enhanced feature flags - #73

Open
linglingye001 wants to merge 1 commit into
release/v1.7.0-previewfrom
linglingye/enhanced-ff
Open

Enhanced feature flags#73
linglingye001 wants to merge 1 commit into
release/v1.7.0-previewfrom
linglingye/enhanced-ff

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 introduces enhanced feature flags support by loading feature flags from both classic key-value settings and the dedicated feature-flag endpoint, then merging them into the Microsoft Feature Management schema. It also updates client abstractions to support both settings and feature-flag operations and extends refresh/tracing behavior accordingly.

Changes:

  • Add enhanced feature flag loading + merging logic (classic KV feature flags + enhanced endpoint flags).
  • Introduce an appConfigClient abstraction (appConfigurationClient) to unify settings/snapshot/feature-flag operations.
  • Extend refresh + tracing to detect/enumerate enhanced feature flag usage and changes (via page ETags), and update tests.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
azureappconfiguration/snapshot_test.go Updates snapshot tests to pass an enhanced feature-flag client stub.
azureappconfiguration/settings_client.go Adds enhanced feature-flag loader + ETag-change monitor; switches clients to appConfigClient.
azureappconfiguration/refresh_test.go Extends refresh tests to include enhanced feature-flag loader/monitor fields.
azureappconfiguration/internal/tracing/tracing.go Adds correlation-context tags/options for enhanced feature flags.
azureappconfiguration/feature_flag.go New: feature-flag merge + schema conversion + telemetry metadata helpers.
azureappconfiguration/feature_flag_test.go New: unit tests for conversion/merge/dedup/ETag helpers and merged loading.
azureappconfiguration/failover_test.go Updates failover tests to use appConfigClient wrappers/types.
azureappconfiguration/constants.go Adds schema key constants needed by enhanced feature-flag conversion.
azureappconfiguration/client_manager.go Refactors client manager/wrapper types to appConfigClient abstraction and new constructors.
azureappconfiguration/azureappconfiguration.go Wires enhanced feature-flag loading/refresh into provider lifecycle and replaces old single-source FF loading.
azureappconfiguration/azureappconfiguration_test.go Adds newEmptyEnhancedFFClient() test helper and updates FF load tests for new signature/types.
azureappconfiguration/app_configuration_client.go New: concrete appConfigClient implementation backed by azappconfig clients.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +304 to +308
tagFilters := make([]string, 0)
if selector.TagFilters != "" {
json.Unmarshal([]byte(selector.TagFilters), &tagFilters)
s.TagsFilter = tagFilters
}

var ff map[string]any
if err := json.Unmarshal([]byte(*setting.Value), &ff); err != nil {
log.Printf("Invalid feature flag setting: key=%s, error=%s, just ignore", *setting.Key, err.Error())
Comment on lines +576 to 580
func (azappcfg *AzureAppConfiguration) loadFeatureFlags(ctx context.Context, kvClient settingsClient, ffClient settingsClient) error {
ffRsp, err := kvClient.getSettings(ctx)
if 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