Skip to content

feat: support --format for oras pull#1293

Merged
qweeah merged 58 commits into
oras-project:mainfrom
qweeah:format-pull
Apr 7, 2024
Merged

feat: support --format for oras pull#1293
qweeah merged 58 commits into
oras-project:mainfrom
qweeah:format-pull

Conversation

@qweeah

@qweeah qweeah commented Mar 18, 2024

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:
This PR

  1. Adds support for --format [json|<go_template>] for pull command according to doc(spec): formatted ORAS CLI output #1199
  2. Refactor status/metadata output

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Related to #638

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?

qweeah added 5 commits March 13, 2024 09:09
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
@codecov

codecov Bot commented Mar 18, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 84.61538% with 28 lines in your changes are missing coverage. Please review.

Project coverage is 83.96%. Comparing base (c7ecf5c) to head (1e11eb4).

Files Patch % Lines
cmd/oras/root/pull.go 65.51% 4 Missing and 6 partials ⚠️
cmd/oras/internal/display/metadata/model/pull.go 75.75% 5 Missing and 3 partials ⚠️
cmd/oras/internal/display/status/tty.go 77.27% 5 Missing ⚠️
cmd/oras/internal/display/handler.go 82.35% 1 Missing and 2 partials ⚠️
cmd/oras/internal/display/utils/utils.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1293      +/-   ##
==========================================
+ Coverage   83.78%   83.96%   +0.17%     
==========================================
  Files          84       90       +6     
  Lines        3343     3448     +105     
==========================================
+ Hits         2801     2895      +94     
- Misses        322      331       +9     
- Partials      220      222       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

qweeah added 5 commits March 18, 2024 02:33
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
@qweeah qweeah marked this pull request as ready for review March 18, 2024 04:26
Comment thread cmd/oras/internal/display/metadata/interface.go Outdated
Comment thread cmd/oras/internal/display/metadata/model/pull.go Outdated
Comment thread cmd/oras/internal/display/metadata/model/pull.go Outdated
Comment thread cmd/oras/internal/display/metadata/model/pull.go Outdated
Comment thread cmd/oras/root/pull.go
Comment thread cmd/oras/internal/display/status/interface.go Outdated
Comment thread cmd/oras/internal/display/status/interface.go Outdated
Comment thread cmd/oras/internal/display/metadata/interface.go Outdated
qweeah added 10 commits March 25, 2024 06:38
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
qweeah added 16 commits April 2, 2024 17:56
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Comment thread cmd/oras/internal/display/metadata/json/pull.go Outdated
Comment thread cmd/oras/internal/display/metadata/template/pull.go Outdated
Comment thread cmd/oras/internal/display/status/utils.go
qweeah added 9 commits April 7, 2024 06:50
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>

@shizhMSFT shizhMSFT left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@qweeah qweeah merged commit 4d808ac into oras-project:main Apr 7, 2024
FeynmanZhou pushed a commit to FeynmanZhou/oras that referenced this pull request May 11, 2024
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
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