-
Notifications
You must be signed in to change notification settings - Fork 201
chore(ux): improve copy error message #1773
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
Conversation
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
2ce7602
to
fc78ff8
Compare
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>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1773 +/- ##
==========================================
+ Coverage 85.43% 85.54% +0.11%
==========================================
Files 137 137
Lines 5966 5993 +27
==========================================
+ Hits 5097 5127 +30
+ Misses 618 615 -3
Partials 251 251 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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>
3e8f0f1
to
028e13b
Compare
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
This reverts commit bbd116c. Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
This reverts commit df2dd33. Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with minor suggestions
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
There was a problem hiding this comment.
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 improves error messages across multiple ORAS commands to provide clearer and more user-friendly feedback. The changes focus on optimizing error message formatting for oras cp
, registry error responses, and path traversal errors.
Key changes include:
- Improved error message prefixes for copy operations to specify source/destination registry context
- Removed the "recognizable error message not found:" prefix from registry error responses
- Enhanced path traversal error messages with clearer user guidance
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
cmd/oras/internal/errors/errors.go | Replaces TrimErrResp with ReportErrResp and adds UnwrapCopyError function |
cmd/oras/internal/option/target.go | Updates error handling method from Modify to ModifyError with improved logic |
cmd/oras/internal/option/remote.go | Updates method name and uses new ReportErrResp function |
cmd/oras/internal/option/binary_target.go | Adds comprehensive copy error handling with specific prefixes |
cmd/oras/root/pull.go | Enhances path traversal error with user-friendly recommendation |
cmd/oras/root/push.go | Unwraps copy errors to remove unnecessary context |
cmd/oras/root/cp.go | Preserves copy error context for proper prefix processing |
cmd/oras/root/attach.go | Unwraps copy errors to remove unnecessary context |
test/e2e/internal/utils/const.go | Removes EmptyBodyPrefix constant |
test/e2e/suite/command/resolve.go | Updates test to remove empty body prefix |
test/e2e/suite/command/cp.go | Updates test expectations for new error format |
test/e2e/suite/auth/auth.go | Restructures tests and adds new test for modified error prefix |
cmd/oras/internal/option/target_test.go | Updates all test method names from Modify to ModifyError |
cmd/oras/internal/option/binary_target_test.go | Adds comprehensive tests for copy error handling |
cmd/oras/internal/errors/errors_test.go | Adds tests for new ReportErrResp and UnwrapCopyError functions |
Comments suppressed due to low confidence (2)
test/e2e/suite/auth/auth.go:37
- The removal of the copy command test from this location should be verified to ensure equivalent test coverage exists elsewhere. The copy command appears to be covered by the new test below, but this should be confirmed.
RunWithoutLogin("attach", ZOTHost+"/repo:tag", "-a", "test=true", "--artifact-type", "doc/example", "--registry-config", authConfigPath)
test/e2e/suite/auth/auth.go:63
- The removal of push and pull commands from the invalid credentials test reduces test coverage. These commands should be tested elsewhere or the removal should be justified.
RunWithInvalidCreds("attach", ZOTHost+"/repo:tag", "-a", "test=true", "--artifact-type", "doc/example")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What this PR does / why we need it:
oras cp
Before:

After

oras login
andoras ls
Before:

After ("recognizable error message not found" is removed):

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 #1469
Please check the following list: