Skip to content

Conversation

@linglingye001
Copy link
Member

No description provided.

@linglingye001 linglingye001 changed the base branch from main to release/v1.4.0 October 16, 2025 09:38
@linglingye001 linglingye001 marked this pull request as ready for review October 20, 2025 09:07
@linglingye001 linglingye001 requested a review from Copilot October 20, 2025 09:07
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds support for tag-based filtering of settings by introducing TagFilter to Selector and associated validation. Key changes: (1) Added TagFilter field, validation logic, and comparableKey machinery to enable map key usage; (2) Updated client logic to pass TagsFilter to Azure SDK v2 and migrated imports to azappconfig/v2; (3) Expanded tests to cover tag filter validation and selector key normalization.

Reviewed Changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
azureappconfiguration/options.go Adds TagFilter field and comparableKey machinery for Selector.
azureappconfiguration/utils.go Validates TagFilter in verifySelectors and adds validateTagFilters helper.
azureappconfiguration/settings_client.go Passes TagFilter to Azure SDK selector and changes pageETags map key type.
azureappconfiguration/azureappconfiguration.go Adapts ETag maps and deduplication to new selectorKey form.
azureappconfiguration/utils_test.go Adds tests for tag filter validation scenarios.
azureappconfiguration/azureappconfiguration_test.go Adds integration-style tests for loading with TagFilter and comparableKey behavior.
azureappconfiguration/snapshot_test.go Migrates import to azappconfig/v2.
azureappconfiguration/refresh_test.go Migrates import to azappconfig/v2.
azureappconfiguration/failover_test.go Migrates import to azappconfig/v2.
azureappconfiguration/client_manager.go Migrates import to azappconfig/v2.
azureappconfiguration/go.mod Updates dependency to azappconfig/v2.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

// TagFilter specifies which tags to retrieve from Azure App Configuration.
// Each tag filter must follow the format "tagName=tagValue". Only those key-values will be loaded whose tags match all the tags provided here.
// Up to 5 tag filters can be provided. If no tag filters are provided, key-values will not be filtered based on tags.
TagFilter []string
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you know why we use TagFilters in provider but TagsFilter in SDK ?

Copy link
Member

Choose a reason for hiding this comment

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

I remember there's a thread of discussion, let me find it for you

}

tagFilters := make([]string, 0)
if selector.TagFilter != "" && selector.TagFilter != "null" {
Copy link
Member

Choose a reason for hiding this comment

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

In what case, the TagFiliter would be "null"?

Copy link
Member Author

Choose a reason for hiding this comment

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

when json.Unmarshal empty tagFilters, the tagFilter string will be "null"

Copy link
Member

Choose a reason for hiding this comment

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

Can we do something to avoid this? E.g., do nothing if there's no element in tagFilters.

Copy link
Member Author

Choose a reason for hiding this comment

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

ok, updated

@linglingye001 linglingye001 merged commit f3d48ce into release/v1.4.0 Oct 30, 2025
13 checks passed
@linglingye001 linglingye001 deleted the linglingye/tagFilter branch October 30, 2025 04:57
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.

3 participants