Skip to content

Add trusted-host-subscription commands - #10174

Open
kellylu2sym wants to merge 2 commits into
Azure:mainfrom
kellylu2sym:computelimit/trusted-host-subscription
Open

Add trusted-host-subscription commands#10174
kellylu2sym wants to merge 2 commits into
Azure:mainfrom
kellylu2sym:computelimit/trusted-host-subscription

Conversation

@kellylu2sym

@kellylu2sym kellylu2sym commented Aug 3, 2026

Copy link
Copy Markdown
Member

🤖 PR Validation — ⚠️ Review suggested

Breaking Changes
⚠️ None
⚠️Azure CLI Extensions Breaking Change Test
⚠️computelimit
rule cmd_name rule_message suggest_message
⚠️ 1011 - SubgroupAdd computelimit trusted-host-subscription sub group computelimit trusted-host-subscription added

Add az computelimit trusted-host-subscription command group with add, list, remove and show commands (API version 2026-07-31), generated via aaz-dev and aligned with the existing guest-subscription/shared-limit naming convention (add/list/remove/show, no update).

Includes record-only scenario tests and negative/validation tests, and bumps the extension version to 1.1.0.


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

Related command

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.

Add `az computelimit trusted-host-subscription` command group with add, list, remove and show commands (API version 2026-07-31), generated via aaz-dev and aligned with the existing guest-subscription/shared-limit naming convention (add/list/remove/show, no update).

Includes record-only scenario tests and negative/validation tests, and bumps the extension version to 1.1.0.
Copilot AI review requested due to automatic review settings August 3, 2026 19:37
@azure-pipelines

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

@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.

Pull request overview

This PR adds a new az computelimit trusted-host-subscription command group to the computelimit extension (AAZ-generated, API version 2026-07-31), along with scenario/validation tests and a version bump to ship the feature.

Changes:

  • Introduces computelimit trusted-host-subscription commands: add, list, remove, show.
  • Adds record-only scenario tests plus negative/validation tests and corresponding test recordings.
  • Bumps extension version to 1.1.0 and updates release history.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/computelimit/setup.py Bumps extension version to 1.1.0.
src/computelimit/HISTORY.rst Adds 1.1.0 changelog entry for the new command group.
src/computelimit/azext_computelimit/tests/latest/test_computelimit.py Adds trusted-host-subscription scenario + validation tests.
src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_trusted_host_subscription_add.yaml Recording for trusted-host-subscription add.
src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_trusted_host_subscription_list.yaml Recording for trusted-host-subscription list.
src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_trusted_host_subscription_remove.yaml Recording for trusted-host-subscription remove.
src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_trusted_host_subscription_show.yaml Recording for trusted-host-subscription show.
src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_trusted_host_subscription_crud.yaml Recording for trusted-host-subscription CRUD flow.
src/computelimit/azext_computelimit/aaz/latest/computelimit/trusted_host_subscription/__cmd_group.py Registers the new trusted-host-subscription command group.
src/computelimit/azext_computelimit/aaz/latest/computelimit/trusted_host_subscription/init.py Exposes the trusted_host_subscription command modules.
src/computelimit/azext_computelimit/aaz/latest/computelimit/trusted_host_subscription/_add.py Implements PUT/create for trusted host subscription trust.
src/computelimit/azext_computelimit/aaz/latest/computelimit/trusted_host_subscription/_list.py Implements list-by-location (paging-enabled).
src/computelimit/azext_computelimit/aaz/latest/computelimit/trusted_host_subscription/_remove.py Implements delete with confirmation support.
src/computelimit/azext_computelimit/aaz/latest/computelimit/trusted_host_subscription/_show.py Implements get/show by location + host subscription id.

Comment on lines +47 to +59
_args_schema.host_subscription_id = AAZStrArg(
options=["-n", "--name", "--host-subscription-id"],
help="The name of the TrustedHostSubscription",
required=True,
id_part="child_name_1",
fmt=AAZStrArgFormat(
pattern="^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$",
),
)
_args_schema.location = AAZResourceLocationArg(
required=True,
id_part="name",
)
Comment on lines +44 to +56
_args_schema.host_subscription_id = AAZStrArg(
options=["-n", "--name", "--host-subscription-id"],
help="The name of the TrustedHostSubscription",
required=True,
id_part="child_name_1",
fmt=AAZStrArgFormat(
pattern="^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$",
),
)
_args_schema.location = AAZResourceLocationArg(
required=True,
id_part="name",
)
Comment on lines +45 to +57
_args_schema.host_subscription_id = AAZStrArg(
options=["-n", "--name", "--host-subscription-id"],
help="The name of the TrustedHostSubscription",
required=True,
id_part="child_name_1",
fmt=AAZStrArgFormat(
pattern="^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$",
),
)
_args_schema.location = AAZResourceLocationArg(
required=True,
id_part="name",
)
Comment on lines +45 to +47
_args_schema.location = AAZResourceLocationArg(
required=True,
)
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

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

@x-engineering-agent

Copy link
Copy Markdown

Automated sensitive-information remediation ran on this pull request.

  • Detected categories: email address
  • Replaced with typed [REDACTED:category] placeholders in: no writable PR fields
  • Could not edit: file changes on a fork branch
  • Comment/review owners notified because Agent Assist cannot edit another user's text: none

If a credential was exposed, rotate or revoke it immediately. Detected values are never copied into this comment.

✅ Keep the redaction · ❌ Dispute the redaction

GitHub only supports a fixed reaction set, so 👍 represents ✅ and 👎 represents ❌. The bot-created reactions are only poll choices.


Posted by agent-assist (autonomous bug-fix pipeline).

@x-engineering-agent

Copy link
Copy Markdown

Live test results — azdev test --live --series (changed test files only)

PASS

Selectors: test_computelimit (extension)
PR head ref: computelimit/trusted-host-subscription
PR head sha: e4931a5455e6e05028b78c84745755f96f8ae62e
PR base ref: main
New test files in PR: false

Changed test files run
src/computelimit/azext_computelimit/tests/latest/test_computelimit.py

Workflow run: https://github.com/Azure/issue-sentinel/actions/runs/32348607182

Last 80 lines of azdev output

=============
| Run Tests |
=============


=====================
| Discovering Tests |
=====================

