Skip to content

Conversation

@aniruddhkorde9-dot
Copy link

@aniruddhkorde9-dot aniruddhkorde9-dot commented Jan 22, 2026

Description

Currently, CopyUtils.copy() uses a simple boolean recursive flag. This limits the ability to extend copy behavior in the future (e.g., setting depth, filtering referrers).

This PR refactors the boolean into a CopyOptions class.

  • It introduces CopyOptions with a recursive field.
  • It updates CopyUtils to use this new options object.
  • It maintains backward compatibility by keeping the original copy(..., boolean recursive) method as a wrapper.

Related Issue

This addresses the need for more granular control over copy operations, similar to the Go SDK's ExtendedCopyOptions.

Testing done

  • Verified that the code compiles.
  • Verified that existing tests pass (backward compatibility maintained).

Submitter checklist

  • I have read and understood the CONTRIBUTING guide.
  • I have run mvn spotless:apply

Signed-off-by: Aniruddh Laxman Korde <aniruddhkorde9@gmail.com>
@jonesbusy
Copy link
Collaborator

Please restore the PR template. Why remove it?

What is the file C/oci-layout. It's not used anywhere

For me it looks like an AI generated PR

@jonesbusy jonesbusy closed this Jan 22, 2026
@aniruddhkorde9-dot
Copy link
Author

"Hi @jonesbusy, thank you for the feedback.

Template: I have restored the PR template structure in the description. Apologies for deleting it.

File: The C/oci-layout file was an accidental creation while I was learning the build commands on Windows. I have deleted it in the latest commit.

AI: I am a new contributor (student) learning the process. I used AI to help me understand the contribution steps, but I am manually implementing the changes and learning from my mistakes.

I hope this fixes the issues. Could you please review again?"

@jonesbusy
Copy link
Collaborator

Sure, feel free to reopen the PR with correct template and ensure build is passing. If you run the commands from the contributing guide it will ensure to fix precommit, add missing license headers etc....

We also use Java 17 for the SDK, so perhaps the class can be converted to a record? And maybe some builder method on it?

The SDK is also in alpha phase, so I'm fine to have some breaking change on public APis

@aniruddhkorde9-dot
Copy link
Author

Hi @jonesbusy, I have updated the code as requested:

Converted CopyOptions to a Java 17 record.

Added the Builder pattern.

Ran mvn spotless:apply to ensure correct formatting.

GitHub does not allow me to reopen the PR since it was closed by a maintainer. Could you please reopen it for me? Thanks!

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.

2 participants