Skip to content
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

[Appconfig] az appconfig kv export/import/list, az appconfig revision list, az appconfig feature list and az appconfig restore: Support filtering by tags #30694

Open
wants to merge 11 commits into
base: dev
Choose a base branch
from

Conversation

ChristineWanjau
Copy link
Contributor

@ChristineWanjau ChristineWanjau commented Jan 22, 2025

Related command

az appconfig restore
az appconfig kv list/export/import
az appconfig revision list
az appconfig feature list

Description

This Pr adds support to filter by tags for restore, revision list, kv list/export/import and feature list commands

Testing Guide

History Notes

[Appconfig] az appconfig kv export: Support filtering by tags
[Appconfig] az appconfig kv import: Support filtering by tags
[Appconfig] az appconfig kv list: Support filtering by tags
[Appconfig] az appconfig feature list: Support filtering by tags
[Appconfig] az appconfig restore: Support filtering by tags
[Appconfig] az appconfig revision list: Support filtering by tags


This checklist is used to make sure that common guidelines for a pull request are followed.

Copy link

azure-client-tools-bot-prd bot commented Jan 22, 2025

️✔️AzureCLI-FullTest
️✔️acr
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️acs
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.9
️✔️ams
️✔️latest
️✔️3.12
️✔️3.9
️✔️apim
️✔️latest
️✔️3.12
️✔️3.9
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.9
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.9
️✔️aro
️✔️latest
️✔️3.12
️✔️3.9
️✔️backup
️✔️latest
️✔️3.12
️✔️3.9
️✔️batch
️✔️latest
️✔️3.12
️✔️3.9
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.9
️✔️billing
️✔️latest
️✔️3.12
️✔️3.9
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.9
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.9
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.9
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.9
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.9
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.9
️✔️config
️✔️latest
️✔️3.12
️✔️3.9
️✔️configure
️✔️latest
️✔️3.12
️✔️3.9
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.9
️✔️container
️✔️latest
️✔️3.12
️✔️3.9
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.9
️✔️core
️✔️2018-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.9
️✔️databoxedge
️✔️2019-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️dls
️✔️latest
️✔️3.12
️✔️3.9
️✔️dms
️✔️latest
️✔️3.12
️✔️3.9
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.9
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.9
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.9
️✔️find
️✔️latest
️✔️3.12
️✔️3.9
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.9
️✔️identity
️✔️latest
️✔️3.12
️✔️3.9
️✔️iot
️✔️2019-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️keyvault
️✔️2018-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️lab
️✔️latest
️✔️3.12
️✔️3.9
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.9
️✔️maps
️✔️latest
️✔️3.12
️✔️3.9
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.9
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.9
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.9
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.9
️✔️network
️✔️2018-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.9
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.9
️✔️profile
️✔️latest
️✔️3.12
️✔️3.9
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.9
️✔️redis
️✔️latest
️✔️3.12
️✔️3.9
️✔️relay
️✔️latest
️✔️3.12
️✔️3.9
️✔️resource
️✔️2018-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️role
️✔️latest
️✔️3.12
️✔️3.9
️✔️search
️✔️latest
️✔️3.12
️✔️3.9
️✔️security
️✔️latest
️✔️3.12
️✔️3.9
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.9
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.9
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.9
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.9
️✔️sql
️✔️latest
️✔️3.12
️✔️3.9
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.9
️✔️storage
️✔️2018-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.9
️✔️telemetry
️✔️2018-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️util
️✔️latest
️✔️3.12
️✔️3.9
️✔️vm
️✔️2018-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9

Copy link

Hi @ChristineWanjau,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

Copy link

azure-client-tools-bot-prd bot commented Jan 22, 2025

⚠️AzureCLI-BreakingChangeTest
⚠️appconfig
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd appconfig feature list cmd appconfig feature list added parameter tags
⚠️ 1006 - ParaAdd appconfig kv export cmd appconfig kv export added parameter dest_tags
⚠️ 1006 - ParaAdd appconfig kv export cmd appconfig kv export added parameter tags
⚠️ 1006 - ParaAdd appconfig kv import cmd appconfig kv import added parameter src_tags
⚠️ 1006 - ParaAdd appconfig kv import cmd appconfig kv import added parameter tags
⚠️ 1006 - ParaAdd appconfig kv list cmd appconfig kv list added parameter tags
⚠️ 1006 - ParaAdd appconfig kv restore cmd appconfig kv restore added parameter tags
⚠️ 1006 - ParaAdd appconfig revision list cmd appconfig revision list added parameter tags

@yonzhan
Copy link
Collaborator

yonzhan commented Jan 22, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

@ChristineWanjau ChristineWanjau changed the title Cwanjau/add filtering by tags [Appconfig] az appconfig kv list/ revision list/ feature list/ restore: Support filtering by tags Jan 28, 2025
@ChristineWanjau ChristineWanjau changed the title [Appconfig] az appconfig kv list/ revision list/ feature list/ restore: Support filtering by tags [Appconfig] az appconfig kv export/import/list, revision list and feature list/ restore: Support filtering by tags Jan 28, 2025
@ChristineWanjau ChristineWanjau changed the title [Appconfig] az appconfig kv export/import/list, revision list and feature list/ restore: Support filtering by tags [Appconfig] az appconfig kv export/import/list, az appconfig revision list, az appconfig feature list and az appconfig restore: Support filtering by tags Jan 28, 2025
@ChristineWanjau ChristineWanjau marked this pull request as ready for review January 29, 2025 08:17
Copy link

@Copilot 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.

Copilot reviewed 28 out of 30 changed files in this pull request and generated 1 comment.

Files not reviewed (2)
  • src/azure-cli/azure/cli/command_modules/appconfig/keyvalue.py: Evaluated as low risk
  • src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/test_appconfig_commands.py: Evaluated as low risk
Comments suppressed due to low confidence (4)

src/azure-cli/azure/cli/command_modules/appconfig/_utils.py:236

  • The function should explicitly check if tags is a list before processing and validate the format of tags.
def format_tags(tags):

src/azure-cli/azure/cli/command_modules/appconfig/_kv_helpers.py:27

  • The import statement for 'format_tags' should be alphabetically ordered with the other imports.
from ._utils import prep_label_filter_for_url_encoding, format_tags

src/azure-cli/azure/cli/command_modules/appconfig/feature.py:300

  • [nitpick] The variable name 'tags' is ambiguous. It should be renamed to 'tags_filter' for clarity.
tags=None):

src/azure-cli/azure/cli/command_modules/appconfig/feature.py:1264

  • [nitpick] The error message should include the tags to make it clear that the tags were part of the filter criteria. Suggested message: 'Failed to read feature flag(s) that match the specified feature, label, and tags.'
raise CLIErrors.AzureResponseError('Failed to read feature flag(s) that match the specified feature and label. ' + str(exception))

@@ -166,10 +169,13 @@ def __write_kv_and_features_to_config_store(
if features:
key_values.extend(__convert_featureflag_list_to_keyvalue_list(features))

tags = format_tags(tags)
Copy link
Preview

Copilot AI Jan 29, 2025

Choose a reason for hiding this comment

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

The 'tags' variable is being reassigned after being passed as a parameter. Use a different variable name for the formatted tags to avoid unexpected behavior.

Suggested change
tags = format_tags(tags)
formatted_tags = format_tags(tags)

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
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