/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py:13705: SyntaxWarning: invalid escape sequence '\]'
  self.cmd('vmss application set -g {rg} -n {vmss} --app-version-ids {vid1} {vid2} --enable-automatic-upgrade True\]', checks=[
/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/identity/tests/latest/test_identity.py:18: SyntaxWarning: invalid escape sequence '\{'
  'resource_restriction_compute': '\{"providers":\["Microsoft.Compute"\]\}',
/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/identity/tests/latest/test_identity.py:19: SyntaxWarning: invalid escape sequence '\{'
  'resource_restriction_empty': '\{"providers":\[\]\}'

test index updated: /home/runner/.azdev/env_config/home/runner/work/issue-sentinel/issue-sentinel/.venv/test_index/latest.json

Test on modules: test_computelimit

WARNING: RUNNING TESTS LIVE
The tests are set to run against current profile "latest"
============================= test session starts ==============================
platform linux -- Python 3.12.13, pytest-9.1.1, pluggy-1.6.0 -- /home/runner/work/issue-sentinel/issue-sentinel/.venv/bin/python
cachedir: .pytest_cache
rootdir: /home/runner/work/issue-sentinel/issue-sentinel/azure-cli-extensions
configfile: pytest.ini
plugins: forked-1.7.5, xdist-3.8.0
collecting ... collected 22 items

azure-cli-extensions/src/computelimit/azext_computelimit/tests/latest/test_computelimit.py::ComputelimitScenario::test_computelimit_guest_subscription_add SKIPPED [  4%]
azure-cli-extensions/src/computelimit/azext_computelimit/tests/latest/test_computelimit.py::ComputelimitScenario::test_computelimit_guest_subscription_add_invalid_uuid PASSED [  9%]
azure-cli-extensions/src/computelimit/azext_computelimit/tests/latest/test_computelimit.py::ComputelimitScenario::test_computelimit_guest_subscription_add_missing_location PASSED [ 13%]
azure-cli-extensions/src/computelimit/azext_computelimit/tests/latest/test_computelimit.py::ComputelimitScenario::test_computelimit_guest_subscription_crud SKIPPED [ 18%]
azure-cli-extensions/src/computelimit/azext_computelimit/tests/latest/test_computelimit.py::ComputelimitScenario::test_computelimit_guest_subscription_list SKIPPED [ 22%]
azure-cli-extensions/src/computelimit/azext_computelimit/tests/latest/test_computelimit.py::ComputelimitScenario::test_computelimit_guest_subscription_remove SKIPPED [ 27%]
azure-cli-extensions/src/computelimit/azext_computelimit/tests/latest/test_computelimit.py::ComputelimitScenario::test_computelimit_guest_subscription_show SKIPPED [ 31%]
azure-cli-extensions/src/computelimit/azext_computelimit/tests/latest/test_computelimit.py::ComputelimitScenario::test_computelimit_shared_limit_add SKIPPED [ 36%]
azure-cli-extensions/src/computelimit/azext_computelimit/tests/latest/test_computelimit.py::ComputelimitScenario::test_computelimit_shared_limit_add_missing_location PASSED [ 40%]
azure-cli-extensions/src/computelimit/azext_computelimit/tests/latest/test_computelimit.py::ComputelimitScenario::test_computelimit_shared_limit_add_name_special_chars PASSED [ 45%]
azure-cli-extensions/src/computelimit/azext_computelimit/tests/latest/test_computelimit.py::ComputelimitScenario::test_computelimit_shared_limit_add_name_too_short PASSED [ 50%]
azure-cli-extensions/src/computelimit/azext_computelimit/tests/latest/test_computelimit.py::ComputelimitScenario::test_computelimit_shared_limit_crud SKIPPED [ 54%]
azure-cli-extensions/src/computelimit/azext_computelimit/tests/latest/test_computelimit.py::ComputelimitScenario::test_computelimit_shared_limit_list SKIPPED [ 59%]
azure-cli-extensions/src/computelimit/azext_computelimit/tests/latest/test_computelimit.py::ComputelimitScenario::test_computelimit_shared_limit_remove SKIPPED [ 63%]
azure-cli-extensions/src/computelimit/azext_computelimit/tests/latest/test_computelimit.py::ComputelimitScenario::test_computelimit_shared_limit_show SKIPPED [ 68%]
azure-cli-extensions/src/computelimit/azext_computelimit/tests/latest/test_computelimit.py::ComputelimitScenario::test_computelimit_trusted_host_subscription_add SKIPPED [ 72%]
azure-cli-extensions/src/computelimit/azext_computelimit/tests/latest/test_computelimit.py::ComputelimitScenario::test_computelimit_trusted_host_subscription_add_invalid_uuid PASSED [ 77%]
azure-cli-extensions/src/computelimit/azext_computelimit/tests/latest/test_computelimit.py::ComputelimitScenario::test_computelimit_trusted_host_subscription_add_missing_location PASSED [ 81%]
azure-cli-extensions/src/computelimit/azext_computelimit/tests/latest/test_computelimit.py::ComputelimitScenario::test_computelimit_trusted_host_subscription_crud SKIPPED [ 86%]
azure-cli-extensions/src/computelimit/azext_computelimit/tests/latest/test_computelimit.py::ComputelimitScenario::test_computelimit_trusted_host_subscription_list SKIPPED [ 90%]
azure-cli-extensions/src/computelimit/azext_computelimit/tests/latest/test_computelimit.py::ComputelimitScenario::test_computelimit_trusted_host_subscription_remove SKIPPED [ 95%]
azure-cli-extensions/src/computelimit/azext_computelimit/tests/latest/test_computelimit.py::ComputelimitScenario::test_computelimit_trusted_host_subscription_show SKIPPED [100%]

- generated xml file: /home/runner/work/issue-sentinel/issue-sentinel/test-output/results.xml -
======================== 7 passed, 15 skipped in 1.08s =========================

Posted by agent-assist live-test workflow.

@x-engineering-agent x-engineering-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ All checks passed

  • Live test (Tester): passed (dispatched live-test.yml, run completed successfully).
  • CI checks: 28/28 completed checks passed, 0 failed, 0 pending.

This PR looks good from an automated review perspective. Handing back for maintainer merge decision.

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

Labels

X Engineering Agent Reviewed Pull request reviewed by X Engineering Agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants