-
Notifications
You must be signed in to change notification settings - Fork 181
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
refactor: add handlers to manifest push
commmand
#1555
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Xiaoxuan Wang <[email protected]>
Signed-off-by: Xiaoxuan Wang <[email protected]>
manifest push
commmand
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1555 +/- ##
==========================================
- Coverage 84.07% 84.06% -0.02%
==========================================
Files 119 119
Lines 5325 5353 +28
==========================================
+ Hits 4477 4500 +23
- Misses 602 606 +4
- Partials 246 247 +1 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Xiaoxuan Wang <[email protected]>
Signed-off-by: Xiaoxuan Wang <[email protected]>
@wangxiaoxuan273 Can you help resolve the conflict? |
Signed-off-by: Xiaoxuan Wang <[email protected]>
Signed-off-by: Xiaoxuan Wang <[email protected]>
Signed-off-by: Xiaoxuan Wang <[email protected]>
OnManifestExists(desc ocispec.Descriptor) error | ||
OnManifestUploading(desc ocispec.Descriptor) error | ||
OnManifestUploaded(desc ocispec.Descriptor) error | ||
OnManifestPushed(ref string) error |
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.
This should belong to the metadata handler
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.
As discussed when doing oras manifest index create
handlers, this function should be in status handler, as its output is like Pushed [registry] test.registry.io/test:v1
. See this comment: #1509 (comment)
However, we may also need OnManifestPushed
in metadata handler to output necessary metadata information. Future discussion may be needed.
In oras attach
and oras push
commands, this function is currently in metadata handler. We may need to move them to status handler in a future work item. cc: @shizhMSFT
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.
We need to discuss more on the effect of tty handlers.
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.
Ideal handler workflows:
- Start operation (status)
- Process nodes / tasks (status, metadata); Note: For each node, we have status and metadata
a. Start Processing (status)
b. Complete processing (status, metadata) - Complete operation (status, metadata)
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.
Per offline discussion, we don't implement status update for "3. complete operation". Thus, we will drop OnManifestPushed
. We will still keep OnManifestUploaded
as the completion of the sub-task/sub-process. For naming convension, it is suggested to rename OnManifestUploaded
to OnManifestPushed
.
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.
For metadata, we need OnManifestPushed
(or equivalent) for the record of sub-task/sub-process and OnComplete
for the record of completion of operation (mainly for rendering if the output format does not support streaming. e.g. JSON).
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.
Please follow @qweeah's comments
Signed-off-by: Xiaoxuan Wang <[email protected]>
Signed-off-by: Xiaoxuan Wang <[email protected]>
Signed-off-by: Xiaoxuan Wang <[email protected]>
} | ||
|
||
// OnCompleted implements metadata.ManifestPushHandler. | ||
func (h *ManifestPushHandler) OnCompleted(desc ocispec.Descriptor) error { |
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.
func (h *ManifestPushHandler) OnCompleted(desc ocispec.Descriptor) error { | |
func (h *ManifestPushHandler) OnCompleted() error { |
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.
According to offline discussion, OnCompleted should have no parameters. Created #1573
Signed-off-by: Xiaoxuan Wang <[email protected]>
What this PR does / why we need it:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Part of #1542
Please check the following list: