brigadecore / kashti

Kashti is a dashboard for your Brigade v1 pipelines.
http://kashti.sh
Apache License 2.0
377 stars 46 forks source link

Kashti doesn't process ansi escape sequences resulting in garbled output when an error occurs #293

Closed LittleColin closed 3 years ago

LittleColin commented 4 years ago

The logging in brigade uses ansi escape sequences to colour the log messages but this is not handled in Kashti. You could use something like https://github.com/drudru/ansi_up to convert the colours into html. For example

  Error: time limit (900000 ms) exceeded
  
  - k8s.js:706 Timeout.setTimeout [as _onTimeout]
    /home/src/dist/k8s.js:706:24
  

krancour commented 4 years ago

@flynnduism @radu-matei any opinions on this?

Front-end isn't my forte, but after a quick glance at the ansi_up package, this looks like it could be easy enough.

flynnduism commented 4 years ago

@LittleColin thanks for creating this issue. Adding ansi support is a great idea!

radu-matei commented 4 years ago

Ooh, this looks like a great suggestion for Kashti - I will definitely have a look at how this could work, thanks for the suggestion!

That being said, this is part of a larger issue with the Brigade worker and ANSI characters, which I had unsuccessfully tried to strip in the past - also see https://github.com/brigadecore/brigade/issues/418, https://github.com/brigadecore/brigade/issues/438, and https://github.com/brigadecore/brigade/issues/754.

krancour commented 4 years ago

@radu-matei but what about jobs that might produce colored output?

This seems like a nice catch-all.

radu-matei commented 4 years ago

I agree that this is a great solution for Kashti, and we should implement it.

Stripping ANSI characters however would work for all other instances where worker logs are displayed without ANSI support (some terminals?).

krancour commented 3 years ago

Closing due to staleness, but please do reopen if necessary.