Skip to content

Conversation

wangxiaoxuan273
Copy link
Contributor

@wangxiaoxuan273 wangxiaoxuan273 commented Jun 27, 2025

What this PR does / why we need it:

This PR implements the new feature of showing repo tags with --oci-layout-path in repo tags command. This feature applies to the scenario where the user stores images from multiple repositories in the same OCI layout directory, and put the full references of the images as tags. For example, an OCI layout may contain the following tags:

example.registry.com/foo:latest
test.com/bar:v1
v2

In this case, given the command oras repo tags --oci-layout-path layout-dir test.com/bar, the output would be

v1

as v1 is the tag under the repository test.com/bar.

oras repo tags command now has three functionalities (list tags, list associated tags and showing repo tags) and they are implemented in the code in a mixed way. I think it would be better if we can refactor the code.

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 #1612

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?
  • Does this introduce breaking changes that would require an announcement or bumping the major version?
  • Do all new files have an appropriate license header?

Signed-off-by: Xiaoxuan Wang <xiaoxuanwang@microsoft.com>
Copy link

codecov bot commented Jun 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.46%. Comparing base (feb9020) to head (fbbba33).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1759      +/-   ##
==========================================
+ Coverage   85.39%   85.46%   +0.07%     
==========================================
  Files         137      137              
  Lines        5950     5966      +16     
==========================================
+ Hits         5081     5099      +18     
+ Misses        618      616       -2     
  Partials      251      251              

☔ View full report in Codecov by Sentry.
📢 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.

Xiaoxuan Wang added 10 commits June 27, 2025 17:33
Signed-off-by: Xiaoxuan Wang <xiaoxuanwang@microsoft.com>
Signed-off-by: Xiaoxuan Wang <xiaoxuanwang@microsoft.com>
Signed-off-by: Xiaoxuan Wang <xiaoxuanwang@microsoft.com>
Signed-off-by: Xiaoxuan Wang <xiaoxuanwang@microsoft.com>
Signed-off-by: Xiaoxuan Wang <xiaoxuanwang@microsoft.com>
Signed-off-by: Xiaoxuan Wang <xiaoxuanwang@microsoft.com>
Signed-off-by: Xiaoxuan Wang <xiaoxuanwang@microsoft.com>
Signed-off-by: Xiaoxuan Wang <xiaoxuanwang@microsoft.com>
Signed-off-by: Xiaoxuan Wang <xiaoxuanwang@microsoft.com>
@wangxiaoxuan273 wangxiaoxuan273 marked this pull request as ready for review June 30, 2025 02:22
Signed-off-by: Xiaoxuan Wang <xiaoxuanwang@microsoft.com>
Signed-off-by: Xiaoxuan Wang <xiaoxuanwang@microsoft.com>
@Wwwsylvia Wwwsylvia requested a review from Copilot July 1, 2025 08:42
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds and refactors the functionality for showing repository tags using the new   --oci-layout-path  flag in the oras repo tags command.

  • Added e2e tests for validating tags filtering in OCI layout.
  • Updated the tag filtering logic in the repo tags command to support repository-scoped filtering.
  • Extended the help message to demonstrate the new OCI layout usage.

Reviewed Changes

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

File Description
test/e2e/suite/command/repo.go Added new test cases to verify correct tag filtering.
cmd/oras/root/repo/tags.go Updated tag filtering logic to enable OCI layout support.

Signed-off-by: Xiaoxuan Wang <xiaoxuanwang@microsoft.com>
@wangxiaoxuan273
Copy link
Contributor Author

Need to consider the case that --exclude-digest-tags is used together with --oci-layout-path. We need to add an extra E2E test case.

Xiaoxuan Wang added 2 commits July 1, 2025 19:18
Signed-off-by: Xiaoxuan Wang <xiaoxuanwang@microsoft.com>
Signed-off-by: Xiaoxuan Wang <xiaoxuanwang@microsoft.com>
Copy link
Member

@Wwwsylvia Wwwsylvia left a comment

Choose a reason for hiding this comment

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

Overall LGTM

Xiaoxuan Wang added 3 commits July 10, 2025 14:38
Copy link
Member

@Wwwsylvia Wwwsylvia left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

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

LGTM with suggestions

Signed-off-by: Xiaoxuan Wang <xiaoxuanwang@microsoft.com>
Copy link
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

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

LGTM

@shizhMSFT shizhMSFT force-pushed the oci-layout-path-repo branch from c1d6eb3 to 2b8c9b9 Compare July 11, 2025 07:04
Copy link
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

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

LGTM

@shizhMSFT shizhMSFT merged commit 90b42bd into oras-project:main Jul 11, 2025
8 checks passed
@wangxiaoxuan273 wangxiaoxuan273 deleted the oci-layout-path-repo branch August 25, 2025 02:59
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.

Bad UX of --oci-layout-path flag working with oras repo tags
4 participants