Class: Gitlab::Ci::Pipeline::Chain::Skip

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

Constant Summary collapse

SKIP_PATTERN =
/\[(ci[ _-]skip|skip[ _-]ci)\]/i

Instance Attribute Summary

Attributes inherited from Base

#command, #config, #pipeline

Instance Method Summary collapse

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)


25
26
27
# File 'lib/gitlab/ci/pipeline/chain/skip.rb', line 25

def break?
  skipped?
end

#perform!Object



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

def perform!
  if skipped?
    if @command.save_incompleted
      # Project iid must be called outside a transaction, so we ensure it is set here
      # otherwise it may be set within the state transition transaction of the skip call
      # which it will lock the InternalId row for the whole transaction
      @pipeline.ensure_project_iid!

      @pipeline.skip
    end
  end
end