-
Notifications
You must be signed in to change notification settings - Fork 1.5k
v1 tags and public IP fix #8925
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
Conversation
|
Validation for Breaking Change Starting...
Thanks for your contribution! |
|
Hi @BlairBriggs, |
|
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>
|
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 introduces optional tagging support for repair VMs, fixes unintended public IP creation, and updates documentation and tests to validate the new features.
- Add
--tagsparameter support tocreate,repair-and-restore, andrepair-buttoncommands - Only include
--public-ip-addresswhen explicitly requested to prevent default public IPs - Update help text and add tests to cover tag scenarios
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/vm-repair/tests/test_vm_repair_commands.py | Add base ScenarioTest for az vm repair create |
| src/vm-repair/azext_vm_repair/tests/latest/test_repair_commands.py | Extend live tests to verify tag propagation on repair VMs |
| src/vm-repair/azext_vm_repair/custom.py | Add tags parameter, build --tags argument, update signatures |
| src/vm-repair/azext_vm_repair/_validators.py | Fix typo in comment and error message |
| src/vm-repair/azext_vm_repair/_params.py | Expose tags argument to CLI contexts |
| src/vm-repair/azext_vm_repair/_help.py | Document --tags usage and examples |
Comments suppressed due to low confidence (3)
src/vm-repair/azext_vm_repair/custom.py:154
- Consider using the Azure CLI's built-in tag parser (e.g.,
tags_typeorget_tags_from_name_value) in parameter definition rather than custom string handling, to ensure consistent parsing and validation.
# Azure CLI accepts tags as either a space-separated list of key=value pairs or a single string. Support both dict and string for flexibility.
src/vm-repair/azext_vm_repair/_validators.py:52
- Add validation for the
tagsargument here—parse the raw string into a dict and surface errors for invalid formats—to provide early feedback and consistent behavior.
else:
src/vm-repair/tests/test_vm_repair_commands.py:11
- Consider adding a ScenarioTest here to verify that passing
--tagstoaz vm repair createresults in tags being applied, completing end-to-end coverage for the new feature.
result = self.cmd('az vm repair create -g {rg} -n {vm_name} --verbose').get_output_in_json()
| c.argument('yes', help='Option to skip prompt for associating public ip in no Tty mode') | ||
| c.argument('disable_trusted_launch', help='Option to disable Trusted Launch security type on the repair vm by setting the security type to Standard.') | ||
| c.argument('os_disk_type', help='Change the OS Disk storage type from the default of PremiumSSD_LRS to the given value.') | ||
| c.argument('tags', help="Space-separated tags in 'key[=value]' format. Use '' to clear existing tags.") |
Copilot
AI
Jul 2, 2025
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.
[nitpick] It may be preferable to use the CLI's tags_type for this argument to automatically handle parsing, validation, and completion of tag inputs.
|
Hi @BlairBriggs Release SuggestionsModule: vm-repair
Notes
|
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
AZ VM CREATE
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.NOTES
Summary
This PR adds support for an optional
--tagsargument to theaz vm repairextension, improves public IP handling, and enhances documentation and test coverage to align with Azure CLI standards.Summary of Changes
1.
custom.py--tagsargument to thecreate,repair_and_restore, andrepair_buttonfunctions.key=value) formats, ensuring compatibility with Azure CLI conventions.--public-ip-addressonly when explicitly requested, fixing a bug where a public IP was created by default.Reason:
To allow users to specify tags for the repair VM, prevent unintended public IP creation, and improve code clarity.
2.
_params.py--tagsargument for thevm repair create,vm repair repair-and-restore, andvm repair repair-buttoncommands.Reason:
To make the
--tagsargument available to users at the CLI, following Azure CLI argument exposure patterns.3.
_help.py--tagsargument for all relevant commands.--tagsin the standard Azure CLI format (e.g.,--tags env=prod owner=alice).--tagsis optional.Reason:
To ensure users are aware of the new functionality and how to use it correctly.
4.
test_repair_commands.py--tagsare present on the created repair VM.Reason:
To verify that the new
--tagsfunctionality works as intended and does not introduce regressions.Rationale