diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2017-10-03 21:16:54 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2017-10-03 21:16:54 +0300 |
commit | da9d42f2b31c6e8263365de8b326a082ab9506ac (patch) | |
tree | 89477176d589fed4e16a056255fcea259b9ffb64 /lib/gitlab/ci | |
parent | c3462235f30ab33bee41afd57ec3975917c42467 (diff) | |
parent | 79e1f33f13095e3781bc3fc07efd52921c4ed756 (diff) |
Merge branch '37970-timestamped-ci' into 'master'
Hide CI section markers from job trace
See merge request gitlab-org/gitlab-ce!14393
Diffstat (limited to 'lib/gitlab/ci')
-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 ';' |