Skip to content

Limit size read from jobs log to 16KB in htmlSummary.

What does this MR do and why?

Fixes #423449 (closed)

This MR adds a read_last_lines_with_max_size function to Stream. This function allows anyone to limit the size read from the stream.

This MR then use this function to limit retrieved size for failing jobs to 16KB.

It subsequently uses this parameter in the view

Screenshots or screen recordings

(This won't really change the UI)

How to set up and validate locally

(I did not test the changes from the UI)

  1. Create a failing job trace with long lines as described in #423449 (closed)
  2. Navigate to the failing jobs pipeline UI
  3. Notice the job log is truncated (with less than 10 lines)

I added automated tests that are passing.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Run tests associated:

bin/rspec spec/graphql/types/ci/job_trace_type_spec.rb -e max_size
bin/rspec spec/lib/gitlab/ci/trace/stream_spec.rb -e "max size"

Questions answered

Edited by homer

Merge request reports