Skip to content

feat: support OCI index with duplicate filenames by deduplicatin… #632

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

asmit27rai
Copy link

This PR resolves #363 by allowing an OCI artifact index containing multiple blobs with the same filename (e.g. main.k) to be pulled without collisions. Previously, the pull would overwrite earlier files, making some packages inaccessible.

Fixes: #363

…g pulled files

- Add \dedupePulledFiles\ helper in oci/oci.go to rename colliding files in a pull directory
- Invoke \DedupePulledFiles\ after each OCI pull in downloader/downloader.go
- Ensures multiple KCL packages with the same basename (e.g. main.k) do not overwrite one another

Signed-off-by: asmit27rai <[email protected]>
@asmit27rai
Copy link
Author

@zong-zhe Pls review this PR

@coveralls
Copy link

Pull Request Test Coverage Report for Build 14845947371

Details

  • 36 of 71 (50.7%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.001%) to 42.091%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/oci/oci.go 14 29 48.28%
pkg/downloader/downloader.go 22 42 52.38%
Totals Coverage Status
Change from base Build 14753513939: 0.001%
Covered Lines: 4212
Relevant Lines: 10007

💛 - Coveralls

Copy link
Contributor

@liangyuanpeng liangyuanpeng left a comment

Choose a reason for hiding this comment

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

Add some tests can enhance the confidence in the merged PR

@zong-zhe
Copy link
Contributor

Hi @asmit27rai 😄

Is this pr still going on? If you want to merge this PR, it needs more test cases

@zong-zhe zong-zhe changed the title feat(oci): support OCI index with duplicate filenames by deduplicatin… feat: support OCI index with duplicate filenames by deduplicatin… May 22, 2025
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.

enhancement: An OCI artifact containing multiple KCL packages with the same file name cannot be added as a dependency
4 participants