refactor: deprecate table format#1656
Merged
Merged
Conversation
Signed-off-by: Xiaoxuan Wang <xiaoxuanwang@microsoft.com>
Signed-off-by: Xiaoxuan Wang <xiaoxuanwang@microsoft.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
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))
shizhMSFT
requested changes
Mar 14, 2025
TerryHowe
reviewed
Mar 14, 2025
Signed-off-by: Xiaoxuan Wang <xiaoxuanwang@microsoft.com>
6 tasks
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Deprecate table format, which is only used in
oras discover.When using

tablewithoras discovercommand:oras discover -h: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: