Skip to content

build - catch build pipeline errors properly#9840

Merged
Gudahtt merged 7 commits intodevelopfrom
refactor-scripts
Nov 20, 2020
Merged

build - catch build pipeline errors properly#9840
Gudahtt merged 7 commits intodevelopfrom
refactor-scripts

Conversation

@EtDu
Copy link
Copy Markdown
Contributor

@EtDu EtDu commented Nov 10, 2020

Uses pump because it knows how to handle errors. need to handle errors for every stream you create, errors don't propagate through streams

@EtDu EtDu requested review from a team and kumavis as code owners November 10, 2020 09:46
@EtDu EtDu requested a review from danjm November 10, 2020 09:46
@github-actions
Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@EtDu EtDu marked this pull request as draft November 10, 2020 12:13
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [b2ed282]
Page Load Metrics (420 ± 58 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint3297542311
domContentLoaded28075641812158
load28176142012258
domInteractive28075641712158

@kumavis kumavis marked this pull request as ready for review November 11, 2020 13:51
@kumavis kumavis changed the title refactor scripts.js to catch errors properly build - catch build pipeline errors properly Nov 11, 2020
@kumavis
Copy link
Copy Markdown
Member

kumavis commented Nov 11, 2020

QA: this might break the watch-and-build flow on error, need to check

Gudahtt
Gudahtt previously approved these changes Nov 19, 2020
Copy link
Copy Markdown
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM! I can confirm that this makes the build crash correctly when it fails, rather than keep going without printing anything to the console.

@Gudahtt
Copy link
Copy Markdown
Member

Gudahtt commented Nov 19, 2020

Oh, it does break the watch flow though. I can see that being undesirable 🤔 But... I'd rather it crash loudly and break the flow, than fail silently I think? Maybe we can make watch behave more sensibly in a future PR.

@kumavis
Copy link
Copy Markdown
Member

kumavis commented Nov 19, 2020

if you accidentally save with a syntax error it breaks the reload on change flow, so do want to fix that. just needs a try/catch around the bundle on change. ill get to it eventually

@kumavis
Copy link
Copy Markdown
Member

kumavis commented Nov 19, 2020

sounds like i made an assumption that it would break and your experimentation showed it to be wrong

@Gudahtt
Copy link
Copy Markdown
Member

Gudahtt commented Nov 19, 2020

When I tested this with yarn start, it would crash the process completely if a build failure occurred on the initial build, stopping the file watcher. It would also cleanly print the error, making it easy to see what went wrong.

But if I introduce a build error after the initial build while yarn start is running, it'll print some incomprehensible "UnhandledRejection" warnings without telling me what went wrong, but the process will continue unimpeded. The watcher continues running, and will build successfully when the error is corrected.

Ideally we'd keep the process running in the first place, and print the real error in the second, but at least the syntax error scenario doesn't break the watcher.

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [d25d0cd]
Page Load Metrics (394 ± 67 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint30463752
domContentLoaded24774139214067
load24874439414067
domInteractive24774139214067

@kumavis
Copy link
Copy Markdown
Member

kumavis commented Nov 20, 2020

@Gudahtt addressed both issues 👍
this should be good2go

Copy link
Copy Markdown
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM! I've tested this, and it now works correctly for errors on initial build and on subsequent builds.

@Gudahtt Gudahtt merged commit 63f759e into develop Nov 20, 2020
@Gudahtt Gudahtt deleted the refactor-scripts branch November 20, 2020 15:26
@github-actions github-actions bot locked and limited conversation to collaborators Nov 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants