Skip to content

Add support for mirrors on registries.conf#745

Merged
jonesbusy merged 1 commit into
oras-project:mainfrom
jonesbusy:feature/mirrors
Jun 17, 2026
Merged

Add support for mirrors on registries.conf#745
jonesbusy merged 1 commit into
oras-project:mainfrom
jonesbusy:feature/mirrors

Conversation

@jonesbusy

@jonesbusy jonesbusy commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Description

Add support for mirrors on registries.conf

Related to #603 (partial fix)

Testing done

Added tests

Submitter checklist

  • I have read and understood the CONTRIBUTING guide
  • I have run mvn license:update-file-header, mvn spotless:apply, pre-commit run -a, mvn clean install before opening the PR

@jonesbusy jonesbusy added the enhancement New feature or request label Jun 16, 2026
@jonesbusy jonesbusy force-pushed the feature/mirrors branch 2 times, most recently from 6ee2fba to 002c83a Compare June 16, 2026 11:18
@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.72093% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.86%. Comparing base (df87bc6) to head (88f1305).

Files with missing lines Patch % Lines
src/main/java/land/oras/Registry.java 86.86% 5 Missing and 8 partials ⚠️
src/main/java/land/oras/auth/RegistriesConf.java 71.42% 2 Missing and 6 partials ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 RegistriesConf to parse and expose an ordered list of mirror entries, plus mirror-based ref rewriting.
  • Add mirror fallback logic in Registry for 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.

Comment thread src/main/java/land/oras/Registry.java Outdated
Comment thread src/main/java/land/oras/auth/RegistriesConf.java Outdated
Comment thread src/test/java/land/oras/auth/RegistryConfTest.java
Comment thread src/test/java/land/oras/RegistryMirrorTest.java
Comment thread src/test/java/land/oras/RegistryMirrorTest.java
Comment thread src/test/java/land/oras/RegistryMirrorTest.java
@jonesbusy jonesbusy force-pushed the feature/mirrors branch 2 times, most recently from d3a8cae to d18a746 Compare June 16, 2026 12:55
@jonesbusy jonesbusy requested a review from Copilot June 16, 2026 13:01
@jonesbusy jonesbusy marked this pull request as ready for review June 16, 2026 13:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Comment thread src/main/java/land/oras/auth/RegistriesConf.java Outdated
Comment thread src/main/java/land/oras/Registry.java

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread src/main/java/land/oras/auth/RegistriesConf.java Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Comment thread src/main/java/land/oras/Registry.java Outdated
Comment thread src/main/java/land/oras/auth/RegistriesConf.java
@jonesbusy jonesbusy force-pushed the feature/mirrors branch 4 times, most recently from cd41068 to 063a744 Compare June 16, 2026 19:06
@jonesbusy jonesbusy marked this pull request as draft June 16, 2026 19:06
@jonesbusy jonesbusy requested a review from Copilot June 16, 2026 19:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread src/main/java/land/oras/Registry.java
Comment thread src/main/java/land/oras/auth/RegistriesConf.java Outdated
Comment thread src/main/java/land/oras/ContainerRef.java Outdated
@jonesbusy jonesbusy force-pushed the feature/mirrors branch 5 times, most recently from 4373533 to b4ceab7 Compare June 17, 2026 08:29
Signed-off-by: Valentin Delaye <jonesbusy@users.noreply.github.com>
@jonesbusy jonesbusy marked this pull request as ready for review June 17, 2026 09:09
@jonesbusy jonesbusy merged commit e0611a8 into oras-project:main Jun 17, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants