diff options
author | Alessio Caiazza <acaiazza@gitlab.com> | 2017-10-06 12:33:10 +0200 |
---|---|---|
committer | Alessio Caiazza <acaiazza@gitlab.com> | 2017-10-06 12:33:10 +0200 |
commit | c0cfc9ebd26583c444f2cce1a23f939bfa7d8969 (patch) | |
tree | a6e7260211e51b0286afc7cca7b11e985621d5c1 /app/models/ci | |
parent | ea023138bf5116a729e5accd5f81d4e586af6b02 (diff) | |
download | gitlab-ce-c0cfc9ebd26583c444f2cce1a23f939bfa7d8969.tar.gz |
Extract `Ci::Build#parse_trace_sections!` into a service37970-ci-sections-tracking
Diffstat (limited to 'app/models/ci')
-rw-r--r-- | app/models/ci/build.rb | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 72e646210a8..6ca46ae89c1 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -267,24 +267,7 @@ module Ci end def parse_trace_sections! - return false unless trace_sections.empty? - - sections = trace.extract_sections.map do |attr| - name = attr.delete(:name) - name_record = begin - project.build_trace_section_names.find_or_create_by!(name: name) - rescue ActiveRecord::RecordInvalid - project.build_trace_section_names.find_by!(name: name) - end - - attr.merge( - build_id: self.id, - project_id: self.project_id, - section_name_id: name_record.id) - end - - Gitlab::Database.bulk_insert(Ci::BuildTraceSection.table_name, sections) - true + ExtractSectionsFromBuildTraceService.new(project, user).execute(self) end def trace |