Skip to content

feat(backup): accept multiple repositories in one backup - #2428

Open
Orion777-cmd wants to merge 1 commit into
oras-project:mainfrom
Orion777-cmd:feat/backup-multiple-repositories
Open

Orion777-cmd wants to merge 1 commit into
oras-project:mainfrom
Orion777-cmd:feat/backup-multiple-repositories

Conversation

@Orion777-cmd

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:
oras backup now accepts one or more <registry>/<repository>[:<tags>] references and backs them all up into one OCI layout, as described in #2358. Blobs shared between repositories are stored once, and one tar archive is exported.

  • References to the same repository are merged into one tag list; no tags still means every tag.
  • The tags of every repository are resolved before anything is backed up, so a repository without tags fails early.
  • With several repositories, the output lists the tags by repository and reports full references, as in the proposal. Backing up a single repository is unchanged.
  • References to more than one registry are rejected until [Draft] feat(backup,restore)!: remove global registry flags #2380 removes the global registry flags.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #2422

Please check the following list:

  • Does the affected code have corresponding tests, e.g. unit test, E2E test?
  • Does this change require a documentation update? (help text and example updated)
  • Does this introduce breaking changes that would require an announcement or bumping the major version?
  • Do all new files have an appropriate license header? (no new files)

Accept one or more repository references and back them all up into one
OCI layout, so blobs shared between repositories are stored once and one
tar archive is exported. References to the same repository are merged
into one tag list, where no tags means every tag.

The tags of every repository are resolved before anything is backed up.
With several repositories, the output lists the tags by repository and
reports full references. Backing up a single repository is unchanged.

References to more than one registry are rejected until the global
registry flags are removed.

Fixes oras-project#2422

Signed-off-by: orion777-cmd <[email protected]>
@codecov

codecov Bot commented Nov 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.55172% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.71%. Comparing base (27987f6) to head (ca0d06a).

Files with missing lines Patch % Lines
cmd/oras/internal/display/metadata/text/backup.go 85.18% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2428      +/-   ##
==========================================
+ Coverage   90.58%   90.71%   +0.13%     
==========================================
  Files         163      163              
  Lines        8272     8349      +77     
==========================================
+ Hits         7493     7574      +81     
+ Misses        454      452       -2     
+ Partials      325      323       -2     

☔ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(backup): accept multiple repositories in one backup

1 participant