Skip to content

Commvault generated commands - stable swagger version 2026-09-30 - #10525

Open
Saurabh Jaiswal (saurabh-jaiswal-333) wants to merge 1 commit into
Azure:mainfrom
saurabh-jaiswal-333:commvault-cli-extension
Open

Saurabh Jaiswal (saurabh-jaiswal-333) wants to merge 1 commit into
Azure:mainfrom
saurabh-jaiswal-333:commvault-cli-extension

Conversation

@saurabh-jaiswal-333

@saurabh-jaiswal-333 Saurabh Jaiswal (saurabh-jaiswal-333) commented Oct 26, 2026 •

Copy link
Copy Markdown

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

Related command

az commvault (new extension commvault 1.0.0b1). Companion aaz PR: Azure/aaz#1143

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? (pip install azdev required)
  • 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.


Notes for reviewers

  • New preview extension (1.0.0b1, azext.isPreview: true) for the Azure Native ISV service Liftr-Commvault, generated with aaz-dev from the stable Commvault.ContentStore API 2026-09-30 (azure-rest-api-specs, specification/liftrcommvault).
  • Command groups: az commvault cloud-account (with identity, plan, storage, protection-group, protection-group protected-item, role-mapping) plus az commvault activate-saas and az commvault protected-item-count. 43 commands and 5 wait commands.
  • Small customizations: the role mapping is a singleton named default, so that segment is hidden; --saas-resource-id and --role-assignments are renamed to satisfy the linter; --marketplace and --user are required on cloud-account create; cloud-account update uses PATCH. Every command has at least one example.
  • Linter: the require_wait_command_if_no_wait rule is excluded because the generator could not create a wait command for three long-running actions (activate-saas, link-saas, stop-backup): there is no GET with a provisioning state to poll.
  • Tests: 5 offline tests and 10 recorded read-only tests (cloud account, plan, storage, role mapping and not-found cases) recorded against the Commvault test subscription; the recordings are scrubbed of tenant, identity, subscription, e-mail and resource names. Create, update and action commands need a real Commvault SaaS activation, so they are covered by a spec-driven mock ARM check instead (all 48 commands run against the swagger and its examples, request bodies validated against the schema).
  • Known service-side limitations, being raised with the Commvault RP team and not caused by this extension: protection group and protected item operations require a user-context token that the Azure CLI client cannot obtain yet, and link-saas / latest-linked-saas are declared in the spec but not yet implemented by the service.

…26-09-30

New preview extension (1.0.0b1) generated with aaz-dev from the stable Commvault.ContentStore API 2026-09-30: az commvault cloud-account (identity, plan, storage, protection-group, protected-item, role-mapping), activate-saas and protected-item-count. Adds 5 offline tests and 10 recorded read-only tests, and the az commvault entry in service_name.json.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 26, 2026 20:09
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@microsoft-github-policy-service microsoft-github-policy-service Bot added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Oct 26, 2026
@microsoft-github-policy-service

Copy link
Copy Markdown
Contributor

Thank you for your contribution Saurabh Jaiswal (@saurabh-jaiswal-333)! We will review the pull request and get back to you soon.

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

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

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.

🔵 Needs a closer look

The broad backup and restore command surface needs human validation of the reported mock checks and service-dependent workflows.

1 open issue
What changed in this PR

Adds the preview commvault Azure CLI extension for managing Commvault Cloud resources through the stable 2026-09-30 API.

Changes:

  • Introduces generated resource-management commands, backup actions, and wait support.
  • Adds extension packaging, service registration, examples, and required cloud-account creation arguments.
  • Adds offline validation tests and recorded read-only scenarios.
