-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[MIGRATE] Split custom.py to separate files and folder for easier maintainability #9421
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
❌Azure CLI Extensions Breaking Change Test
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
|
…4/azure-cli-extensions into user/saif/newCommands
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR reorganizes the Azure Migrate CLI extension codebase by splitting a large monolithic custom.py file into smaller, more maintainable modules organized in a hierarchical folder structure. The refactoring also adds two new commands (remove and get-job) and updates the extension version to 2.0.1b1 (preview).
Key changes:
- Splits helper functions from a single file into organized modules under
helpers/directory - Updates all import paths throughout the codebase to reflect new structure
- Adds
remove-local-server-replicationandget-local-replication-jobcommands - Marks extension as preview in metadata
- Cleans up unused exception variables in test code
Reviewed Changes
Copilot reviewed 24 out of 25 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| setup.py | Updates version to 2.0.1b1 |
| azext_metadata.json | Marks extension as preview |
| custom.py | Updates imports to new helper module paths; adds new command functions |
| commands.py | Adds new command registrations; fixes command group hierarchy |
| _params.py | Updates argument context paths; adds parameters for new commands |
| _help.py | Adds help documentation for new commands |
| HISTORY.rst | Documents version changes |
| helpers/_utils.py | New consolidated utilities module |
| helpers/_server.py | Server discovery helper functions |
| helpers/replication/*/ | Organized replication workflow modules |
| test_migrate_commands.py | Updates test mocks to new import paths; removes unused variables |
Comments suppressed due to low confidence (1)
src/migrate/azext_migrate/helpers/replication/new/_process_inputs.py:1
- The function
validate_server_parametersin_validate.pyreturns a tuple(rg_uri, machine_id)but in the old version in_process_inputs.pyit only returnedrg_uri. The function signature has changed during the refactoring. Ensure all call sites have been updated to handle both return values. The call in custom.py (line 281) correctly unpacks both values, which is good.
Note: This PR will be merged as a squash commit
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
All az migrate commands, no change to the features this is just a reorganization of the code to be more maintainable and seperate.
General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install wheel==0.30.0required)For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json.