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

refactor: deprecate table format #1656

Merged
merged 4 commits into from
Mar 18, 2025

Conversation

wangxiaoxuan273
Copy link
Contributor

@wangxiaoxuan273 wangxiaoxuan273 commented Mar 13, 2025

What this PR does / why we need it:

Deprecate table format, which is only used in oras discover.

When using table with oras discover command:
image

oras discover -h:
image

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 #

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 <[email protected]>
Signed-off-by: Xiaoxuan Wang <[email protected]>
Copy link

codecov bot commented Mar 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.40%. Comparing base (dfd8b1e) to head (235a805).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1656      +/-   ##
==========================================
- Coverage   84.42%   84.40%   -0.03%     
==========================================
  Files         125      125              
  Lines        5663     5667       +4     
==========================================
+ Hits         4781     4783       +2     
- Misses        627      629       +2     
  Partials      255      255              

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

@shizhMSFT shizhMSFT requested a review from Copilot March 13, 2025 10:08

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 deprecates the table format used in the oras discover command by issuing a deprecation warning and updating related tests.

  • Deprecates table format with a new deprecation message printed via the command's stderr.
  • Updates the usage string for table format and adjusts tests to verify the deprecation message.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
cmd/oras/internal/option/format.go Deprecation warning added for table format in flag parsing and usage string updated.
test/e2e/suite/command/discover.go Test cases modified to reflect the new default and to verify deprecation messaging for table format.
Comments suppressed due to low confidence (2)

cmd/oras/internal/option/format.go:104

  • [nitpick] Ensure the deprecation warning message printed here matches the deprecation notice in the usage string for FormatTypeTable for consistency. For example, you might adjust the text so both messages use similar wording regarding the future removal.
if opts.FormatFlag == "table" {

test/e2e/suite/command/discover.go:212

  • The test expectation has been updated to check for the deprecation message, which now correctly flags the use of table format. Confirm that 'feature.Deprecated.Mark' is consistently defined to match the actual deprecation message printed.
Expect(err).To(gbytes.Say(feature.Deprecated.Mark))
Signed-off-by: Xiaoxuan Wang <[email protected]>
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

Copy link
Member

@TerryHowe TerryHowe left a comment

Choose a reason for hiding this comment

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

/lgtm

@TerryHowe TerryHowe merged commit 4a8f5e5 into oras-project:main Mar 18, 2025
5 checks passed
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.

4 participants