chore(ux): improve oras backup error message#1833
Conversation
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1833 +/- ##
==========================================
+ Coverage 85.21% 85.25% +0.04%
==========================================
Files 143 143
Lines 6737 6742 +5
==========================================
+ Hits 5741 5748 +7
+ Misses 708 707 -1
+ Partials 288 287 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR improves the error message when using oras backup with an output path that ends with .tar but points to an existing directory instead of a file. The enhancement provides clearer guidance to users about the conflict and suggests actionable solutions.
- Enhanced error handling to detect directory conflicts when creating tar archives
- Added user-friendly error message with specific recommendations
- Included comprehensive test coverage for the new error scenario
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| cmd/oras/root/backup.go | Added directory detection logic and improved error message for tar output conflicts |
| test/e2e/suite/command/backup.go | Added end-to-end test to verify the new error message behavior |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
What this PR does / why we need it:
This PR improves the error message in
oras backupfor the case where the output path ends with.tarbut is an existing directory.BEFORE:
AFTER:
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 #1831
Please check the following list: