lakeFS icon indicating copy to clipboard operation
lakeFS copied to clipboard

API: Support copy object between repositories

Open N-o-Z opened this issue 1 year ago • 2 comments

Currently our API support copying objects only in the context of a single repository.

/repositories/{repository}/branches/{branch}/objects/copy

Body:
{
  "src_path": "string",
  "src_ref": "string",
  "force": false
}

Historically this limitation was set because we were preforming a shallow copy. After the changes for GC, copy operation always performs a full copy and therefore this is not longer a limitation. Catalog already supports copy between repositories as well as the Gateway.

Suggestion

Support an optional parameter src_repo in the request body. If the parameter doesn't exist we will fallback to the destination repository.

Backwards compatibility

Since the src_repo is optional, it will not break our current API guarantees and will maintain backward compatibility

N-o-Z avatar Feb 08 '24 05:02 N-o-Z

Note that clients such as #7447 probably do not even need an API to do this. But these comments are even more relevant here: behaviour may be unexpected in painful ways.

arielshaqed avatar Feb 08 '24 06:02 arielshaqed

Note that clients such as #7447 probably do not even need an API to do this. But these comments are even more relevant here: behaviour may be unexpected in painful ways.

@arielshaqed Can you please elaborate on the pain points? We no longer support shallow copy in lakeFS The requested feature is to allow deep copy between repositories via the API - not to reintroduce shallow copy

N-o-Z avatar Feb 08 '24 07:02 N-o-Z