Skip to content

Conversation

@TylerLeonhardt
Copy link
Member


This updates the connectedmachine extension to 2020-08-02 of the spec. In doing this I also changed the autogenerated tests to test more useful things.

I was told to move the changed tests to the custom folder but after doing that then the test didn't run... so I'm not sure what to do there...

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/TylerLeonhardt/azure-cli-extensions.git@sdkAutomation/connectedmachine@10789#subdirectory=src/$EXT&egg=$EXT"

@yungezz
Copy link
Member

yungezz commented Sep 15, 2020

Majority code is generated, less manual written. so LGTM.

@TylerLeonhardt
Copy link
Member Author

Yeah the commits tell you what is generated and what is manually edited

Comment on lines +75 to +77
short-summary: "The operation to create or update the extension."
examples:
- name: Create or Update a Machine Extension
Copy link
Member

Choose a reason for hiding this comment

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

I think we should remove or update here. @qiaozha can we do this in codegen automatically?

Copy link
Member

Choose a reason for hiding this comment

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

Make sense. I filed an issue to track this Azure/autorest.az#553

Copy link
Member

Choose a reason for hiding this comment

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

Suddenly realized the example name is from swagger example reference name. https://github.com/Azure/azure-rest-api-specs/blob/master/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2020-08-02/HybridCompute.json#L90. Not sure we can change it as we use this to identify the example.
If you mean the short summary I think we can change it.

Copy link
Member

Choose a reason for hiding this comment

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

If you check the example in the update command below, it's using the same name. It's better to distinguish them. Please evaluate further the feasibility of change as this is a common case in swagger.

Copy link
Member Author

Choose a reason for hiding this comment

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

Let me know if there's something I need to do here

with self.argument_context('connectedmachine machine-extension show') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('machine_name', type=str, help='The name of the machine containing the extension.', id_part='name')
c.argument('name', type=str, help='The name of the machine extension.', id_part='child_name_1')
Copy link
Member

Choose a reason for hiding this comment

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

Add options_list=['--name', '-n'].

@qiaozha when the argument name is name, the options are not added?

Copy link
Member Author

Choose a reason for hiding this comment

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

The code is generated. How would I do this in a generated way?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ive added the change manually in this PR and in Azure/azure-rest-api-specs#10795

c.argument('resource_group_name', resource_group_name_type)
c.argument('machine_name', type=str, help='The name of the machine where the extension should be created or '
'updated.')
c.argument('name', type=str, help='The name of the machine extension.')
Copy link
Member

Choose a reason for hiding this comment

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

Add options_list=['--name', '-n'] for name arguments in all below commands as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

The code is generated. How would I do this in a generated way?

Copy link
Member

Choose a reason for hiding this comment

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

@qiaozha can we configure the options, probably using alias?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ive added the change manually in this PR and in Azure/azure-rest-api-specs#10795

Co-authored-by: Feng Zhou <[email protected]>
@TylerLeonhardt
Copy link
Member Author

TylerLeonhardt commented Sep 17, 2020

Awesome :) this should be ready to merge.

@fengzhou-msft fengzhou-msft merged commit a3bc42c into Azure:master Sep 17, 2020
@TylerLeonhardt TylerLeonhardt deleted the sdkAutomation/connectedmachine@10789 branch September 17, 2020 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PLR PLR work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants