Class: Gitlab::Ci::Pipeline::Chain::Config::Process

Inherits:
Base
  • Object
show all
Includes:
Helpers
Defined in:
lib/gitlab/ci/pipeline/chain/config/process.rb

Instance Attribute Summary

Attributes inherited from Base

#command, #config, #pipeline

Instance Method Summary collapse

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)

50
51
52
# File 'lib/gitlab/ci/pipeline/chain/config/process.rb', line 50

def break?
  @pipeline.errors.any? || @pipeline.persisted?
end

#perform!Object


11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/gitlab/ci/pipeline/chain/config/process.rb', line 11

def perform!
  raise ArgumentError, 'missing config content' unless @command.config_content

  result = logger.instrument(:pipeline_config_process) do
    processor = ::Gitlab::Ci::YamlProcessor.new(
      @command.config_content, {
        project: project,
        pipeline: @pipeline,
        sha: @pipeline.sha,
        source: @pipeline.source,
        user: current_user,
        parent_pipeline: parent_pipeline,
        logger: logger
      }
    )

    processor.execute
  end

  add_warnings_to_pipeline(result.warnings)

  if result.valid?
    @command.yaml_processor_result = result
  else
    error(result.errors.first, config_error: true)
  end

  @pipeline. = result.

rescue StandardError => ex
  Gitlab::ErrorTracking.track_exception(ex,
    project_id: project.id,
    sha: @pipeline.sha
  )

  error("Undefined error (#{Labkit::Correlation::CorrelationId.current_id})",
    config_error: true)
end