Skip to content

Managed Network Fabric CLI- Fix output formatting for resync-password and rotate-certificate commands#9755

Open
nafizhaider32 wants to merge 5 commits intoAzure:mainfrom
nafizhaider32:main
Open

Managed Network Fabric CLI- Fix output formatting for resync-password and rotate-certificate commands#9755
nafizhaider32 wants to merge 5 commits intoAzure:mainfrom
nafizhaider32:main

Conversation

@nafizhaider32
Copy link
Copy Markdown
Contributor

@nafizhaider32 nafizhaider32 commented Apr 2, 2026


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 wheel==0.30.0 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.

Copilot AI review requested due to automatic review settings April 2, 2026 20:42
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Apr 2, 2026

️✔️Azure CLI Extensions Breaking Change Test
️✔️Non Breaking Changes

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Apr 2, 2026

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

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).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

CodeGen Tools Feedback Collection

Thank 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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Copilot AI left a 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 updates the managednetworkfabric Azure CLI extension to improve user-facing output for the networkfabric {fabric|device} resync-password and networkfabric fabric rotate-certificate commands by removing duplicated nested error details and improving LRO error message formatting.

Changes:

  • Bump extension version to 9.1.1 and add release notes.
  • Add an ErrorFormat helper to (a) strip nested details from successful/partial-success responses and (b) format HttpResponseError detail blocks with readable separators.
  • Override the three affected commands with custom subclasses and add unit tests for the new behavior.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/managednetworkfabric/setup.py Bumps extension version to 9.1.1.
src/managednetworkfabric/HISTORY.rst Adds 9.1.1 release notes describing the formatting fix.
src/managednetworkfabric/azext_managednetworkfabric/operations/error_format.py Introduces shared output/error-message formatting helper.
src/managednetworkfabric/azext_managednetworkfabric/custom/device_resync_password.py Custom command override to apply new formatting.
src/managednetworkfabric/azext_managednetworkfabric/custom/fabric_resync_password.py Custom command override to apply new formatting.
src/managednetworkfabric/azext_managednetworkfabric/custom/fabric_rotate_certificate.py Custom command override to apply new formatting.
src/managednetworkfabric/azext_managednetworkfabric/commands.py Registers the custom command classes to override generated AAZ commands.
src/managednetworkfabric/azext_managednetworkfabric/tests/unit/test_error_format.py Adds unit tests for ErrorFormat output/message behavior.
src/managednetworkfabric/azext_managednetworkfabric/tests/unit/test_custom_commands.py Adds unit tests for the custom command overrides.
src/managednetworkfabric/azext_managednetworkfabric/custom/init.py Introduces a custom package (currently conflicting with existing custom.py).
src/managednetworkfabric/azext_managednetworkfabric/tests/unit/init.py Adds unit test package marker.

nafizhaider32 and others added 2 commits April 2, 2026 16:16
…, remove unused import

- Add no_wait check in _handler for device_resync_password, fabric_resync_password,
  and fabric_rotate_certificate to return poller directly when --no-wait is set
- Add backward-compatible loading of legacy custom.py in custom/__init__.py
  to prevent module/package name collision
- Remove unused MagicMock import from test_custom_commands.py
- Add test_handler_returns_poller_on_no_wait test for all three command classes
- Mock ctx.args.no_wait in existing tests that call _handler

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add pylint disable=no-name-in-module to custom submodule imports in
commands.py. The errors are false positives caused by the custom.py /
custom/ package name collision that confuses pylint's module resolution.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.

@nafizhaider32 nafizhaider32 marked this pull request as draft April 3, 2026 15:22
@nafizhaider32 nafizhaider32 marked this pull request as ready for review April 3, 2026 20:02
@nafizhaider32 nafizhaider32 requested a review from Copilot April 3, 2026 20:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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

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

Labels

Auto-Assign Auto assign by bot Network

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants