Skip to content

Conversation

@hgarvison
Copy link
Contributor


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 July 14, 2025 20:08
@azure-client-tools-bot-prd
Copy link

Validation for Breaking Change Starting...

Thanks for your contribution!

@github-actions
Copy link

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>

@yonzhan
Copy link
Collaborator

yonzhan commented Jul 14, 2025

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

@hgarvison hgarvison closed this Jul 14, 2025
Copy link
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 package to gracefully handle missing policy fragments in remote images and prepares a new 1.2.7 release.

  • Add a warning branch in oras_proxy.discover to avoid errors when no fragments are found remotely.
  • Bump versions to 1.2.7 (setup.py) and update internal config and history.
  • Enhance case_insensitive_dict_get with a default value parameter and expand test coverage (emptyDir mounts, tarball fragment generation).

Reviewed Changes

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

Show a summary per file
File Description
src/confcom/setup.py Bumped package version to 1.2.7
src/confcom/azext_confcom/data/internal_config.json Updated internal_config.json version to 1.2.6
src/confcom/azext_confcom/oras_proxy.py Handle “not found” stderr with a warning instead of an error
src/confcom/azext_confcom/template_util.py Added default_value parameter to case_insensitive_dict_get
src/confcom/azext_confcom/tests/latest/test_confcom_scenario.py Updated expected image layer digests
src/confcom/azext_confcom/tests/latest/test_confcom_policy_conversion.py Added test for emptyDir volume mounts
src/confcom/azext_confcom/tests/latest/test_confcom_fragment.py Added tarball-based fragment generation test
src/confcom/azext_confcom/tests/latest/README.md Registered new test_tar_file_fragment scenario
src/confcom/HISTORY.rst Added 1.2.7 release notes
Comments suppressed due to low confidence (3)

src/confcom/azext_confcom/template_util.py:47

  • [nitpick] Consider adding or updating the docstring to explain the new 'default_value' parameter and its behavior when the key is not found.
def case_insensitive_dict_get(dictionary, search_key, default_value=None) -> Any:

src/confcom/azext_confcom/oras_proxy.py:82

  • Add a unit test for the code path where a 'not found' error is detected to ensure the warning branch is covered by tests.
        elif "not found" in item.stderr.decode("utf-8"):

src/confcom/azext_confcom/tests/latest/test_confcom_fragment.py:10

  • The 'deepdiff' import appears unused in this test; consider removing it to clean up dependencies.
import deepdiff

logger.warn("Wheel is not available, disabling bdist_wheel hook")

VERSION = "1.2.5"
VERSION = "1.2.7"
Copy link

Copilot AI Jul 14, 2025

Choose a reason for hiding this comment

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

The version in setup.py (1.2.7) is inconsistent with internal_config.json which is at 1.2.6; ensure both are aligned to avoid version mismatches.

Copilot uses AI. Check for mistakes.
@@ -1,5 +1,5 @@
{
"version": "1.2.5",
"version": "1.2.6",
Copy link

Copilot AI Jul 14, 2025

Choose a reason for hiding this comment

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

The internal_config.json version (1.2.6) does not match setup.py (1.2.7); update this to reflect the same version.

Suggested change
"version": "1.2.6",
"version": "1.2.7",

Copilot uses AI. Check for mistakes.
+ "Please log into the registry and try again.\n\n"
)
eprint(f"Error retrieving fragments from remote repo: {item.stderr.decode('utf-8')}", exit_code=item.returncode)
elif "not found" in item.stderr.decode("utf-8"):
Copy link

Copilot AI Jul 14, 2025

Choose a reason for hiding this comment

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

[nitpick] Matching the 'not found' substring in stderr may catch unrelated errors; consider using a more precise check or inspecting the exit code for a 404.

Suggested change
elif "not found" in item.stderr.decode("utf-8"):
elif item.returncode == 404:

Copilot uses AI. Check for mistakes.
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.

3 participants