Class: Gitlab::Ci::Pipeline::Chain::Create

Inherits:
Base
  • Object
show all
Includes:
Helpers, Utils::StrongMemoize
Defined in:
lib/gitlab/ci/pipeline/chain/create.rb

Instance Attribute Summary

Attributes inherited from Base

#command, #config, #pipeline

Instance Method Summary collapse

Methods included from Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Methods included from Helpers

#error, #warning

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Gitlab::Ci::Pipeline::Chain::Base

Instance Method Details

#break?Boolean

Returns:

  • (Boolean)

26
27
28
# File 'lib/gitlab/ci/pipeline/chain/create.rb', line 26

def break?
  !pipeline.persisted?
end

#perform!Object


11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/gitlab/ci/pipeline/chain/create.rb', line 11

def perform!
  logger.instrument_with_sql(:pipeline_save) do
    BulkInsertableAssociations.with_bulk_insert do
      with_bulk_insert_tags do
        pipeline.transaction do
          pipeline.save!
          CommitStatus.bulk_insert_tags!(statuses)
        end
      end
    end
  end
rescue ActiveRecord::RecordInvalid => e
  error("Failed to persist the pipeline: #{e}")
end