File Description
src/​service_name.json Registers the Commvault service and documentation link.
src/​commvault/​setup.py Defines extension packaging and initial version.
src/​commvault/​setup.cfg Adds packaging configuration placeholder.
src/​commvault/​README.md Documents installation, command groups, and examples.
src/​commvault/​linter_exclusions.yml Excludes the wait-command requirement.
src/​commvault/​HISTORY.rst Records the initial release.
src/​commvault/​azext_commvault/​tests/​latest/​test_commvault.py Adds offline and read-only scenario tests.
src/​commvault/​azext_commvault/​tests/​latest/​recordings/​test_commvault_storage_show.yaml Records storage retrieval.
src/​commvault/​azext_commvault/​tests/​latest/​recordings/​test_commvault_role_mapping_show_and_list.yaml Records role-mapping retrieval and listing.
src/​commvault/​azext_commvault/​tests/​latest/​recordings/​test_commvault_plan_show.yaml Records plan retrieval.
src/​commvault/​azext_commvault/​tests/​latest/​recordings/​test_commvault_plan_show_not_found.yaml Records missing-plan handling.
src/​commvault/​azext_commvault/​tests/​latest/​recordings/​test_commvault_cloud_account_show.yaml Records cloud-account retrieval.
src/​commvault/​azext_commvault/​tests/​latest/​recordings/​test_commvault_cloud_account_show_not_found.yaml Records missing-account handling.
src/​commvault/​azext_commvault/​tests/​latest/​recordings/​test_commvault_cloud_account_list_by_subscription.yaml Records subscription-scoped listing.
src/​commvault/​azext_commvault/​tests/​latest/​recordings/​test_commvault_cloud_account_list_by_resource_group.yaml Records resource-group-scoped listing.
src/​commvault/​azext_commvault/​tests/​latest/​recordings/​test_commvault_cloud_account_identity_show.yaml Records identity retrieval.
src/​commvault/​azext_commvault/​tests/​latest/​recordings/​test_commvault_child_resources_of_missing_cloud_account_not_found.yaml Records missing-parent errors.
src/​commvault/​azext_commvault/​tests/​latest/​__init__.py Initializes the scenario-test package.
src/​commvault/​azext_commvault/​tests/​__init__.py Initializes the test package.
src/​commvault/​azext_commvault/​custom.py Requires marketplace and user creation arguments.
src/​commvault/​azext_commvault/​commands.py Registers the customized create command.
src/​commvault/​azext_commvault/​azext_metadata.json Declares preview status and CLI compatibility.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​storage/​_wait.py Adds storage condition polling.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​storage/​_show.py Adds storage retrieval.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​storage/​_refresh.py Adds storage-state refresh.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​storage/​_list.py Adds paginated storage listing.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​storage/​_enable_compliance_lock.py Adds compliance-lock enablement.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​storage/​_disable_compliance_lock.py Adds compliance-lock disable requests.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​storage/​_delete.py Adds asynchronous storage deletion.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​storage/​__init__.py Exports storage commands.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​storage/​__cmd_group.py Registers the storage command group.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​role_mapping/​_show.py Retrieves the singleton role mapping.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​role_mapping/​_list.py Adds paginated role-mapping listing.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​role_mapping/​_delete.py Deletes the singleton role mapping.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​role_mapping/​__init__.py Exports role-mapping commands.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​role_mapping/​__cmd_group.py Registers the role-mapping command group.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​protection_group/​protected_item/​_show.py Adds protected-item retrieval.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​protection_group/​protected_item/​_list.py Adds paginated protected-item listing.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​protection_group/​protected_item/​_get_restore_point.py Adds restore-point retrieval.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​protection_group/​protected_item/​__init__.py Exports protected-item commands.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​protection_group/​protected_item/​__cmd_group.py Registers the protected-item command group.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​protection_group/​_wait.py Adds protection-group condition polling.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​protection_group/​_stop_backup.py Adds asynchronous backup stopping.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​protection_group/​_show.py Adds protection-group retrieval.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​protection_group/​_resume_backup.py Adds backup resumption.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​protection_group/​_list.py Adds paginated protection-group listing.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​protection_group/​_delete.py Adds asynchronous protection-group deletion.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​protection_group/​_backup.py Adds ad-hoc VM backup requests.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​protection_group/​__init__.py Exports protection-group commands.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​protection_group/​__cmd_group.py Registers the protection-group command group.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​plan/​_wait.py Adds plan condition polling.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​plan/​_list.py Adds paginated plan listing.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​plan/​_delete.py Adds asynchronous plan deletion.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​plan/​__init__.py Exports plan commands.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​plan/​__cmd_group.py Registers the plan command group.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​identity/​__init__.py Exports identity commands.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​identity/​__cmd_group.py Registers the identity command group.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​_latest_linked_saas.py Adds linked SaaS resource lookup.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​_delete.py Adds asynchronous cloud-account deletion.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​__init__.py Exports cloud-account commands.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​cloud_account/​__cmd_group.py Registers the cloud-account command group.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​_protected_item_count.py Adds cross-account protected-item counting.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​__init__.py Exports top-level commands.
src/​commvault/​azext_commvault/​aaz/​latest/​commvault/​__cmd_group.py Registers the Commvault command group.
src/​commvault/​azext_commvault/​aaz/​latest/​__init__.py Initializes the latest command package.
src/​commvault/​azext_commvault/​aaz/​__init__.py Initializes the generated command package.
src/​commvault/​azext_commvault/​_params.py Adds the argument-loading hook.
src/​commvault/​azext_commvault/​_help.py Adds the extension help module.
src/​commvault/​azext_commvault/​__init__.py Loads generated and customized commands.

