Enhanced feature flags - #73
Open
linglingye001 wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
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
appConfigClientabstraction (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 | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.