diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
commit | 0c872e02b2c822e3397515ec324051ff540f0cd5 (patch) | |
tree | ce2fb6ce7030e4dad0f4118d21ab6453e5938cdd /app/services/ci/append_build_trace_service.rb | |
parent | f7e05a6853b12f02911494c4b3fe53d9540d74fc (diff) |
Add latest changes from gitlab-org/gitlab@15-7-stable-eev15.7.0-rc42
Diffstat (limited to 'app/services/ci/append_build_trace_service.rb')
-rw-r--r-- | app/services/ci/append_build_trace_service.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/services/ci/append_build_trace_service.rb b/app/services/ci/append_build_trace_service.rb index 0eef0ff0e61..4432eecc24a 100644 --- a/app/services/ci/append_build_trace_service.rb +++ b/app/services/ci/append_build_trace_service.rb @@ -24,6 +24,11 @@ module Ci body_start = content_range[0].to_i body_end = body_start + body_data.bytesize + if first_debug_chunk?(body_start) + # Update the build metadata prior to appending trace content + build.enable_debug_trace! + end + if trace_size_exceeded?(body_end) build.drop(:trace_size_exceeded) @@ -45,10 +50,18 @@ module Ci delegate :project, to: :build + def first_debug_chunk?(body_start) + body_start == 0 && debug_trace + end + def stream_range params.fetch(:content_range) end + def debug_trace + params.fetch(:debug_trace, false) + end + def log_range_error(stream_size, body_end) extra = { build_id: build.id, |