Add support for mirrors on registries.conf#745
Merged
Conversation
6ee2fba to
002c83a
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #745 +/- ##
============================================
+ Coverage 87.22% 87.86% +0.63%
- Complexity 1015 1081 +66
============================================
Files 45 45
Lines 3225 3345 +120
Branches 409 447 +38
============================================
+ Hits 2813 2939 +126
+ Misses 244 234 -10
- Partials 168 172 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds [[registry.mirror]] support to registries.conf so the SDK can try configured mirror registries (in order) before falling back to the original registry when pulling artifacts / fetching manifests & blobs.
Changes:
- Extend
RegistriesConfto parse and expose an ordered list of mirror entries, plus mirror-based ref rewriting. - Add mirror fallback logic in
Registryfor manifest/blob retrieval and artifact pulling. - Add unit tests for TOML mirror parsing/ref rewriting and a new Testcontainers-based integration test validating mirror failover behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
src/main/java/land/oras/Registry.java |
Introduces mirror fallback wrapper and routes key pull/blob/manifest operations through it. |
src/main/java/land/oras/auth/RegistriesConf.java |
Adds mirror config model + APIs to fetch mirrors and rewrite refs for a mirror. |
src/test/java/land/oras/auth/RegistryConfTest.java |
Updates tests for new RegistryConfig signature and adds mirror parsing/rewriting tests. |
src/test/java/land/oras/RegistryMirrorTest.java |
New integration test validating mirror ordering and fallback behavior via Docker/Testcontainers. |
src/test/java/land/oras/ClassAnnotationsTest.java |
Updates expected annotated-model counts to account for the new mirror model. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d3a8cae to
d18a746
Compare
d18a746 to
81938b5
Compare
81938b5 to
2d98253
Compare
cd41068 to
063a744
Compare
063a744 to
3a95460
Compare
4373533 to
b4ceab7
Compare
Signed-off-by: Valentin Delaye <jonesbusy@users.noreply.github.com>
b4ceab7 to
88f1305
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add support for
mirrorsonregistries.confRelated to #603 (partial fix)
Testing done
Added tests
Submitter checklist
mvn license:update-file-header,mvn spotless:apply,pre-commit run -a,mvn clean installbefore opening the PR