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} Refactor role module for Microsoft Graph migration #22300

Merged
merged 1 commit into from
May 7, 2022

Conversation

jiasli
Copy link
Member

@jiasli jiasli commented May 7, 2022

Code refactoring

  • Replace azure.graphrbac SDK interactions with model-less dict operations
  • Sort functions in src/azure-cli/azure/cli/command_modules/role/custom.py into logical groups for easier developer collaboration and source control
  • Extract src/azure-cli/azure/cli/command_modules/role/msgrpah (similar to https://github.com/microsoftgraph/msgraph-sdk-python-core) to officially introduce msgraph.GraphClient so that it can be re-used by other modules or extensions
  • Introduce msgraph.GraphError for model-less error handling
  • Rename msgraph.GraphClient methods: for non-create POST API like addPassword, use ...add_password, instead of changing it to ...password_add

Test refactoring

  • Migrate test replacers for Microsoft Graph: MSGraphClientPasswordReplacer, MSGraphUserReplacer
  • Manually test all az ad/role commands to be working
  • Re-organize test cases into reasonable logical groups like ApplicationScenarioTest
  • Rewrite all tests to adapt to Microsoft Graph, especially dropping AD Graph permission tests for az app permission
  • Re-run all tests for az ad/role so that the recording contains Microsoft Graph requests

This PR paves the way for complete Microsoft Graph migration (#22174).

@ghost ghost requested a review from yonzhan May 7, 2022 07:55
@ghost ghost added the Auto-Assign Auto assign by bot label May 7, 2022
@ghost ghost assigned jiasli May 7, 2022
@ghost ghost added this to the May 2022 (2022-05-24) - For Build milestone May 7, 2022
@ghost ghost added RBAC az role Graph az ad labels May 7, 2022
@yonzhan
Copy link
Collaborator

yonzhan commented May 7, 2022

Graph

@jiasli jiasli merged commit ac80a2d into Azure:beta May 7, 2022
@jiasli jiasli deleted the graph-refactor branch May 7, 2022 09:47
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 Microsoft Graph RBAC az role
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants