Skip to content

Commit

Permalink
Add breaking changes warnings in preparation for October 27th milesto…
Browse files Browse the repository at this point in the history
…ne PR (#12683)

* New-AzManagedServicesDefinition changes

* Revert "New-AzManagedServicesDefinition changes"

This reverts commit 23ae023.

* Added breaking changes warnings in preparation for Oct 27th breaking changes milestone
  • Loading branch information
skayani authored Aug 18, 2020
1 parent 775d267 commit ef6a2ae
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
namespace Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands
{
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Extensions;
using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using System;
using System.Management.Automation;
Expand All @@ -35,10 +37,20 @@ public class GetAzureRmManagedServicesAssignment : ManagedServicesCmdletBase
[ScopeCompleter]
public string Scope { get; set; }

[CmdletParameterBreakingChange(
nameOfParameterChanging: "Id",
deprecateByVersion: ManagedServicesUtility.UpcomingVersion,
changeInEfectByDate: ManagedServicesUtility.UpcomingVersionReleaseDate,
ReplaceMentCmdletParameterName = "Name")]
[Parameter(Mandatory = true, ParameterSetName = ByIdParameterSet, HelpMessage = "The Registration Assignment identifier.")]
[ValidateNotNullOrEmpty]
public string Id { get; set; }

[CmdletParameterBreakingChange(
nameOfParameterChanging: "ResourceId",
deprecateByVersion: ManagedServicesUtility.UpcomingVersion,
changeInEfectByDate: ManagedServicesUtility.UpcomingVersionReleaseDate,
ChangeDescription = ManagedServicesUtility.DeprecatedParameterDescription)]
[Parameter(
Mandatory = true,
ValueFromPipelineByPropertyName = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Extensions;
using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using System;
using System.Management.Automation;
Expand All @@ -33,6 +35,11 @@ public class GetAzureRmManagedServicesDefinition : ManagedServicesCmdletBase
[ValidateNotNullOrEmpty]
public string Name { get; set; }

[CmdletParameterBreakingChange(
nameOfParameterChanging: "ResourceId",
deprecateByVersion: ManagedServicesUtility.UpcomingVersion,
changeInEfectByDate: ManagedServicesUtility.UpcomingVersionReleaseDate,
ChangeDescription = ManagedServicesUtility.DeprecatedParameterDescription)]
[Parameter(
ParameterSetName = ByResourceIdParameterSet,
Mandatory = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Extensions;
using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -44,6 +46,11 @@ public class NewAzureRmManagedServicesAssignment : ManagedServicesCmdletBase
[ValidateNotNullOrEmpty]
public string RegistrationDefinitionName { get; set; }

[CmdletParameterBreakingChange(
nameOfParameterChanging: "RegistrationDefinitionResourceId",
deprecateByVersion: ManagedServicesUtility.UpcomingVersion,
changeInEfectByDate: ManagedServicesUtility.UpcomingVersionReleaseDate,
ChangeDescription = ManagedServicesUtility.DeprecatedParameterDescription)]
[Parameter(ParameterSetName = ByResourceIdParameterSet, ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "The fully qualified resource id of the registration definition.")]
[ValidateNotNullOrEmpty]
[Alias("ResourceId")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Management.ManagedServices.Models;
using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Extensions;
using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using System;
Expand All @@ -22,6 +23,10 @@

namespace Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Commands
{
[WindowsAzure.Commands.Common.CustomAttributes.GenericBreakingChange(
message: "New mandatory parameter 'DisplayName' will be added to represent a user-friendly name for a registration definition",
deprecateByVersion: ManagedServicesUtility.UpcomingVersion,
changeInEfectByDate: ManagedServicesUtility.UpcomingVersionReleaseDate)]
[Cmdlet(
VerbsCommon.New,
Microsoft.Azure.Commands.ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ManagedServicesDefinition",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Extensions;
using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using System;
using System.Management.Automation;
Expand All @@ -37,10 +38,20 @@ public class RemoveAzureRmManagedServcicesAssignment : ManagedServicesCmdletBase
[ScopeCompleter]
public string Scope { get; set; }

[CmdletParameterBreakingChange(
nameOfParameterChanging: "Id",
deprecateByVersion: ManagedServicesUtility.UpcomingVersion,
changeInEfectByDate: ManagedServicesUtility.UpcomingVersionReleaseDate,
ReplaceMentCmdletParameterName = "Name")]
[Parameter(ParameterSetName = DefaultParameterSet, Mandatory = true, HelpMessage = "The registration assignment Id.")]
[ValidateNotNullOrEmpty]
public string Id { get; set; }

[CmdletParameterBreakingChange(
nameOfParameterChanging: "ResourceId",
deprecateByVersion: ManagedServicesUtility.UpcomingVersion,
changeInEfectByDate: ManagedServicesUtility.UpcomingVersionReleaseDate,
ChangeDescription = ManagedServicesUtility.DeprecatedParameterDescription)]
[Parameter(ParameterSetName = ByResourceIdParameterSet, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The fully qualified rsource id of the registration assignment.")]
[ValidateNotNullOrEmpty]
public string ResourceId { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Extensions;
using Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Models;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using System;
using System.Management.Automation;
Expand All @@ -32,10 +33,20 @@ public class RemoveAzureRmManagedServicesDefinition : ManagedServicesCmdletBase
protected const string ByInputObjectParameterSet = "ByInputObject";
protected const string ByResourceIdParameterSet = "ByResourceId";

[CmdletParameterBreakingChange(
nameOfParameterChanging: "Id",
deprecateByVersion: ManagedServicesUtility.UpcomingVersion,
changeInEfectByDate: ManagedServicesUtility.UpcomingVersionReleaseDate,
ReplaceMentCmdletParameterName = "Name")]
[Parameter(ParameterSetName = DefaultParameterSet, Mandatory = true, HelpMessage = "The registration definition identifier.")]
[ValidateNotNullOrEmpty]
public string Id { get; set; }

[CmdletParameterBreakingChange(
nameOfParameterChanging: "ResourceId",
deprecateByVersion: ManagedServicesUtility.UpcomingVersion,
changeInEfectByDate: ManagedServicesUtility.UpcomingVersionReleaseDate,
ChangeDescription = ManagedServicesUtility.DeprecatedParameterDescription)]
[Parameter(ParameterSetName = ByResourceIdParameterSet, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The full qualified resource id of registration definition.")]
[ValidateNotNullOrEmpty]
public string ResourceId { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Extensions
{
public static class ManagedServicesUtility
{
// TODO: Remove these three string as well as breaking changes attributes for Oct. 27th change
public const string UpcomingVersion = "1.0.3";
public const string UpcomingVersionReleaseDate = "10/27/2020";
public const string DeprecatedParameterDescription = "Parameter is being deprecated without being replaced";

public static readonly Regex AssignmentRegex = new Regex(@"(.*?)/providers/microsoft.managedservices/registrationAssignments/(?<assignmentName>[^/]+)",
RegexOptions.IgnoreCase | RegexOptions.Compiled);

Expand Down

0 comments on commit ef6a2ae

Please sign in to comment.