{HORIZONDB} Apply validations for argument values#10041
Conversation
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| horizondb create | cmd horizondb create update parameter administrator_login: updated property options from ['--administrator-login'] to ['--administrator-login', '-u'] |
||
| horizondb create | cmd horizondb create update parameter cluster_name: removed property required=True |
||
| horizondb create | cmd horizondb create update parameter replica_count: updated property options from ['--replica-count'] to ['--replica-count', '-r'] |
||
| horizondb create | cmd horizondb create update parameter resource_group_name: removed property required=True |
||
| horizondb create | cmd horizondb create update parameter zone_placement_policy: updated property options from ['--zone-placement-policy'] to ['--zone-placement-policy', '-z'] |
|
Hi @nasc17, |
|
HORIZONDB |
There was a problem hiding this comment.
Pull request overview
This PR updates the horizondb Azure CLI extension to add/strengthen input validation for key command arguments (notably --v-cores, --replica-count, and resource group name handling) and introduces short-form flags for improved command ergonomics, along with the corresponding version bump and test/recording updates.
Changes:
- Add new validator helpers (vCore support check, replica-count validation, resource group validation).
- Update
horizondb create/updateimplementation to validate vCore values and to generate missing parameters for create. - Add short-form options (e.g.,
-u/-p/-r/-z) and update scenario tests/recordings; bump extension version to1.0.0b4.
Reviewed changes
Copilot reviewed 8 out of 11 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/horizondb/setup.py | Bumps extension version to 1.0.0b4. |
| src/horizondb/HISTORY.rst | Adds release notes entry for 1.0.0b4. |
| src/horizondb/azext_horizondb/utils/validators.py | Adds validation helpers and replica-count validation. |
| src/horizondb/azext_horizondb/utils/temp_cluster_capabilities.py | Adds a hardcoded capabilities payload used for vCore validation. |
| src/horizondb/azext_horizondb/utils/_util.py | Adds helper utilities for RG existence checks and auto-creation. |
| src/horizondb/azext_horizondb/commands/custom_commands.py | Adds create-time vCore validation and RG validation behavior changes; sets default version constant. |
| src/horizondb/azext_horizondb/_params.py | Adds short-form args and wires replica-count validator; marks some args required. |
| src/horizondb/azext_horizondb/tests/latest/test_horizondb_commands_parameter_group.py | Renames scenario test method to *_mgmt. |
| src/horizondb/azext_horizondb/tests/latest/recordings/test_horizondb_parameter_group.yaml | Updates/renames the scenario test recording to match test naming changes. |
| c.argument('administrator_login', arg_type=administrator_login_arg_type) | ||
| c.argument('administrator_login_password', arg_type=administrator_login_password_arg_type) | ||
| c.argument('administrator_login_password', arg_type=administrator_login_password_arg_type, required=True) |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
@Pan-Qi please help with this PR |
|
[Release] Update index.json for extension [ horizondb-1.0.0b4 ] : https://dev.azure.com/msazure/One/_build/results?buildId=170340628&view=results |
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
az horizondb createaz horizondb updateGeneral Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (azdevrequired; see.azure-pipelines/templates/azdev_setup.ymlfor the install command untilazdev==0.2.11b1is on PyPI)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.