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

[App Config] az appconfig: Add warning log info to output when the --yes flag is set #25560

Merged
merged 10 commits into from
Mar 6, 2023

Conversation

albertofori
Copy link
Member

@albertofori albertofori commented Feb 24, 2023

Related command

az appconfig import
az appconfig export

Description

Related to Azure/AppConfiguration issue #712. This fix separates kv diffing from print previews and enables logging of specific information to output even when the --yes flag is set.

Testing Guide

History Notes

[App Config] az appconfig import/export: Add warning log info to output even when --yes flag is set


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

@ghost ghost requested review from wangzelin007, zhoxing-ms and yonzhan February 24, 2023 06:37
@ghost ghost assigned zhoxing-ms Feb 24, 2023
@ghost ghost added this to the Feb 2023 (2023-03-07) milestone Feb 24, 2023
@ghost ghost requested a review from jsntcy February 24, 2023 06:37
@ghost ghost added App Configuration Auto-Assign Auto assign by bot labels Feb 24, 2023
@yonzhan
Copy link
Collaborator

yonzhan commented Feb 24, 2023

App Config

@albertofori
Copy link
Member Author

Hi @avanigupta, Could you kindly take a look at this? Thanks!

@albertofori albertofori marked this pull request as ready for review February 24, 2023 18:17
avanigupta
avanigupta previously approved these changes Feb 24, 2023
@@ -637,30 +693,26 @@ def __print_features_preview(old_json, new_json, strict=False):
res = differ.diff(old_json, new_json)
keys = str(res.keys())
if res == {} or (('update' not in keys) and ('insert' not in keys) and (not strict or ('delete' not in keys))):
logger.warning('\nTarget configuration already contains all feature flags in source. No changes will be made.')
return False
return ff_diff
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please add a comment for this if statement?

@@ -689,28 +739,23 @@ def __print_preview(old_json, new_json, strict=False):
res = differ.diff(old_json, new_json)
keys = str(res.keys())
if res == {} or (('update' not in keys) and ('insert' not in keys) and (not strict or ('delete' not in keys))):
logger.warning('\nTarget configuration already contains all key-values in source. No changes will be made.')
return False
return kv_diff
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please add a comment for this if statement?

@zhoxing-ms
Copy link
Contributor

[App Config] BREAKING CHANGE: az appconfig import: Log info to output even when --yes flag is set
[App Config] BREAKING CHANGE: az appconfig export: Log info to output even when --yes flag is set

I'd like to confirm with you why it is marked as a breaking change? Will printing the log cause a breaking change to the user's script?

@zhoxing-ms
Copy link
Contributor

Please note that we will launch the release for this sprint tomorrow morning. Since there are still some comments above, so we postpone the release time of this PR to the next sprint (04-04), could you accept this release time?

@albertofori
Copy link
Member Author

[App Config] BREAKING CHANGE: az appconfig import: Log info to output even when --yes flag is set
[App Config] BREAKING CHANGE: az appconfig export: Log info to output even when --yes flag is set

I'd like to confirm with you why it is marked as a breaking change? Will printing the log cause a breaking change to the user's script?

@zhoxing-ms Yes please. For users who have scripts that should terminate on warnings, this could potentially cause the script to break. Just a precaution on this.

@albertofori
Copy link
Member Author

Please note that we will launch the release for this sprint tomorrow morning. Since there are still some comments above, so we postpone the release time of this PR to the next sprint (04-04), could you accept this release time?

Since the only outstanding ones are for adding comments, could we make the release tomorrow if I address those comments and push the changes now?

@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Mar 2, 2023

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

@albertofori
Copy link
Member Author

Hi @zhoxing-ms. I just wanted to confirm if this will make the release window as the comments have been addressed.

@zhoxing-ms
Copy link
Contributor

Yes please. For users who have scripts that should terminate on warnings, this could potentially cause the script to break. Just a precaution on this.

OK, so I'd like to confirm with you that the breaking change contained in this PR only refers to the warning log at present?
If so, in fact, the warning log is not strictly a breaking change for CLI, because it will not directly affect the input, output and command's behavior

@Anino1996
Copy link

Yes please. For users who have scripts that should terminate on warnings, this could potentially cause the script to break. Just a precaution on this.

OK, so I'd like to confirm with you that the breaking change contained in this PR only refers to the warning log at present? If so, in fact, the warning log is not strictly a breaking change for CLI, because it will not directly affect the input, output and command's behavior

Yes please. That’s the only change here. The input and returned output behaviour does not change for users.

@zhoxing-ms
Copy link
Contributor

zhoxing-ms commented Mar 6, 2023

Hi @zhoxing-ms. I just wanted to confirm if this will make the release window as the comments have been addressed.

I'm so sorry for my late reply. I didn't see your comments in time because I was super busy last Friday.
Because this PR was created late (we usually recommend to submit PR one week before the code freeze date, which can leave us enough time to review and improve PR) and may contain breaking changes, we did not release it in this sprint for the sake of the impact on users and breaking change process.
Since the breaking change contained in this PR only refers to the warning log, we don't need to wait for the next breaking change release. We will release it at the next sprint (04-04) as soon as possible, may I ask could you accept this release time?

@albertofori
Copy link
Member Author

Hi @zhoxing-ms. I just wanted to confirm if this will make the release window as the comments have been addressed.

I'm so sorry for my late reply. I didn't see your comments in time because I was super busy last Friday. Because this PR was created late (we usually recommend to submit PR one week before the code freeze date, which can leave us enough time to review and improve PR) and may contain breaking changes, we did not release it in this sprint for the sake of the impact on users and breaking change process. Since the breaking change contained in this PR only refers to the warning log, we don't need to wait for the next breaking change release. We will release it at the next sprint (04-04) as soon as possible, may I ask could you accept this release time?

@zhoxing-ms No worries. The 04-04 release time should be fine. Thanks!

@zhoxing-ms
Copy link
Contributor

No worries. The 04-04 release time should be fine. Thanks!

Thanks for your understanding~

@zhoxing-ms zhoxing-ms changed the title [App Config] BREAKING CHANGE: az appconfig: Adding logging to output when the "yes" flag is set [App Config] az appconfig: Add logging to output when the --yes flag is set Mar 6, 2023
@zhoxing-ms zhoxing-ms changed the title [App Config] az appconfig: Add logging to output when the --yes flag is set [App Config] az appconfig: Add warning log info to output when the --yes flag is set Mar 6, 2023
@zhoxing-ms
Copy link
Contributor

zhoxing-ms commented Mar 6, 2023

@albertofori Since we usually do not add the breaking change tag for logger.warning, So I modified your PR title and history notes

@zhoxing-ms zhoxing-ms merged commit 259eb96 into Azure:dev Mar 6, 2023
avgale pushed a commit to avgale/azure-cli that referenced this pull request Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants