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

Add breaking changes warnings in preparation for October 27th milestone PR #12683

Merged
merged 4 commits into from
Aug 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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