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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-08 15:07:59 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-08 15:07:59 +0300
commite3e300557f5def9bf2271735c8a620e6820dfada (patch)
tree8d0d4590518ee17eb32956e35637e11a2b8ca561 /app/models
parenta821bd6ad17e304ca93838a411410a44ee9cff9f (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r--app/models/ci/bridge.rb4
-rw-r--r--app/models/ci/pipeline.rb25
-rw-r--r--app/models/ci/pipeline_enums.rb8
-rw-r--r--app/models/ci/sources/pipeline.rb2
4 files changed, 7 insertions, 32 deletions
diff --git a/app/models/ci/bridge.rb b/app/models/ci/bridge.rb
index 123b8e75ad5..6c51f650b6a 100644
--- a/app/models/ci/bridge.rb
+++ b/app/models/ci/bridge.rb
@@ -54,10 +54,6 @@ module Ci
def to_partial_path
'projects/generic_commit_statuses/generic_commit_status'
end
-
- def yaml_for_downstream
- nil
- end
end
end
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index c8c1bbacad3..ab0a4fd6289 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -61,9 +61,7 @@ module Ci
has_one :chat_data, class_name: 'Ci::PipelineChatData'
has_many :triggered_pipelines, through: :sourced_pipelines, source: :pipeline
- has_many :child_pipelines, -> { merge(Ci::Sources::Pipeline.same_project) }, through: :sourced_pipelines, source: :pipeline
has_one :triggered_by_pipeline, through: :source_pipeline, source: :source_pipeline
- has_one :parent_pipeline, -> { merge(Ci::Sources::Pipeline.same_project) }, through: :source_pipeline, source: :source_pipeline
has_one :source_job, through: :source_pipeline, source: :source_job
has_one :pipeline_config, class_name: 'Ci::PipelineConfig', inverse_of: :pipeline
@@ -215,7 +213,6 @@ module Ci
end
scope :internal, -> { where(source: internal_sources) }
- scope :no_child, -> { where.not(source: :parent_pipeline) }
scope :ci_sources, -> { where(config_source: ::Ci::PipelineEnums.ci_config_sources_values) }
scope :for_user, -> (user) { where(user: user) }
scope :for_sha, -> (sha) { where(sha: sha) }
@@ -511,6 +508,10 @@ module Ci
builds.skipped.after_stage(stage_idx).find_each(&:process)
end
+ def child?
+ false
+ end
+
def latest?
return false unless git_ref && commit.present?
@@ -693,24 +694,6 @@ module Ci
all_merge_requests.order(id: :desc)
end
- # If pipeline is a child of another pipeline, include the parent
- # and the siblings, otherwise return only itself.
- def same_family_pipeline_ids
- if (parent = parent_pipeline)
- [parent.id] + parent.child_pipelines.pluck(:id)
- else
- [self.id]
- end
- end
-
- def child?
- parent_pipeline.present?
- end
-
- def parent?
- child_pipelines.exists?
- end
-
def detailed_status(current_user)
Gitlab::Ci::Status::Pipeline::Factory
.new(self, current_user)
diff --git a/app/models/ci/pipeline_enums.rb b/app/models/ci/pipeline_enums.rb
index 24a26cb055c..3cd88807969 100644
--- a/app/models/ci/pipeline_enums.rb
+++ b/app/models/ci/pipeline_enums.rb
@@ -23,11 +23,10 @@ module Ci
schedule: 4,
api: 5,
external: 6,
- cross_project_pipeline: 7,
+ pipeline: 7,
chat: 8,
merge_request_event: 10,
- external_pull_request_event: 11,
- parent_pipeline: 12
+ external_pull_request_event: 11
}
end
@@ -39,8 +38,7 @@ module Ci
repository_source: 1,
auto_devops_source: 2,
remote_source: 4,
- external_project_source: 5,
- bridge_source: 6
+ external_project_source: 5
}
end
diff --git a/app/models/ci/sources/pipeline.rb b/app/models/ci/sources/pipeline.rb
index d71e3b55b9a..feaec27281c 100644
--- a/app/models/ci/sources/pipeline.rb
+++ b/app/models/ci/sources/pipeline.rb
@@ -18,8 +18,6 @@ module Ci
validates :source_project, presence: true
validates :source_job, presence: true
validates :source_pipeline, presence: true
-
- scope :same_project, -> { where(arel_table[:source_project_id].eq(arel_table[:project_id])) }
end
end
end