-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[Safeguards] Fix verb tense in help text and add pre-existence check #9433
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?
[Safeguards] Fix verb tense in help text and add pre-existence check #9433
Conversation
- Change help text examples to use first-person imperative verbs - 'Creates' -> 'Create', 'Deletes' -> 'Delete', 'Gets' -> 'Get' - Update version to 19.0.0b17 - Add changelog entry
️✔️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>
|
CodeGen Tools Feedback CollectionThank you for using our CodeGen tool. We value your feedback, and we would like to know how we can improve our product. Please take a few minutes to fill our codegen survey |
|
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 fixes verb tense in safeguards help text to align with Azure CLI documentation guidelines by changing from third-person present tense (e.g., "Creates", "Deletes", "Gets") to first-person imperative verbs (e.g., "Create", "Delete", "Get"). The version is also bumped to 19.0.0b17 with a corresponding changelog entry.
- Updated help text examples in
_show.py,_delete.py, and_create.pyto use imperative verb forms - Incremented version from 19.0.0b16 to 19.0.0b17 in setup.py
- Added changelog entry documenting the help text fix
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/aks-preview/setup.py | Version bump from 19.0.0b16 to 19.0.0b17 |
| src/aks-preview/azext_aks_preview/aaz/latest/aks/safeguards/_show.py | Changed "Gets" to "Get" in example descriptions |
| src/aks-preview/azext_aks_preview/aaz/latest/aks/safeguards/_delete.py | Changed "Deletes" to "Delete" in example descriptions |
| src/aks-preview/azext_aks_preview/aaz/latest/aks/safeguards/_create.py | Changed "Creates" to "Create" in example descriptions |
| src/aks-preview/HISTORY.rst | Added changelog entry for version 19.0.0b17 |
…Y entry - Add validation in _execute_operations() to check if Deployment Safeguards already exists before creating - Block duplicate creates with helpful error message guiding users to update or delete - Supports both -g/-n and --managed-cluster URI syntax - Fix duplicate 19.0.0b16 headers in HISTORY.rst - Update HISTORY.rst with new pre-existence check feature
|
please fix failed CI checks |
src/aks-preview/azext_aks_preview/aaz/latest/aks/safeguards/_create.py
Outdated
Show resolved
Hide resolved
…rror import - Changed self.ctx.cmd.cli_ctx to self.ctx.cli_ctx in aks_safeguards_custom.py - Added CLIError import from azure.cli.core.azclierror - Updated test recordings for all three safeguards tests - All tests passing: basic, argument_validation, with_pss
The duplicate resource check logic was in the AAZ-generated _create.py file, which would be overwritten when AAZ tools regenerate the file. Moved all the duplicate checking logic to the custom class pre_operations() method in aks_safeguards_custom.py where it belongs. This ensures the logic will persist through AAZ regeneration.
All three safeguards tests have been re-recorded in live mode to ensure recordings reflect the corrected code structure with duplicate checking logic in the custom class.
Generated new recording files by running all three tests together in live mode: - test_aks_deployment_safeguards_basic.yaml (212KB) - test_aks_deployment_safeguards_argument_validation.yaml (164KB) - test_aks_deployment_safeguards_with_pss.yaml (240KB) All recordings reflect the corrected code with duplicate checking in custom class.
Linting fixes: - Remove duplicate import of is_valid_resource_id - Split long line (167 chars) into multiple lines to meet 120 char limit - Extract API version to variable for better readability Regenerated all three test recordings with the linting fixes applied. All tests passing (38 minutes total runtime).
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.
lgtm
Queued live test to validate the change, test passed!
Changes Made
az aks safeguards createto prevent duplicate resource creationThis checklist is used to make sure that common guidelines for a pull request are followed.
Related command
az aks safeguards create,az aks safeguards delete,az aks safeguards showDescription
This PR addresses two improvements to the safeguards commands:
Help text verb tense fix: Updated examples in
_create.py,_delete.py, and_show.pyto use first-person imperative verbs per Azure CLI guidelines (e.g., "Create" instead of "Creates").Pre-existence validation: Added a check in
az aks safeguards createto prevent duplicate resource creation. The command now:az aks safeguards updateoraz aks safeguards delete-g/-nand--managed-clusterURI syntaxTesting
-g/-nand--managed-clusterURI syntaxGeneral Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)azdevrequires a full Azure CLI development environment with bothazure-cliandazure-cli-extensionsrepos configured viaazdev setup. This PR contains help text changes in AAZ-generated files and validation logic. The CI pipeline will validate this automatically.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.Addresses feedback from PR #897