Skip to content

[confcom] Add test for tar-based policy generation working even when Docker is unavailable#9864

Open
micromaomao wants to merge 2 commits into
Azure:mainfrom
micromaomao:tingmao/add-no-docker-test
Open

[confcom] Add test for tar-based policy generation working even when Docker is unavailable#9864
micromaomao wants to merge 2 commits into
Azure:mainfrom
micromaomao:tingmao/add-no-docker-test

Conversation

@micromaomao
Copy link
Copy Markdown
Member

@micromaomao micromaomao commented May 13, 2026

Adds a unit test covering the regression fixed in #9863: when generating a policy with --tar and the image is present in the tar, Docker must not be required.

Merge after #9863

Agent-Logs-Url: https://github.com/micromaomao/azure-cli-extensions/sessions/f7739453-8606-43aa-b004-ac3d8edef47c
Co-authored-by: micromaomao 6070533+micromaomao@users.noreply.github.com
Signed-off-by: Tingmao Wang tingmaowang@microsoft.com


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.

…Docker is unavailable

Adds a unit test covering the regression fixed in
Azure#9863: when generating a
policy with `--tar` and the image is present in the tar, Docker must not be
required.

Agent-Logs-Url: https://github.com/micromaomao/azure-cli-extensions/sessions/f7739453-8606-43aa-b004-ac3d8edef47c
Co-authored-by: micromaomao <6070533+micromaomao@users.noreply.github.com>
Signed-off-by: Tingmao Wang <tingmaowang@microsoft.com>
Copilot AI review requested due to automatic review settings May 13, 2026 09:21
@azure-client-tools-bot-prd
Copy link
Copy Markdown

Validation for Breaking Change Starting...

Thanks for your contribution!

@azure-client-tools-bot-prd
Copy link
Copy Markdown

Hi @micromaomao,
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
Copy link
Copy Markdown
Collaborator

yonzhan commented May 13, 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

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 May 13, 2026

Hi @micromaomao

Release Suggestions

Module: confcom

  • Update VERSION to 2.0.1 in src/confcom/setup.py

Notes

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

Adds a regression unit test to ensure policy generation using --tar succeeds even if Docker client creation fails (covering the scenario fixed in PR #9863).

Changes:

  • Add a new unittest that patches docker.from_env() to raise DockerException and verifies policy population works when the image is supplied via tar_mapping.
  • Add test-only imports needed for mocking and raising Docker exceptions.

Comment thread src/confcom/azext_confcom/tests/latest/test_confcom_tar.py
@yonzhan yonzhan requested a review from necusjz May 13, 2026 10:35
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.

5 participants