Skip to content

Support high build time variation in progress bar #4941

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

Merged
merged 12 commits into from
Nov 17, 2022
Prev Previous commit
Next Next commit
fixup! Build out frontend
  • Loading branch information
ammario committed Nov 8, 2022
commit ecd51685ffb81e894d2971a14c698935415469c5
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,14 @@ const estimateFinish = (
const lowGuess = secondsLeft(median)
const highGuess = secondsLeft(median + stddev)

// If variation is too high (and greater than second), don't show
// progress bar and give range.
const highVariation = stddev / median > 0.1 && highGuess - lowGuess > 1

const anyMomentNow: [number | undefined, string] = [
undefined,
"Any moment now...",
]

// If variation is too high (and greater than second), don't show
// progress bar and give range.
const highVariation = stddev / median > 0.1 && highGuess - lowGuess > 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might do this logic on the backend instead and return simpler API values. In the current format, it's not possible for our CLI to display a progress bar or estimated time remaining without duplicating this logic.

if (highVariation) {
if (highGuess <= 0) {
return anyMomentNow
Expand Down