Skip to content

{HORIZONDB} Apply validations for argument values#10041

Merged
Pan-Qi merged 8 commits into
Azure:mainfrom
nasc17:nasc/horizonValidations
Jun 30, 2026
Merged

{HORIZONDB} Apply validations for argument values#10041
Pan-Qi merged 8 commits into
Azure:mainfrom
nasc17:nasc/horizonValidations

Conversation

@nasc17

@nasc17 nasc17 commented Jun 25, 2026

Copy link
Copy Markdown
Member

This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

az horizondb create
az horizondb update

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (azdev required; see .azure-pipelines/templates/azdev_setup.yml for the install command until azdev==0.2.11b1 is on PyPI)
  • My extension version conforms to the Extension version schema

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.json automatically.
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.

image
az horizondb create -g nascrunner26 -n nasc-horizon-cli1 -l westus2 --administrator-login arcadmin --administrator-login-password --v-cores 115
Checking the existence of the resource group 'nascrunner26'...
Resource group 'nascrunner26' exists ? : True 
Invalid value for '--v-cores'. Supported values: 2, 4, 8, 16, 20, 32, 48, 64, 96, 128, 192

az horizondb create -g nascrunner26 -n nasc-horizon-cli1 -l westus2 --administrator-login arcadmin --administrator-login-password --replica-count 18
Replica count must be between 1 and 16, inclusive.

@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented Jun 25, 2026

Copy link
Copy Markdown
⚠️Azure CLI Extensions Breaking Change Test
⚠️horizondb
rule cmd_name rule_message suggest_message
⚠️ 1010 - ParaPropUpdate horizondb create cmd horizondb create update parameter administrator_login: updated property options from ['--administrator-login'] to ['--administrator-login', '-u']
⚠️ 1009 - ParaPropRemove horizondb create cmd horizondb create update parameter cluster_name: removed property required=True
⚠️ 1010 - ParaPropUpdate horizondb create cmd horizondb create update parameter replica_count: updated property options from ['--replica-count'] to ['--replica-count', '-r']
⚠️ 1009 - ParaPropRemove horizondb create cmd horizondb create update parameter resource_group_name: removed property required=True
⚠️ 1010 - ParaPropUpdate horizondb create cmd horizondb create update parameter zone_placement_policy: updated property options from ['--zone-placement-policy'] to ['--zone-placement-policy', '-z']

@azure-client-tools-bot-prd

Copy link
Copy Markdown

Hi @nasc17,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@yonzhan yonzhan requested a review from jsntcy June 25, 2026 00:36
@yonzhan

yonzhan commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

HORIZONDB

@nasc17 nasc17 marked this pull request as ready for review June 26, 2026 17:31
Copilot AI review requested due to automatic review settings June 26, 2026 17:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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/update implementation 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 to 1.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.

Comment thread src/horizondb/azext_horizondb/utils/validators.py Outdated
Comment thread src/horizondb/azext_horizondb/commands/custom_commands.py
Comment thread src/horizondb/azext_horizondb/commands/custom_commands.py
Comment thread src/horizondb/azext_horizondb/utils/validators.py
Comment thread src/horizondb/azext_horizondb/utils/_util.py
Comment thread src/horizondb/azext_horizondb/utils/temp_cluster_capabilities.py
Comment on lines 82 to +83
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)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well leave as is for now

@nasc17

nasc17 commented Jun 29, 2026

Copy link
Copy Markdown
Member Author

@yonzhan @jsntcy Please trigger all checks

@yonzhan

yonzhan commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

@nachoalonsoportillo nachoalonsoportillo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nasc17

nasc17 commented Jun 29, 2026

Copy link
Copy Markdown
Member Author

@yonzhan @jsntcy Please merge

@yonzhan yonzhan requested a review from Pan-Qi June 29, 2026 23:07
@yonzhan

yonzhan commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

@Pan-Qi please help with this PR

@Pan-Qi Pan-Qi merged commit 22f9c1c into Azure:main Jun 30, 2026
24 checks passed
@azclibot

Copy link
Copy Markdown
Collaborator

[Release] Update index.json for extension [ horizondb-1.0.0b4 ] : https://dev.azure.com/msazure/One/_build/results?buildId=170340628&view=results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants