lightbend-labs / dbuild

Multi-project build tool, based on sbt.
https://lightbend-labs.github.io/dbuild
Other
83 stars 14 forks source link

Avoid printing Incomplete's toString #204

Closed cunei closed 6 years ago

cunei commented 6 years ago

Incomplete (optionally) holds a reference to the task key (in my experience values of type ScopedKey) that did not complete, as well as the multiple possible causes, which are also Incomplete instances and therefore the whole thing is recursive. Add to that the toString of ScopedKey is extremely verbose, and you end up in a situation where failures generate so much log that Jenkins gives up with a "Max Log Size reached. Aborting" message, and attempting to download the full log file from Jenkins (which turns out to be 106 MiB) even crashes your Google Chrome tab..

sbt's Incompletes aren't meant to be printed, as indicated them by mixing in UnprintableException, which is handled by ExceptionCategory. So let's use that when attempts are made to print the stacktrace so the dbuild experience is more pleasant.

Fixes #194, or at least I think it should and hope it does - I'm not setup to test this.

cunei commented 6 years ago

Thanks @dwijnand, I'm reviewing and testing now!

cunei commented 6 years ago

I reverted just the saved message computation, I don't really see the point in making the code less clear just to save a couple of lines. Other than that, it looks very good indeed: I ran a few tests, and the messages are much better now. Thanks @dwijnand!

dwijnand commented 6 years ago

Nice! Thank you for spending the time on this Toni.