Refactor how OCIRegistry and ImageHandler are used (CRAFT-53)
Metadata
Current evaluation
Merged refactoring OCIRegistry and ImageHandler to simplify signatures, streamline credential storage, and update URL handling. Upload command passes the registry directly. Added missing test for username-only authentication.
Suggested action: —
No scores available.
Issue body
This is to align the classes' signatures for the big refactor ahead.
Specifically, in OCIRegistry:
- receive just the image name (whatever it could be) and not the two "orga" and "name" parameters which were too specific for image names with only two "tokens"
- also receive username and password, and store the ready-to-use encoded credentials
- changed slightly a couple of url-massaging functions to reflect the fact that the server has now the schema in it (not faking it anymore, more robust)
And in ImageHandler:
- receive now just the registry and use it
- it will hold only one registry now, so now need for the "dst_" prefix
Also in the upload-command command, changed from passing the components to just pass the registry itself.
Note I minimized the changes in the tests; some of those may be simplified further, but they will disappear in the refactor, so no need for the noise now.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged refactoring OCIRegistry and ImageHandler to simplify signatures, streamline credential storage, and update URL handling. Upload command passes the registry directly. Added missing test for username-only authentication. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Refactored OCIRegistry and ImageHandler to simplify parameters, store encoded credentials, and update URL handling. Updated the upload command to pass registry instances directly. Added a missing test for username-only authentication. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged a refactor aligning OCIRegistry and ImageHandler signatures to accept a single image name, encoded credentials, and a registry object. Updated the upload command and added a missing test for username-only authentication. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #366 More OCIRegistry functionality: check if blob already uploaded, and upload manifests (CRAFT-232) | charmcraft | merged | Added OCIRegistry functionality to verify existing blobs and upload manifests (CRAFT-232). Merged after approval by two reviewers. Changes include 64 additions and 3 deletions across two files. | |
| #370 Added the blob upload functionality to OCIRegistry (CRAFT-234) | charmcraft | merged | Blob upload functionality added to OCIRegistry, resolving CRAFT-234. Merged after approval from two reviewers, modifying two files with a +376/-3 line change. | |
| #871 Support both image id and digest when uploading oci-image resources (CRAFT-1324). | charmcraft | merged | Merged implementation supporting both image ID and digest for OCI image uploads. ID usage bypasses remote registry checks for faster processing, while improved messaging handles missing images gracefully. Resolves #853. |