Skip to content

Conversation

@SanjaMalesevic
Copy link
Contributor

@SanjaMalesevic SanjaMalesevic commented Sep 6, 2019


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

  • The PR has modified HISTORY.rst describing any customer-facing, functional changes. Note that this does not include changes only to help content. (see Modifying change log).

  • I adhere to the Command Guidelines.

@yonzhan
Copy link
Collaborator

yonzhan commented Sep 16, 2019

@jaredmoo please review and let us know when it is ready to merge.

c.argument('managed_instance_name',
arg_type=managed_instance_param_type)

c.argument('login',
Copy link
Contributor

Choose a reason for hiding this comment

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

Please define arg types (at top of file) that can be used for both sql server and MI arguments, instead of copying

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done


with self.argument_context('sql mi ad-admin create') as c:
# Create args that will be used to build up the ManagedInstanceAdministrator object
create_args_for_complex_type(
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can put this in sql mi ad-admin section so that it applies to both create and update (to avoid repetition)

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've tried to do this, but when executing get or delete command get the following error: ValueError: command authoring error: extra argument 'login' cannot be registered to a group-level scope 'sql mi ad-admin'. It must be registered to a specific command.
So, I need to keep both "sql mi ad-admin create" and "sql mi ad-admin update" sections.

server_key_name=key_name
)
server_key_type=server_key_type,
server_key_name=key_name
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Build wasn't successful because of failed test test_sql_tdebyok (azure.cli.command_modules.sql.tests.latest.test_sql_commands.SqlTransparentDataEncryptionScenarioTest). You can find more on this link https://github.com/Azure/azure-cli/runs/214404678.
After I've fixed this, all checks have passed

Copy link
Contributor

Choose a reason for hiding this comment

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

Azure/azure-sdk-for-python@58857ae

@zikalino , can you clarify why this breaking change happened?


profile = Profile()
sub = profile.get_subscription()
kwargs['tenant_id'] = sub['tenantId']
Copy link
Contributor

Choose a reason for hiding this comment

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

Please extract function which gets tenant id so that the logic isn't duplicated between server and mi

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done


**SQL**

* New Cmdlets for Management.Sql that supports setting AAD administrator on Managed instance
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of "Management.Sql", please use the command names i.e. "sql mi ad-admin"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

"""
helps['sql mi ad-admin create'] = """
type: command
short-summary: Create a new managed instance Active Directory administrator.
Copy link
Contributor

Choose a reason for hiding this comment

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

Creates

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

"""
helps['sql mi ad-admin update'] = """
type: command
short-summary: Update an existing managed instance Active Directory administrator.
Copy link
Contributor

Choose a reason for hiding this comment

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

Updates

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done



def _get_tenant_id():
from azure.cli.core._profile import Profile
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add '''description''' to function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

return client.create_or_update(
resource_group_name=resource_group_name,
managed_instance_name=managed_instance_name,
administrator_name="ActiveDirectory",
Copy link
Contributor

Choose a reason for hiding this comment

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

define constant, e.g. ACTIVE_DIRECTORY = "ActiveDirectory" so that string isn't repeated

Copy link
Contributor

Choose a reason for hiding this comment

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

Also unclear why this is needed compared to SQL server admin

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Skip this for now, because it will be removed after we change api specification and update the python client

server_key_name=key_name
)
server_key_type=server_key_type,
server_key_name=key_name
Copy link
Contributor

Choose a reason for hiding this comment

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

Azure/azure-sdk-for-python@58857ae

@zikalino , can you clarify why this breaking change happened?

jaredmoo
jaredmoo previously approved these changes Oct 1, 2019
Copy link
Contributor

@jaredmoo jaredmoo left a comment

Choose a reason for hiding this comment

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

Several comments but overall looks good

jaredmoo
jaredmoo previously approved these changes Oct 1, 2019
@yonzhan yonzhan requested a review from jiasli October 2, 2019 10:51
@yonzhan yonzhan added this to the Sprint 75 milestone Oct 2, 2019
@yonzhan
Copy link
Collaborator

yonzhan commented Oct 2, 2019

@jiasli please take a look and comment.

@yonzhan
Copy link
Collaborator

yonzhan commented Oct 8, 2019

please Rebase against the dev branch. Which should get Travis CI successfully run.

@fengzhou-msft
Copy link
Member

@SanjaMalesevic Can you rebase against dev and fix the conflicts? We're going to build for the next release on Friday Shanghai time.

@haroldrandom haroldrandom merged commit 0970d1c into Azure:dev Oct 11, 2019
@yonzhan
Copy link
Collaborator

yonzhan commented Oct 11, 2019

This PR was merged and will be incorporated in our next release.

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