-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[App Config] az appconfig feature set/list/delete: Support setting and filtering by tags for feature commands
#31711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
yanzhudd
merged 8 commits into
Azure:dev
from
ChristineWanjau:cwanjau/supportFilteringByTgasForFeatureCommands
Jul 24, 2025
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
35b8f65
Support set and filtering by tags for feature commands
b2322d1
typo
7b5262b
Merge branch 'dev' into cwanjau/supportFilteringByTgasForFeatureCommands
dcce631
add help text
9c6b2b8
fix style issues
ec8bf3a
Update src/azure-cli/azure/cli/command_modules/appconfig/_help.py
ChristineWanjau e275bc4
Update src/azure-cli/azure/cli/command_modules/appconfig/_help.py
ChristineWanjau 849c20e
fix linting issues
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,7 +51,8 @@ def set_feature(cmd, | |
| yes=False, | ||
| connection_string=None, | ||
| auth_mode="key", | ||
| endpoint=None): | ||
| endpoint=None, | ||
| tags=None): | ||
| if key is None and feature is None: | ||
| raise CLIErrors.RequiredArgumentMissingError("Please provide either `--key` or `--feature` value.") | ||
|
|
||
|
|
@@ -67,7 +68,6 @@ def set_feature(cmd, | |
| raise exception | ||
|
|
||
| # when creating a new Feature flag, these defaults will be used | ||
|
||
| tags = {} | ||
| default_conditions = {FeatureFlagConstants.CLIENT_FILTERS: []} | ||
|
|
||
| if requirement_type: | ||
|
|
@@ -145,6 +145,7 @@ def set_feature(cmd, | |
|
|
||
| # Convert KeyValue object to required FeatureFlag format for | ||
| # display | ||
|
|
||
| feature_flag = map_keyvalue_to_featureflag(set_kv, show_all_details=True) | ||
| entry = json.dumps(feature_flag, default=lambda o: o.__dict__, indent=2, sort_keys=True, ensure_ascii=False) | ||
|
|
||
|
|
@@ -185,7 +186,8 @@ def delete_feature(cmd, | |
| yes=False, | ||
| connection_string=None, | ||
| auth_mode="key", | ||
| endpoint=None): | ||
| endpoint=None, | ||
| tags=None): | ||
| if key is None and feature is None: | ||
| raise CLIErrors.RequiredArgumentMissingError("Please provide either `--key` or `--feature` value.") | ||
| if key and feature: | ||
|
|
@@ -204,9 +206,10 @@ def delete_feature(cmd, | |
| retrieved_keyvalues = __list_all_keyvalues(azconfig_client, | ||
| key_filter=key_filter, | ||
| label=SearchFilterOptions.EMPTY_LABEL if label is None else label, | ||
| correlation_request_id=correlation_request_id) | ||
| correlation_request_id=correlation_request_id, | ||
| tags=tags) | ||
|
|
||
| confirmation_message = "Found '{}' feature flags matching the specified feature and label. Are you sure you want to delete these feature flags?".format(len(retrieved_keyvalues)) | ||
| confirmation_message = "Found '{}' feature flags matching the specified feature, label, and tags. Are you sure you want to delete these feature flags?".format(len(retrieved_keyvalues)) | ||
| user_confirmation(confirmation_message, yes) | ||
|
|
||
| deleted_kvs = [] | ||
|
|
@@ -304,7 +307,8 @@ def list_feature(cmd, | |
| top=None, | ||
| all_=False, | ||
| auth_mode="key", | ||
| endpoint=None): | ||
| endpoint=None, | ||
| tags=None): | ||
| return __list_features( | ||
| cmd=cmd, | ||
| feature=feature, | ||
|
|
@@ -316,7 +320,8 @@ def list_feature(cmd, | |
| top=top, | ||
| all_=all_, | ||
| auth_mode=auth_mode, | ||
| endpoint=endpoint | ||
| endpoint=endpoint, | ||
| tags=tags | ||
| ) | ||
|
|
||
|
|
||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.