Skip to content

Conversation

@Wwwsylvia
Copy link
Member

@Wwwsylvia Wwwsylvia commented Jun 23, 2025

What this PR does / why we need it:
Introduces a new --format flag to the oras repo tags command, with 3 format options: text, json, and go-template.

Notes: This PR was implemented using GitHub Copilot with the Claude 3.7 model, with some manual adjustments. The prompt used was:

#codebase Enable --format json for oras repo tags command. Similar to oras discover --format json. You can define metadata handlers for the output. You need to take a closer look into the structure of cmd/oras/internal/display and understand the code structure of the existing commands.

Usage:
oras repo tags myregistry.com/myrepo --format json

{
"tags": ["foo", "bar"]
}

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 part of #1547

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?

@codecov
Copy link

codecov bot commented Jun 23, 2025

Codecov Report

Attention: Patch coverage is 84.28571% with 11 lines in your changes missing coverage. Please review.

Project coverage is 85.32%. Comparing base (e201208) to head (9fbb921).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/oras/root/repo/tags.go 59.09% 6 Missing and 3 partials ⚠️
cmd/oras/internal/display/handler.go 83.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1756      +/-   ##
==========================================
+ Coverage   85.17%   85.32%   +0.15%     
==========================================
  Files         129      133       +4     
  Lines        5815     5882      +67     
==========================================
+ Hits         4953     5019      +66     
+ Misses        615      614       -1     
- Partials      247      249       +2     

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

Wwwsylvia added 16 commits June 25, 2025 15:57
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
@Wwwsylvia Wwwsylvia marked this pull request as ready for review June 25, 2025 07:59
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

Copy link
Contributor

@wangxiaoxuan273 wangxiaoxuan273 left a comment

Choose a reason for hiding this comment

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

LGTM

@Wwwsylvia Wwwsylvia merged commit cb3bbe3 into oras-project:main Jun 26, 2025
8 checks passed
@Wwwsylvia Wwwsylvia deleted the json_format branch June 26, 2025 04:09
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.

3 participants