diff options
author | Alessio Caiazza <acaiazza@gitlab.com> | 2017-09-20 17:03:53 +0300 |
---|---|---|
committer | Alessio Caiazza <acaiazza@gitlab.com> | 2017-10-03 12:35:23 +0300 |
commit | 570940858599fb2f4e5410b9a6743a0aeb0a09e7 (patch) | |
tree | 919a699d9b165be1bac447550a5fa1aba91cf456 /lib/gitlab/ci/ansi2html.rb | |
parent | d103e95513704314a38ab8ae441851524031c4a1 (diff) |
Hide CI section markers from job trace
Diffstat (limited to 'lib/gitlab/ci/ansi2html.rb')
-rw-r--r-- | lib/gitlab/ci/ansi2html.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/gitlab/ci/ansi2html.rb b/lib/gitlab/ci/ansi2html.rb index ad78ae244b2..088adbdd267 100644 --- a/lib/gitlab/ci/ansi2html.rb +++ b/lib/gitlab/ci/ansi2html.rb @@ -155,7 +155,9 @@ module Gitlab stream.each_line do |line| s = StringScanner.new(line) until s.eos? - if s.scan(/\e([@-_])(.*?)([@-~])/) + if s.scan(/section_((?:start)|(?:end)):(\d+):([^\r]+)\r\033\[0K/) + handle_section(s) + elsif s.scan(/\e([@-_])(.*?)([@-~])/) handle_sequence(s) elsif s.scan(/\e(([@-_])(.*?)?)?$/) break @@ -183,6 +185,15 @@ module Gitlab ) end + def handle_section(s) + action = s[1] + timestamp = s[2] + section = s[3] + line = s.matched()[0...-5] # strips \r\033[0K + + @out << %{<div class="hidden" data-action="#{action}" data-timestamp="#{timestamp}" data-section="#{section}">#{line}</div>} + end + def handle_sequence(s) indicator = s[1] commands = s[2].split ';' |