-
Notifications
You must be signed in to change notification settings - Fork 7
[update] Add progress status to the update #110
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
base: main
Are you sure you want to change the base?
Conversation
lucarin91
left a comment
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 should also add a progress to the docker image download step
| data string | ||
| err error // error field for error events | ||
| Type EventType | ||
| Progress float32 |
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.
I would make this private
| Progress float32 | |
| progress float32 |
| func NewProgressEvent(progress float32) Event { | ||
| return Event{ | ||
| Type: ProgressEvent, | ||
| data: fmt.Sprintf("%.2f", progress), |
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.
I would not use data in this case
| data: fmt.Sprintf("%.2f", progress), |
| func (e Event) GetError() error { | ||
| f.Assert(e.Type == ErrorEvent, "not an error event") | ||
| return e.err | ||
| } |
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.
can you add a GetProgress function?
func (e Event) GetProgress() float32 {
f.Assert(e.Type == ProgressEvent, "not a progress event")
return e.progress
}
Motivation
When launching the update process (both via API and, eventually, a CLI command), we should return a progress in percentage. This could be done in many ways:
estimate the time needed for some tasks, based on previous measurements (for example, how much it usually takes to do an apt update on Imola)
When we know there is a list of tasks to do (a list of packages to update), then it's possible to use that to provide progress information
This information can then be used by the FE team (App Lab) to show a progress bar.
Change description
Additional Notes
Reviewer checklist
main.