Skip to content

Sobaner/wildcardlistener#10878

Merged
isra-fel merged 13 commits intoAzure:release-2020-02-04from
sobaner-zz:sobaner/wildcardlistener
Jan 22, 2020
Merged

Sobaner/wildcardlistener#10878
isra-fel merged 13 commits intoAzure:release-2020-02-04from
sobaner-zz:sobaner/wildcardlistener

Conversation

@sobaner-zz
Copy link

@sobaner-zz sobaner-zz commented Jan 13, 2020

Description

Adding Support for HostNames in Application Gateway Http Listener Class

Checklist

  • I have read the Submitting Changes section of CONTRIBUTING.md
  • The title of the PR is clear and informative
  • The appropriate ChangeLog.md file(s) has been updated:
    • For any service, the ChangeLog.md file can be found at src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
    • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header -- no new version header should be added
  • The PR does not introduce breaking changes
  • If applicable, the changes made in the PR have proper test coverage
  • For public API changes to cmdlets:
    • a cmdlet design review was approved for the changes in this repository (Microsoft internal only)
    • the markdown help files have been regenerated using the commands listed here

@sobaner-zz
Copy link
Author

@isra-fel isra-fel self-assigned this Jan 14, 2020
@isra-fel
Copy link
Member

isra-fel commented Jan 15, 2020

"Parameter HostNames of cmdlet Add-AzApplicationGatewayHttpListener does not follow the enforced naming convention of using a singular noun for a parameter name."

Please consider renaming to "HostName" or "HostNameList"

@sobaner-zz
Copy link
Author

"Parameter HostNames of cmdlet Add-AzApplicationGatewayHttpListener does not follow the enforced naming convention of using a singular noun for a parameter name."

Please consider renaming to "HostName" or "HostNameList"

The NRP and swagger for this name has already been in field and there are private preview customers onboarded on the property called HostNames. If I call it HostNames in Swagger and call it HostNameList in PS, doesn't that conflict? I would request you to let me go ahead with this name. Discussed it with program management team as well on the naming convention.

@isra-fel
Copy link
Member

isra-fel commented Jan 15, 2020

The NRP and swagger for this name has already been in field and there are private preview customers onboarded on the property called HostNames. If I call it HostNames in Swagger and call it HostNameList in PS, doesn't that conflict? I would request you to let me go ahead with this name. Discussed it with program management team as well on the naming convention.

It's not just our team's recommendation, but also PowerShell (the language) team's strongly encouraged development guideline to use singular parameter names.
I understand your need to make it consistent everywhere, but we need to follow the conventions in each environments as well.

I understood your concern, but per the documentation, it does not tell me about recommendations about property field naming conventions, where I could also provide a single entry, as well as a list of entries. ApplicationGatewayHttpListener always had the HostName attribute, which is allowed to take only a single dns hostname. With customer ask, we are now supporting wildcard characters, as well as multiple hostnames per listener, which we did not want to add in the HostName field (as it has singular name), which is the reason we introduced another field named HostNames
(for which we even had the swagger approved. )

Even from PS perspective, I see that some other cmdlets, like Set-AzApplicationGatewayBackendAddressPool, which had "BackendIPAddresses" and "BackendFqdns", which are basically list of strings, which can allow one or more of those categories.

Now, considering swagger getting approved, I expected this to be a valid naming convention for my use case, which is the reason for raising this PS review. Now, simply changing a name, as I have mentioned earlier means to change it in NRP, wait for release, change it in swagger and then finally change PS cmdlets, which would increase the go to market for this feature.

Currently the PR is ready from my side, apart from few merge validations failing (not related I guess), apart from review.

@isra-fel
Copy link
Member

isra-fel commented Jan 19, 2020

Hi @sobaner , thanks for the detailed explanation of the scenario, that is helpful. (BTW please don't edit-reply, it's hard to notice)
Now let's just think about powershell cmdlet interface, not the swagger. Here's my proposal:

  • Do not use HostNames
  • Change the type of string HostName to string[] HostName

Here's why:

  1. The API surface would be simple. User doesn't need to think about using which of HostName or HostNames
  2. The implementation is simple too
  3. Parameter naming conforms with powershell naming convention

And you needn't worry -- this is not a breaking change in powershell, as array parameters can take a single object.
How do you like the idea?

@isra-fel
Copy link
Member

More details on parameter naming convention: we only accept 2 types of plural names:

  • Units, e.g. -TimeInMinutes
  • The argument can never be single, in which way the cmdlet should check and warn the user if a single object is supplied

As of the counter examples you gave, they were probably checked in due to some historic information.

@isra-fel isra-fel assigned sobaner-zz and unassigned isra-fel Jan 19, 2020
@sobaner-zz
Copy link
Author

@number213 - I have corrected the staticAnalyzer errors for my PR, but seems like something else from vpn is failing the PR - https://dev.azure.com/azure-sdk/public/_build/results?buildId=238898&view=logs&j=e1b7b984-9f58-529f-7c5a-f15f8e35cfa6&t=e8689ae8-b216-55f7-b207-4831f84ff98a&l=98

Is there a successful build in network-december branch ?

@anton-evseev
Copy link
Contributor

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

anton-evseev
anton-evseev previously approved these changes Jan 21, 2020
@isra-fel isra-fel dismissed anton-evseev’s stale review January 21, 2020 14:24

The base branch was changed.

@isra-fel isra-fel changed the base branch from network-december to release-2020-02-04 January 21, 2020 14:24
@isra-fel isra-fel assigned isra-fel and unassigned sobaner-zz Jan 21, 2020
@isra-fel isra-fel merged commit d0ca079 into Azure:release-2020-02-04 Jan 22, 2020
@isra-fel isra-fel mentioned this pull request Jan 22, 2020
8 tasks
dingmeng-xue pushed a commit to dingmeng-xue/azure-powershell that referenced this pull request Mar 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants