feat(RELEASE-1989): skopeo helper client#812
Conversation
Review Summary by Qodo(Agentic_describe updated until commit ccaf73b)Implement skopeo client with fake testing support
WalkthroughsDescription• Implement SkopeoClient wrapper for container image operations - Supports inspect and copy operations with full parameter coverage - Handles credentials via Secret objects and TLS verification • Create FakeSkopeoClient for testing with YAML-based mock configuration - Loads mock responses from environment variable config file - Supports exact matching and regex patterns for flexible test scenarios - Validates configuration at load time with detailed error messages • Provide comprehensive test coverage for both real and fake implementations - 684 lines of tests for SkopeoClient covering all operations and edge cases - 763 lines of tests for FakeSkopeoClient covering validation and matching logic • Include documentation and example configuration for mock setup Diagramflowchart LR
A["SkopeoClient"] -->|wraps| B["skopeo CLI"]
A -->|executes| C["subprocess.run"]
C -->|returns| D["SkopeoClientError or result"]
E["FakeSkopeoClient"] -->|loads config from| F["YAML file"]
F -->|defines rules| G["inspect/copy operations"]
G -->|matches against| H["actual parameters"]
H -->|returns mock| I["response or error"]
J["patch_skopeo_client"] -->|monkey-patches| A
J -->|replaces with| E
File Changes1. scripts/python/helpers/skopeo.py
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
25 rules 1. Optional annotations in SkopeoClient
|
Code Review by Qodo
1.
|
ccaf73b to
6b9cbc6
Compare
There was a problem hiding this comment.
Pull request overview
Adds a Python SkopeoClient helper (inspect/copy) plus a YAML-configurable FakeSkopeoClient for tests, aligning with the repo’s pattern of small CLI wrappers under scripts/python/helpers/.
Changes:
- Introduces
SkopeoClientandSkopeoClientErrorwrappingskopeo inspect/skopeo copy. - Adds
FakeSkopeoClientwith rule-based matching fromRELEASE_SERVICE_UTILS_FAKE_SKOPEO_SETUPand apatch_skopeo_client()helper for injection. - Adds unit tests and documentation/examples for both implementations.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/python/helpers/skopeo.py | New real skopeo CLI wrapper client + error type |
| scripts/python/helpers/test_skopeo.py | Unit tests for SkopeoClient |
| scripts/python/helpers/fake/skopeo.py | New YAML-driven fake client for testing |
| scripts/python/helpers/fake/test_fake_skopeo.py | Unit tests for FakeSkopeoClient |
| scripts/python/helpers/fake/init.py | Exposes FakeSkopeoClient and monkey-patch helper |
| scripts/python/helpers/fake/SKOPEO.md | Design/usage summary documentation |
| scripts/python/helpers/fake/example_config.yaml | Example YAML config for fake behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6b9cbc6 to
adb3064
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #812 +/- ##
==========================================
- Coverage 95.65% 95.59% -0.07%
==========================================
Files 72 75 +3
Lines 7111 7395 +284
==========================================
+ Hits 6802 7069 +267
- Misses 309 326 +17
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
adb3064 to
f27e288
Compare
| from typing import Any, Optional | ||
| from logging import Logger | ||
|
|
||
| from rsmodels.secret import Secret |
There was a problem hiding this comment.
IMHO this secret module could be at the same level as skopeo. It seems it can be reused in many other places. One example is the git authentication, which also relies on adding the token to github URL. That could be useful, for instance: secret.skopeo or secret.git to prevent leaking these tokens/passowords.
There was a problem hiding this comment.
What prevents devs to import it from rsmodels? Secret doesn't have any functionality so it should belong to models
f27e288 to
333ac65
Compare
CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
a0cc008 to
70f3059
Compare
70f3059 to
b9ef77c
Compare
|
/retest |
1 similar comment
|
/retest |
b9ef77c to
e1e5fc9
Compare
|
/retest |
2 similar comments
|
/retest |
|
/retest |
This commit implements skopeo client supporting copy and inspect operations. Also it provides fake skopeo client which can be injected instead of real skopeo client during tests Assiste-By: claude Signed-off-by: Jindrich Luza <jluza@redhat.com>
e1e5fc9 to
6930a6d
Compare
|
/retest |
This commit implements skopeo client supporting copy and inspect operations. Also it provides fake skopeo client which can be injected instead of real skopeo client during tests