thoughtworks / metrik

An easy-to-use, cross-platform measurement tool that pulls data out of CD pipelines and analysis the four key metrics for you.
MIT License
359 stars 87 forks source link

Optimize progress notification #95

Closed hyrepo closed 2 years ago

hyrepo commented 3 years ago

Describe the context of this enhancement For some CI/CD systems, i.e. Github Actions, the synchronization has two parts: sync pipeline executions and sync commit history, both of them cost much time. The current implementation of progress notification can't handle a situation like this.

Describe the solution you'd like Use segmented progress, e.g. 50% for executions sync and 50% for commit sync

RoujingLiu commented 2 years ago

We have a thought on this enhancement based on our current work on the Github Actions.

Current Pain Points Fetching runs and fetching commits for runs have no updates of progress to frontend, while only the last step of mapping immediately pass a lot updates to frontend, which cause the progress bar could not really visualize the progress.

Enhancement For fetching runs, we are fetching by pages, while for fetching commits, we are fetching branches first (and by pages as well). So in general, there are two "steps" or "stages". One way to better visualize the progress is to display both which "step" we are, as well as the sub-progress of "page" or "branch". Here is the draft mockup of what we are thinking:

Screenshot 2022-05-31 at 3 06 41 PM

Detailed Changes of the Enhancement

zhe-zhao commented 2 years ago

Hi @RoujingLiu , thanks the mockup looks good. In terms of sync steps, here's my $0.02. The main purpose of this progress bar is to give the user a sense how long they have to wait here. According to currently sync process 90% (only a guesstimates value) of time were spent on GA runs sync & commits summary info sync, while the branch info fetching should be relatively faster. Should we consider that when dividing the steps?

RoujingLiu commented 2 years ago

According to currently sync process 90% (only a guesstimates value) of time were spent on GA runs sync & commits s

@zhe-zhao Thanks for the reply!

We do agree that we want to use the progress bar to better visualize the essential progress steps. To further elaborate a bit on our idea related to the "step" for Github Actions based on current logic:

Based on our current test in our example, the first two step are quite balanced and should be able to visualize some useful progress.

Hope this make our thought more clear. Do feel free to share more idea :)

RoujingLiu commented 2 years ago

sync-progress-bar

Here is the git for the process bar demo. Hope it gives a clear view of the expected look.

LixingSun commented 2 years ago

Paired with @RoujingLiu we are also going to fix two issues we found during the process:

  1. The progress bar label "ant-progress-text" width default is fixed to "2em" and need to modify to "auto" to make it responsive, otherwise will overflow
  2. In local development, the frontend didn't receive the SSE message real-time as expected. All are received at once when complete. Based on our research it was due to a legacy "compress" config issue related to webpack dev server. Once set the config to "false" then it will work.