Skip to content

Conversation

@mirkoCrobu
Copy link
Contributor

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

  • PR addresses a single concern.
  • PR title and description are properly filled.
  • Changes will be merged in main.
  • Changes are covered by tests.
  • Logging is meaningful in case of troubleshooting.

@mirkoCrobu mirkoCrobu self-assigned this Nov 26, 2025
@mirkoCrobu mirkoCrobu added the enhancement New feature or request label Nov 26, 2025
@mirkoCrobu mirkoCrobu requested review from a team, dido18 and lucarin91 and removed request for dido18 November 26, 2025 15:18
@mirkoCrobu mirkoCrobu requested review from a team and dido18 November 27, 2025 12:11
Copy link
Contributor

@lucarin91 lucarin91 left a 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
Copy link
Contributor

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

Suggested change
Progress float32
progress float32

func NewProgressEvent(progress float32) Event {
return Event{
Type: ProgressEvent,
data: fmt.Sprintf("%.2f", progress),
Copy link
Contributor

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

Suggested change
data: fmt.Sprintf("%.2f", progress),

Comment on lines 90 to 93
func (e Event) GetError() error {
f.Assert(e.Type == ErrorEvent, "not an error event")
return e.err
}
Copy link
Contributor

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
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants