-
Notifications
You must be signed in to change notification settings - Fork 1.5k
ensure that oras discover doesn't error when the remote image doesn't exist #8965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Validation for Breaking Change Starting...
Thanks for your contribution! |
|
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). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
There was a problem hiding this 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.discoverto 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_getwith 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" |
Copilot
AI
Jul 14, 2025
There was a problem hiding this comment.
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.
| @@ -1,5 +1,5 @@ | |||
| { | |||
| "version": "1.2.5", | |||
| "version": "1.2.6", | |||
Copilot
AI
Jul 14, 2025
There was a problem hiding this comment.
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.
| "version": "1.2.6", | |
| "version": "1.2.7", |
| + "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"): |
Copilot
AI
Jul 14, 2025
There was a problem hiding this comment.
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.
| elif "not found" in item.stderr.decode("utf-8"): | |
| elif item.returncode == 404: |
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install wheel==0.30.0required)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.jsonautomatically.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.