Skip to content

Conversation

@alexeldeib
Copy link
Contributor

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

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally?

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your PR is merged into master branch, a new PR will be created to update src/index.json automatically.
The precondition is to put your code inside this repo and upgrade the version in the PR but do not modify src/index.json.

@azuresdkci
Copy link

If this PR is for a new extension or change to an existing extension, use the following to try out the changes in this PR:

docker run -it microsoft/azure-cli:latest
export EXT=<NAME>
pip install --upgrade --target ~/.azure/cliextensions/$EXT "git+https://github.com/alexeldeib/azure-cli-extensions.git@ace/ephemeral#subdirectory=src/$EXT&egg=$EXT"

@alexeldeib
Copy link
Contributor Author

@marwanad

Copy link
Contributor

Choose a reason for hiding this comment

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

reason for change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I got lint errors on this running python linters as specified by CLI. (len-as-condition, pylint C1801)

seems like that's a bit debatable as far as being preferable itself, though: pylint-dev/pylint#1405 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

surprised CI didn't catch that

@Azure Azure deleted a comment from yonzhan Sep 14, 2020
Copy link
Member

Choose a reason for hiding this comment

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

is this required? or optional? if optional pls set it to None

Copy link
Contributor Author

Choose a reason for hiding this comment

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

optional, will do

Copy link
Contributor

Choose a reason for hiding this comment

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

Since arg_type=get_enum_type([CONST_OS_DISK_TYPE_MANAGED, CONST_OS_DISK_TYPE_EPHEMERAL]) is used in _param.py, the framework will automatically add "Allowed values" list for it. We do not need to add manually here.

And if the default value is "Managed", we can directly define the custom function as below:

def aks_create(cmd, # pylint: disable=too-many-locals,too-many-statements,too-many-branches
client, client,
resource_group_name, resource_group_name,
name, name,
ssh_key_value, ssh_key_value,
dns_name_prefix=None, dns_name_prefix=None,
location=None, location=None,
admin_username="azureuser", admin_username="azureuser",
windows_admin_username=None, windows_admin_username=None,
windows_admin_password=None, windows_admin_password=None,
kubernetes_version='', kubernetes_version='',
node_vm_size="Standard_DS2_v2", node_vm_size="Standard_DS2_v2",
node_osdisk_type="Managed",

The framework will also add Default value in help message automatically.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll remove it from the help 👍 but I don't think we want to default this value client side, we want it to be empty and we will default it server side.

In October, the defaulting behavior on server side will get slightly more complex when the value isn't provided and I would strongly prefer not to copy that defaulting behavior into the client.

@azuresdkci
Copy link

If this PR is for a new extension or change to an existing extension, use the following to try out the changes in this PR:

docker run -it microsoft/azure-cli:latest
export EXT=<NAME>
pip install --upgrade --target ~/.azure/cliextensions/$EXT "git+https://github.com/alexeldeib/azure-cli-extensions.git@ace/ephemeral#subdirectory=src/$EXT&egg=$EXT"

@alexeldeib
Copy link
Contributor Author

had to re-run appgw tests to get fresh recording to pass (think this is related to recent issues with normalization in the names), sorry about that

Copy link
Contributor

@arrownj arrownj left a comment

Choose a reason for hiding this comment

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

The code is good to me.

@arrownj arrownj merged commit cad7868 into Azure:master Sep 16, 2020
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.

5 participants