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

{Graph} Refine code and tests for ms graph group #21663

Merged
merged 3 commits into from
Mar 17, 2022

Conversation

evelyn-ys
Copy link
Member

@evelyn-ys evelyn-ys commented Mar 16, 2022

Description

Similar with #21525
Refine code and tests for ms graph group


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

@ghost ghost requested a review from yonzhan March 16, 2022 08:59
@ghost ghost added the Auto-Assign Auto assign by bot label Mar 16, 2022
@ghost ghost assigned jiasli Mar 16, 2022
@ghost ghost added the RBAC az role label Mar 16, 2022
@ghost ghost requested a review from wangzelin007 March 16, 2022 09:00
@ghost ghost added the Graph az ad label Mar 16, 2022
@evelyn-ys evelyn-ys changed the title {Role} Refine code and tests for ms graph group {Graph} Refine code and tests for ms graph group Mar 16, 2022
@yonzhan
Copy link
Collaborator

yonzhan commented Mar 16, 2022

Graph

@yonzhan yonzhan added this to the Mar 2022 (2022-04-06) milestone Mar 16, 2022

# show user's group memberships
self.cmd('ad user get-member-groups --upn-or-object-id {user1_id}',
checks=self.check('[0].displayName', self.kwargs['group']))
Copy link
Member Author

Choose a reason for hiding this comment

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

az ad user related tests are totally removed from GraphGroupScenarioTest
@calvinhzy for awareness

Comment on lines -612 to -617
self.cmd('ad user update --display-name {user1}_new --account-enabled false --id {user1}@{domain} --mail-nickname {new_mail_nick_name}')
user1_update_result = self.cmd('ad user show --upn-or-object-id {user1}@{domain}', checks=[self.check("displayName", '{user1}_new')]).get_output_in_json()
self.cmd('ad user update --id {user1}@{domain} --password {pass}')
self.cmd('ad user update --id {user1}@{domain} --password {pass} --force-change-password-next-login true')
with self.assertRaises(CLIError):
self.cmd('ad user update --id {user1}@{domain} --force-change-password-next-login false')
Copy link
Member

Choose a reason for hiding this comment

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

@calvinhzy, please make sure these removed tests are covered by user tests.

Copy link
Member

Choose a reason for hiding this comment

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

Ah. I saw you have already mentioned that: #21663 (comment) 😄

@jiasli
Copy link
Member

jiasli commented Mar 16, 2022

Just as a side note:

https://docs.microsoft.com/en-us/graph/api/group-list-members?view=graph-rest-1.0&tabs=http

Currently service principals are not listed as group members due to staged roll-out of service principals on Graph V1.0 endpoint.

This was found in #16123 (comment)

Email: Microsoft Graph feature gap

@jiasli jiasli assigned evelyn-ys and unassigned jiasli Mar 16, 2022
@evelyn-ys evelyn-ys requested a review from jiasli March 17, 2022 04:43
@evelyn-ys evelyn-ys requested a review from jiasli March 17, 2022 08:01
@evelyn-ys evelyn-ys merged commit 168bae8 into Azure:beta Mar 17, 2022
self.cmd('ad group member remove -g {leaf_group_id} --member-id {sp_id}')
self.cmd('ad group member check -g {leaf_group_id} --member-id {sp_id}',
checks=self.check('value', False))
with mock.patch('azure.cli.command_modules.role.custom._gen_guid', side_effect=self.create_guid):
Copy link
Member

Choose a reason for hiding this comment

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

Actually we don't need this, as we are not generating any role assignments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot Graph az ad RBAC az role
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants