refactor: ApplyFlags with prefix for Remote and Target#1733
Conversation
|
The E2E test failed, oops |
|
This PR breaks |
That's why the E2E fails initialization. |
1944119 to
5b8a84f
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1733 +/- ##
==========================================
- Coverage 85.43% 85.39% -0.04%
==========================================
Files 137 137
Lines 5951 5950 -1
==========================================
- Hits 5084 5081 -3
- Misses 616 618 +2
Partials 251 251 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Fixed this a while back |
b2647cd to
03768fe
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR refactors flag registration for Target, Remote, and related types to centralize prefix and description handling, and adds a test for conflicting OCI layout flags.
- Introduces
setFlagDetailsonTargetto setprefix/descriptionbeforeApplyFlags - Updates
Remote.ApplyFlagsWithPrefixto guard duplicate flags and usedescription - Refactors
BinaryTargetto use the newTargetprefix API and adds a new unit test
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/oras/internal/option/target.go | Removed old applyFlagsWithPrefix, added setFlagDetails and updated ApplyFlags call |
| cmd/oras/internal/option/remote.go | Dropped applyPrefix, added fs.Lookup guards, switched to description |
| cmd/oras/internal/option/spec.go | Simplified prefix usage in ApplyFlagsWithPrefix |
| cmd/oras/internal/option/binary_target.go | Switched to setFlagDetails + ApplyFlags for From/To |
| cmd/oras/internal/option/target_test.go | Added TestTarget_Parse_to_oci_and_oci_path |
03768fe to
532b045
Compare
532b045 to
ffff703
Compare
ffff703 to
cb26304
Compare
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
cb26304 to
00e5c86
Compare
What this PR does / why we need it:
It kind of looks like this Target/Remote code was in the middle of some refactor that was never completed. This doesn't address all the issues, but it does clean up flag/prefix/description handling a bit.