Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2019-03-02 17:29:04 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2019-03-02 23:03:41 +0300
commit552a32c01545c82df3790dffa5545a451fd63529 (patch)
tree116f1d909d05fb9598feb11532c8a0efce18425c /app/models/ci/bridge.rb
parent981c2488633072ae013ed13ba6663e8f87fd357b (diff)
Extract scoped CI/CD variables to a separate concern
This commits extract code responsible for calculating essential CI/CD variables to a separate concern. This makes it possible to share this code between a `Ci::Build` and a `Ci::Bridge`. We might want to refactor this to use composition instead of inheritance.
Diffstat (limited to 'app/models/ci/bridge.rb')
-rw-r--r--app/models/ci/bridge.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/models/ci/bridge.rb b/app/models/ci/bridge.rb
index f570403615b..0d8d7d95791 100644
--- a/app/models/ci/bridge.rb
+++ b/app/models/ci/bridge.rb
@@ -3,6 +3,7 @@
module Ci
class Bridge < CommitStatus
include Ci::Processable
+ include Ci::Contextable
include Importable
include AfterCommitQueue
include HasRef
@@ -12,6 +13,8 @@ module Ci
belongs_to :trigger_request
validates :ref, presence: true
+ delegate :merge_request_event?, to: :pipeline
+
def self.retry(bridge, current_user)
raise NotImplementedError
end
@@ -38,11 +41,11 @@ module Ci
false
end
- def expanded_environment_name
+ def runnable?
+ false
end
- def predefined_variables
- raise NotImplementedError
+ def expanded_environment_name
end
def execute_hooks