Review effort: Balanced

def test_commvault_storage_create_rejects_unknown_storage_type(self):
with self.assertRaises(SystemExit) as context:
self.cmd(f'{CCA} storage create -g rg-commvault-test --cloud-account-name contoso-commvault '
'-n contoso-airgap-storage -l eastus --storage-type NotAStorageType')
@x-engineering-agent
x-engineering-agent Bot requested a review from a team October 26, 2026 20:17
@JaysonTaiMicrosoft JaysonTaiMicrosoft added the Request X Engineering Agent Ask the agent to triage this issue or review this PR label Nov 2, 2026
@x-engineering-agent

x-engineering-agent Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

X Engineering Agent Pull request review: Comments

Saurabh Jaiswal (@saurabh-jaiswal-333) One test-strength issue remains at 079dddd18c6bdd593991d03828df348a00b858e6: the storage-type negative test can pass without exercising enum validation.

Check Status Detail
Upstream CI Passed The supplied upstream CI snapshot reports 24 passed, 0 failed and 0 pending out of 25…
Agent live tests Not run This is a review-only PR.
Regression coverage Not applicable Not applicable to the changed files.
Findings 1 medium findings 1 medium
Risk Risk 100/100 Critical Critical; owner review required

To address

Tick each item as you address it.

  • Medium Isolate storage-type validation

    Details and fix

    In src/commvault/azext_commvault/tests/latest/test_commvault.py:98, test_commvault_storage_create_rejects_unknown_storage_type passes -l eastus and only checks exit code 2. However, src/commvault/azext_commvault/aaz/latest/commvault/cloud_account/storage/_create.py:81-94 registers only --location, alongside the storage-type enum. The unrecognized -l can therefore satisfy the assertion even if enum validation is removed. This confirms the pending Copilot feedback against the current head; it is a test weakness, not evidence that production enum validation is broken.

    Replace -l with --location and assert that the diagnostic specifically rejects --storage-type NotAStorageType. Focused verification: ensure removing the enum restriction makes this test fail, and that a valid storage type clears argument validation using a mocked request boundary rather than live resources.

Review details

Upstream CI

The supplied upstream CI snapshot reports 24 passed, 0 failed and 0 pending out of 25 checks. This is upstream evidence, not an Agent test run.

Test validation

  • Agent live test: Not run; this is a review-only PR. Check author-provided test evidence and upstream CI separately.
  • Regression coverage: Not applicable to the changed files.

That automated applicability classification does not establish runtime coverage. The inspected author-provided recordings exercise read-only requests, not storage-create validation.

Risk assessment

100/100 · Critical

The Critical rating is driven by security-sensitive behavior, public CLI behavior, dependency or supply chain and 2 additional signal(s).

  • Change scope: 91 changed files, 16958 changed lines (+16958 / -0), including 72 production files.
  • Affected components: commvault
  • Risk drivers: security-sensitive behavior (+28); public CLI behavior (+18); dependency or supply chain (+18); failure-handling behavior (+12); generated output (+12)
  • Regression evidence: Changed regression tests are included, reducing risk.
  • Confidence: High because changed-line patches were available for every production file.
  • Required review: Owning-squad review is required for commvault before merge.

Ask the Agent

Tick a box to queue an action. Requires write access to this repository.

  • Re-review this PR
  • Run Agent live tests on this PR

X Engineering Agent · Reviewer · React with +1 or -1 to train the agent

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

Labels

customer-reported Issues that are reported by GitHub users external to the Azure organization. Request X Engineering Agent Ask the agent to triage this issue or review this PR X Engineering Agent Reviewed Agent reviewed this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants