From 64a1a22d1d0c7dad62e3ccf14eadeee34cb6ceee Mon Sep 17 00:00:00 2001 From: Beisi Zhou Date: Fri, 21 Aug 2020 12:57:04 +0800 Subject: [PATCH 01/12] Format BreakingChange Output Messages (#205) --- src/Common/Properties/Resources.resx | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/src/Common/Properties/Resources.resx b/src/Common/Properties/Resources.resx index 47406987a7..3a2e8325db 100644 --- a/src/Common/Properties/Resources.resx +++ b/src/Common/Properties/Resources.resx @@ -1656,8 +1656,7 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can The parameter : '{0}' is being replaced by mandatory parameter : '{1}'. - Change description : {0} - + Change description : {0} The cmdlet is being deprecated. There will be no replacement for it. @@ -1672,36 +1671,28 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can "The output type '{0}' is changing" - -- The following properties are being added to the output type : + - The following properties are being added to the output type : - - - The following properties in the output type are being deprecated : - + - The following properties in the output type are being deprecated : + - - {0} - - + - {0} - Cmdlet : '{0}' - - {1} - + - {1} Breaking changes in the cmdlet '{0}' : - Note : This change will take effect on '{0}' - + Note : This change will take effect on '{0}' - Note :The change is expected to take effect from the version : '{0}' - - + Note :The change is expected to take effect from the version : '{0}' ```powershell @@ -1711,7 +1702,6 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can # New {1} ``` - @@ -1723,7 +1713,7 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can The output type '{0}' is being deprecated without a replacement. - The type of the parameter is changing from '{0}' to '{1}'. + The type of the parameter is changing from '{0}' to '{1}'. NOTE : Go to {0} for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell. From 9886825fcc5733df89d649b274eb1fa04cfe7277 Mon Sep 17 00:00:00 2001 From: Beisi Zhou Date: Fri, 21 Aug 2020 15:34:53 +0800 Subject: [PATCH 02/12] Format BreakingChange Output Messages (#206) --- src/Common/Properties/Resources.resx | 42 +++++++++++++++++----------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/src/Common/Properties/Resources.resx b/src/Common/Properties/Resources.resx index 3a2e8325db..3a411dfbcb 100644 --- a/src/Common/Properties/Resources.resx +++ b/src/Common/Properties/Resources.resx @@ -1644,19 +1644,24 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can 0(string): methodType - The parameter : '{0}' is changing. + + - The parameter : '{0}' is changing. - The parameter : '{0}' is becoming mandatory. + + - The parameter : '{0}' is becoming mandatory. - The parameter : '{0}' is being replaced by parameter : '{1}'. + + - The parameter : '{0}' is being replaced by parameter : '{1}'. - The parameter : '{0}' is being replaced by mandatory parameter : '{1}'. + + - The parameter : '{0}' is being replaced by mandatory parameter : '{1}'. - Change description : {0} + + - Change description : {0} The cmdlet is being deprecated. There will be no replacement for it. @@ -1665,34 +1670,39 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can The cmdlet '{0}' is replacing this cmdlet. - The output type is changing from the existing type :'{0}' to the new type :'{1}' + + - The output type is changing from the existing type :'{0}' to the new type :'{1}' - "The output type '{0}' is changing" + + - "The output type '{0}' is changing" - - The following properties are being added to the output type : - + + - The following properties are being added to the output type : - - The following properties in the output type are being deprecated : - + + - The following properties in the output type are being deprecated : - - {0} + + - {0} - - Cmdlet : '{0}' + + - Cmdlet : '{0}' - {1} - Breaking changes in the cmdlet '{0}' : + + Breaking changes in the cmdlet '{0}' : Note : This change will take effect on '{0}' - Note :The change is expected to take effect from the version : '{0}' + Note : The change is expected to take effect from the version : '{0}' ```powershell @@ -1716,7 +1726,7 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can The type of the parameter is changing from '{0}' to '{1}'. - NOTE : Go to {0} for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell. + Note : Go to {0} for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell. This cmdlet is in preview. The functionality may not be available in the selected subscription. From 99c0a4de01642021992fed79b77547ba98738561 Mon Sep 17 00:00:00 2001 From: Beisi Zhou Date: Fri, 21 Aug 2020 16:31:46 +0800 Subject: [PATCH 03/12] Adjust format (#207) --- src/Common/Properties/Resources.resx | 31 +++++++++++++++------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/Common/Properties/Resources.resx b/src/Common/Properties/Resources.resx index 3a411dfbcb..71a819d5bc 100644 --- a/src/Common/Properties/Resources.resx +++ b/src/Common/Properties/Resources.resx @@ -1645,11 +1645,11 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can - - The parameter : '{0}' is changing. + - The parameter : '{0}' is changing. - - The parameter : '{0}' is becoming mandatory. + - The parameter : '{0}' is becoming mandatory. @@ -1657,11 +1657,11 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can - - The parameter : '{0}' is being replaced by mandatory parameter : '{1}'. + - The parameter : '{0}' is being replaced by mandatory parameter : '{1}'. - - Change description : {0} + - Change description : {0} The cmdlet is being deprecated. There will be no replacement for it. @@ -1671,38 +1671,40 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can - - The output type is changing from the existing type :'{0}' to the new type :'{1}' + - The output type is changing from the existing type :'{0}' to the new type :'{1}' - - "The output type '{0}' is changing" + - "The output type '{0}' is changing" - - The following properties are being added to the output type : + - The following properties are being added to the output type : - - The following properties in the output type are being deprecated : + - The following properties in the output type are being deprecated : - - {0} + {0} - - Cmdlet : '{0}' - - {1} + - Cmdlet : '{0}' + - {1} Breaking changes in the cmdlet '{0}' : - Note : This change will take effect on '{0}' + + Note : This change will take effect on '{0}' - Note : The change is expected to take effect from the version : '{0}' + + Note : The change is expected to take effect from the version : '{0}' ```powershell @@ -1726,7 +1728,8 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can The type of the parameter is changing from '{0}' to '{1}'. - Note : Go to {0} for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell. + + Note : Go to {0} for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell. This cmdlet is in preview. The functionality may not be available in the selected subscription. From f0d61c93d564c3372d8ac2518e67df20c7ad338d Mon Sep 17 00:00:00 2001 From: Beisi Zhou Date: Fri, 21 Aug 2020 16:48:20 +0800 Subject: [PATCH 04/12] adjust typo (#208) --- src/Common/Properties/Resources.resx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Common/Properties/Resources.resx b/src/Common/Properties/Resources.resx index 71a819d5bc..2f34f47221 100644 --- a/src/Common/Properties/Resources.resx +++ b/src/Common/Properties/Resources.resx @@ -1675,7 +1675,7 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can - - "The output type '{0}' is changing" + - The output type '{0}' is changing @@ -1686,8 +1686,7 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can - The following properties in the output type are being deprecated : - - {0} + {0} From efcad1de9825716633927ee2aff650d31b140b89 Mon Sep 17 00:00:00 2001 From: Beisi Zhou Date: Fri, 21 Aug 2020 17:24:41 +0800 Subject: [PATCH 05/12] last adjust (#209) --- src/Common/Properties/Resources.resx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Common/Properties/Resources.resx b/src/Common/Properties/Resources.resx index 2f34f47221..ec38bd6f33 100644 --- a/src/Common/Properties/Resources.resx +++ b/src/Common/Properties/Resources.resx @@ -1694,8 +1694,7 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can - {1} - - Breaking changes in the cmdlet '{0}' : + Breaking changes in the cmdlet '{0}' : From 2b7a6c7ce32a2e55fc0e43fc9888ea429b002449 Mon Sep 17 00:00:00 2001 From: Beisi Zhou Date: Tue, 25 Aug 2020 15:06:57 +0800 Subject: [PATCH 06/12] eliminate 'warning's (#211) --- .../CustomAttributes/BreakingChangeAttributeHelper.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Common/CustomAttributes/BreakingChangeAttributeHelper.cs b/src/Common/CustomAttributes/BreakingChangeAttributeHelper.cs index e1f7c0f777..f9a420de15 100644 --- a/src/Common/CustomAttributes/BreakingChangeAttributeHelper.cs +++ b/src/Common/CustomAttributes/BreakingChangeAttributeHelper.cs @@ -98,17 +98,21 @@ public static void ProcessCustomAttributesAtRuntime(Type type, InvocationInfo in } List attributes = new List(GetAllBreakingChangeAttributesInType(type, invocationInfo)); + StringBuilder sb = new StringBuilder(); + Action appendBreakingChangeInfo = (string s) => sb.Append(s); if (attributes != null && attributes.Count > 0) { - writeOutput(string.Format(Resources.BreakingChangesAttributesHeaderMessage, Utilities.GetNameFromCmdletType(type))); + appendBreakingChangeInfo(string.Format(Resources.BreakingChangesAttributesHeaderMessage, Utilities.GetNameFromCmdletType(type))); foreach (GenericBreakingChangeAttribute attribute in attributes) { - attribute.PrintCustomAttributeInfo(type, false, writeOutput); + attribute.PrintCustomAttributeInfo(type, false, appendBreakingChangeInfo); } - writeOutput(string.Format(Resources.BreakingChangesAttributesFooterMessage, BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK)); + appendBreakingChangeInfo(string.Format(Resources.BreakingChangesAttributesFooterMessage, BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK)); + + writeOutput(sb.ToString()); } } From 831e42e9572324612c5ea7853b74c6b27689368b Mon Sep 17 00:00:00 2001 From: Beisi Zhou Date: Tue, 25 Aug 2020 15:38:58 +0800 Subject: [PATCH 07/12] little adjustment (#212) --- src/Common/Properties/Resources.resx | 30 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Common/Properties/Resources.resx b/src/Common/Properties/Resources.resx index ec38bd6f33..1738891c52 100644 --- a/src/Common/Properties/Resources.resx +++ b/src/Common/Properties/Resources.resx @@ -1645,23 +1645,23 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can - - The parameter : '{0}' is changing. +- The parameter : '{0}' is changing. - - The parameter : '{0}' is becoming mandatory. +- The parameter : '{0}' is becoming mandatory. - - The parameter : '{0}' is being replaced by parameter : '{1}'. +- The parameter : '{0}' is being replaced by parameter : '{1}'. - - The parameter : '{0}' is being replaced by mandatory parameter : '{1}'. +- The parameter : '{0}' is being replaced by mandatory parameter : '{1}'. - - Change description : {0} +- Change description : {0} The cmdlet is being deprecated. There will be no replacement for it. @@ -1671,38 +1671,38 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can - - The output type is changing from the existing type :'{0}' to the new type :'{1}' +- The output type is changing from the existing type :'{0}' to the new type :'{1}' - - The output type '{0}' is changing +- The output type '{0}' is changing - - The following properties are being added to the output type : +- The following properties are being added to the output type : - - The following properties in the output type are being deprecated : +- The following properties in the output type are being deprecated : {0} - - Cmdlet : '{0}' - - {1} +- Cmdlet : '{0}' + - {1} - Breaking changes in the cmdlet '{0}' : + Upcoming breaking changes in the cmdlet '{0}' : - Note : This change will take effect on '{0}' +Note : This change will take effect on '{0}' - Note : The change is expected to take effect from the version : '{0}' +Note : The change is expected to take effect from the version : '{0}' ```powershell @@ -1727,7 +1727,7 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can - Note : Go to {0} for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell. +Note : Go to {0} for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell. This cmdlet is in preview. The functionality may not be available in the selected subscription. From d2d1814132206f1e205460f699aaee09aee1f2dc Mon Sep 17 00:00:00 2001 From: Beisi Zhou Date: Tue, 25 Aug 2020 16:28:37 +0800 Subject: [PATCH 08/12] Little Adjustment (#213) --- src/Common/Properties/Resources.resx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Common/Properties/Resources.resx b/src/Common/Properties/Resources.resx index 1738891c52..2cb91b0260 100644 --- a/src/Common/Properties/Resources.resx +++ b/src/Common/Properties/Resources.resx @@ -1686,7 +1686,8 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can - The following properties in the output type are being deprecated : - {0} + +{0} @@ -1698,11 +1699,11 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can -Note : This change will take effect on '{0}' +- This change will take effect on '{0}' -Note : The change is expected to take effect from the version : '{0}' +- The change is expected to take effect from the version : '{0}' ```powershell From 0e81fecf67a8f4f04ff661b416fc10d929e32f28 Mon Sep 17 00:00:00 2001 From: Beisi Zhou Date: Tue, 25 Aug 2020 18:02:59 +0800 Subject: [PATCH 09/12] Fix empty situation (#214) --- src/Common/CustomAttributes/GenericBreakingChangeAttribute.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Common/CustomAttributes/GenericBreakingChangeAttribute.cs b/src/Common/CustomAttributes/GenericBreakingChangeAttribute.cs index 09d6a7ce08..3835a80897 100644 --- a/src/Common/CustomAttributes/GenericBreakingChangeAttribute.cs +++ b/src/Common/CustomAttributes/GenericBreakingChangeAttribute.cs @@ -129,7 +129,9 @@ public string GetBreakingChangeTextFromAttribute(Type type, bool withCmdletName) public void PrintCustomAttributeInfo(Type type, bool withCmdletName, Action writeOutput) { if (!withCmdletName) { - writeOutput(string.Format(Resources.BreakingChangesAttributesDeclarationMessage, GetAttributeSpecificMessage())); + if(!string.IsNullOrWhiteSpace(GetAttributeSpecificMessage())){ + writeOutput(string.Format(Resources.BreakingChangesAttributesDeclarationMessage, GetAttributeSpecificMessage())); + } } else { writeOutput(string.Format(Resources.BreakingChangesAttributesDeclarationMessageWithCmdletName, Utilities.GetNameFromCmdletType(type), GetAttributeSpecificMessage())); From 0286cd8b63de27814ba6ca14ad0f477e82534074 Mon Sep 17 00:00:00 2001 From: Beisi Zhou Date: Wed, 26 Aug 2020 09:42:43 +0800 Subject: [PATCH 10/12] fix empty string (#215) --- src/Common/CustomAttributes/GenericBreakingChangeAttribute.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Common/CustomAttributes/GenericBreakingChangeAttribute.cs b/src/Common/CustomAttributes/GenericBreakingChangeAttribute.cs index 3835a80897..bd265dbf6e 100644 --- a/src/Common/CustomAttributes/GenericBreakingChangeAttribute.cs +++ b/src/Common/CustomAttributes/GenericBreakingChangeAttribute.cs @@ -129,7 +129,7 @@ public string GetBreakingChangeTextFromAttribute(Type type, bool withCmdletName) public void PrintCustomAttributeInfo(Type type, bool withCmdletName, Action writeOutput) { if (!withCmdletName) { - if(!string.IsNullOrWhiteSpace(GetAttributeSpecificMessage())){ + if(!string.IsNullOrEmpty(GetAttributeSpecificMessage())){ writeOutput(string.Format(Resources.BreakingChangesAttributesDeclarationMessage, GetAttributeSpecificMessage())); } } else From 76473e7e7738dad9aef28a56f96abb17de9e9b0c Mon Sep 17 00:00:00 2001 From: Beisi Zhou Date: Thu, 27 Aug 2020 16:17:47 +0800 Subject: [PATCH 11/12] final version (#216) --- .../CmdletParameterBreakingChangeAttribute.cs | 2 +- .../GenericBreakingChangeAttribute.cs | 6 ++++-- src/Common/Properties/Resources.resx | 20 ++++++++++--------- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/Common/CustomAttributes/CmdletParameterBreakingChangeAttribute.cs b/src/Common/CustomAttributes/CmdletParameterBreakingChangeAttribute.cs index f83c18b542..c0d39936df 100644 --- a/src/Common/CustomAttributes/CmdletParameterBreakingChangeAttribute.cs +++ b/src/Common/CustomAttributes/CmdletParameterBreakingChangeAttribute.cs @@ -83,7 +83,7 @@ protected override string GetAttributeSpecificMessage() //See if the type of the param is changing if (OldParamaterType != null && !string.IsNullOrWhiteSpace(NewParameterTypeName)) { - message.Append("\n" + string.Format(Resources.BreakingChangeAttributeParameterTypeChange, OldParamaterType.FullName, NewParameterTypeName)); + message.Append(string.Format(Resources.BreakingChangeAttributeParameterTypeChange, OldParamaterType.FullName, NewParameterTypeName)); } return message.ToString(); } diff --git a/src/Common/CustomAttributes/GenericBreakingChangeAttribute.cs b/src/Common/CustomAttributes/GenericBreakingChangeAttribute.cs index bd265dbf6e..5b8d55fa33 100644 --- a/src/Common/CustomAttributes/GenericBreakingChangeAttribute.cs +++ b/src/Common/CustomAttributes/GenericBreakingChangeAttribute.cs @@ -129,9 +129,11 @@ public string GetBreakingChangeTextFromAttribute(Type type, bool withCmdletName) public void PrintCustomAttributeInfo(Type type, bool withCmdletName, Action writeOutput) { if (!withCmdletName) { - if(!string.IsNullOrEmpty(GetAttributeSpecificMessage())){ - writeOutput(string.Format(Resources.BreakingChangesAttributesDeclarationMessage, GetAttributeSpecificMessage())); + if (!GetAttributeSpecificMessage().StartsWith("\r\n")) + { + writeOutput("\r\n"); } + writeOutput(string.Format(Resources.BreakingChangesAttributesDeclarationMessage, GetAttributeSpecificMessage())); } else { writeOutput(string.Format(Resources.BreakingChangesAttributesDeclarationMessageWithCmdletName, Utilities.GetNameFromCmdletType(type), GetAttributeSpecificMessage())); diff --git a/src/Common/Properties/Resources.resx b/src/Common/Properties/Resources.resx index 2cb91b0260..e51f7cf324 100644 --- a/src/Common/Properties/Resources.resx +++ b/src/Common/Properties/Resources.resx @@ -1652,7 +1652,7 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can - The parameter : '{0}' is becoming mandatory. - + - The parameter : '{0}' is being replaced by parameter : '{1}'. @@ -1686,8 +1686,7 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can - The following properties in the output type are being deprecated : - -{0} + {0} @@ -1716,15 +1715,18 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can - Cmdlet invocation changes : - Old Way : {0} - New Way : {1} + +Cmdlet invocation changes : + Old Way : {0} + New Way : {1} - The output type '{0}' is being deprecated without a replacement. + +The output type '{0}' is being deprecated without a replacement. - The type of the parameter is changing from '{0}' to '{1}'. + +The type of the parameter is changing from '{0}' to '{1}'. @@ -1733,4 +1735,4 @@ Note : Go to {0} for steps to suppress this breaking change warning, and other i This cmdlet is in preview. The functionality may not be available in the selected subscription. - + \ No newline at end of file From 65b09536f99f7804864e3518c5251257204e177e Mon Sep 17 00:00:00 2001 From: Beisi Zhou Date: Tue, 1 Sep 2020 15:20:13 +0800 Subject: [PATCH 12/12] Replace '\r\n' by Environment.NewLine (#217) --- src/Common/CustomAttributes/GenericBreakingChangeAttribute.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Common/CustomAttributes/GenericBreakingChangeAttribute.cs b/src/Common/CustomAttributes/GenericBreakingChangeAttribute.cs index 5b8d55fa33..0df9648a92 100644 --- a/src/Common/CustomAttributes/GenericBreakingChangeAttribute.cs +++ b/src/Common/CustomAttributes/GenericBreakingChangeAttribute.cs @@ -129,9 +129,9 @@ public string GetBreakingChangeTextFromAttribute(Type type, bool withCmdletName) public void PrintCustomAttributeInfo(Type type, bool withCmdletName, Action writeOutput) { if (!withCmdletName) { - if (!GetAttributeSpecificMessage().StartsWith("\r\n")) + if (!GetAttributeSpecificMessage().StartsWith(Environment.NewLine)) { - writeOutput("\r\n"); + writeOutput(Environment.NewLine); } writeOutput(string.Format(Resources.BreakingChangesAttributesDeclarationMessage, GetAttributeSpecificMessage())); } else