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

[Breadth Coverage] Datashare #1476

Merged
merged 27 commits into from
Apr 23, 2020
Merged

Conversation

fengzhou-msft
Copy link
Member


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/fengzhou-msft/azure-cli-extensions.git@datashare#subdirectory=src/$EXT&egg=$EXT"

@yonzhan
Copy link
Collaborator

yonzhan commented Apr 1, 2020

Datashare

@fengzhou-msft fengzhou-msft changed the title [WIP] [Breadth Coverage] Datashare [Breadth Coverage] Datashare Apr 10, 2020
@fengzhou-msft fengzhou-msft requested review from arrownj and qwordy April 13, 2020 08:05
# --------------------------------------------------------------------------------------------


def example_name_or_id_validator(cmd, namespace):
Copy link
Member

Choose a reason for hiding this comment

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

Unused code.

Copy link
Member

Choose a reason for hiding this comment

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

saw this in another PR, pls feedback to codegen team to remove it

@qwordy
Copy link
Member

qwordy commented Apr 14, 2020

I notice there are "generated" and "manual" folders. Can you explain them?

--resource-group "datashare_provider_rg" \
--share-name "cli_test_share"

#### Datashare Resource Management for a Consumer:
Copy link
Member

Choose a reason for hiding this comment

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

todo?

src/datashare/azext_datashare/generated/_help.py Outdated Show resolved Hide resolved
src/datashare/azext_datashare/generated/_params.py Outdated Show resolved Hide resolved
src/datashare/azext_datashare/generated/_params.py Outdated Show resolved Hide resolved
src/datashare/azext_datashare/generated/_params.py Outdated Show resolved Hide resolved
src/datashare/azext_datashare/generated/_params.py Outdated Show resolved Hide resolved
src/datashare/azext_datashare/generated/_params.py Outdated Show resolved Hide resolved
src/datashare/azext_datashare/generated/_params.py Outdated Show resolved Hide resolved
src/datashare/azext_datashare/generated/_params.py Outdated Show resolved Hide resolved
# --------------------------------------------------------------------------------------------


def example_name_or_id_validator(cmd, namespace):
Copy link
Member

Choose a reason for hiding this comment

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

saw this in another PR, pls feedback to codegen team to remove it

@fengzhou-msft
Copy link
Member Author

I notice there are "generated" and "manual" folders. Can you explain them?

Do not review generated code, they have issues and will be fixed only with regeneration. I copied all generated code into manual folder and modified it there.

@fengzhou-msft
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@yungezz yungezz left a comment

Choose a reason for hiding this comment

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

I've reviewed generated code. The manual code looks good comparing to generated one. pls help to make sure comments in generated code covered in manual code. thanks.

src/datashare/azext_datashare/manual/_help.py Show resolved Hide resolved
\\"tableName\\":\\"Table1\\"}}"
- name: Create a SqlDWTable dataset
text: |-
az datashare dataset create --account-name MyAccount --name "Dataset1" --resource-group MyResourceGroup --share-name "Share1" \
Copy link
Member

Choose a reason for hiding this comment

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

nice examples

src/datashare/azext_datashare/manual/_help.py Outdated Show resolved Hide resolved
src/datashare/azext_datashare/manual/custom.py Outdated Show resolved Hide resolved
Comment on lines +41 to +42
g.custom_command('create', 'datashare_data_set_create')
g.custom_command('delete', 'datashare_data_set_delete', supports_no_wait=True, confirmation=True)
Copy link
Member

Choose a reason for hiding this comment

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

Curious about why "create" does not support no wait. Does it indicate "create" is faster than "delete"?

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess delete involves updating for all consumers who received the dataset and may have created dataset-mapping, trigger related to it.

return {self.parameter_name: name}

def remove_resource(self, name, **kwargs):
pass
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to remove resource?

Copy link
Member Author

Choose a reason for hiding this comment

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

This file is not used and removed it.

c.argument('resource_group_name', resource_group_name_type) # modified

with self.argument_context('datashare account show') as c:
c.argument('resource_group_name', resource_group_name_type) # modified
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to add resource_group_name ? The default definition is not enough ? And what does #modified in the last part means ?

Copy link
Member Author

@fengzhou-msft fengzhou-msft Apr 22, 2020

Choose a reason for hiding this comment

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

This is autogenerated. I think either keeping it or removing it is fine. #modified is to mark the code that was modified for autogenerated code since I copied all generated code here. The initial thought was to generate multiple times and we will have less manual code. We can eventually only keep modified code in manual folder. But that's not so convenient for datashare with a large amount of code. I finally decided to remove the generated code that needs to be modified.

@fengzhou-msft fengzhou-msft merged commit 3360eca into Azure:master Apr 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants