-
Notifications
You must be signed in to change notification settings - Fork 201
refactor: ApplyFlags with prefix for Remote and Target #1733
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
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.
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 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
setFlagDetails
onTarget
to setprefix
/description
beforeApplyFlags
- Updates
Remote.ApplyFlagsWithPrefix
to guard duplicate flags and usedescription
- Refactors
BinaryTarget
to use the newTarget
prefix 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
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
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.