Skip to content
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

feat: support --format in oras discover #1299

Merged
merged 25 commits into from
Apr 11, 2024

Conversation

qweeah
Copy link
Contributor

@qweeah qweeah commented Mar 20, 2024

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

  1. Added a new --format flag following spec doc(spec): formatted ORAS CLI output #1199
  2. Changes tree as default output of oras discover

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

Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Copy link

codecov bot commented Mar 20, 2024

Codecov Report

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

Project coverage is 84.34%. Comparing base (b5217ef) to head (46fd349).

Files Patch % Lines
...d/oras/internal/display/metadata/table/discover.go 78.94% 4 Missing and 4 partials ⚠️
cmd/oras/root/discover.go 74.19% 3 Missing and 5 partials ⚠️
...md/oras/internal/display/metadata/tree/discover.go 85.18% 2 Missing and 2 partials ⚠️
...md/oras/internal/display/metadata/json/discover.go 85.71% 1 Missing and 1 partial ⚠️
...ras/internal/display/metadata/template/discover.go 86.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1299      +/-   ##
==========================================
- Coverage   84.40%   84.34%   -0.07%     
==========================================
  Files          97      101       +4     
  Lines        3540     3615      +75     
==========================================
+ Hits         2988     3049      +61     
- Misses        329      337       +8     
- Partials      223      229       +6     

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

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

cmd/oras/internal/display/metadata/model/discover.go Outdated Show resolved Hide resolved
Signed-off-by: Billy Zha <jinzha1@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

@qweeah qweeah merged commit cc9b2b6 into oras-project:main Apr 11, 2024
8 checks passed
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.

Oras commands like attach, discover, and pull support an option to format output as JSON
2 participants