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
path: root/app
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2017-06-29 16:55:19 +0300
committerKamil Trzciński <ayufan@ayufan.eu>2017-06-29 16:55:19 +0300
commitefb7b2d341a63e0904c8e49ab79b51cbbb153221 (patch)
tree3fa883b947652d7fd86e392c372490036633f4fc /app
parentda15cd7b6f5cbdf5448d95d1128eda648260833d (diff)
parent4447006832d8955f371e2430988e0c95b20f155d (diff)
Merge branch 'zj-usage-ping-only-gl-pipelines' into 'master'
Only count GL pipelines in usage data ping Closes #33172 See merge request !12277
Diffstat (limited to 'app')
-rw-r--r--app/models/ci/pipeline.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index 1b3e5a25ac2..364858964b0 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -140,6 +140,7 @@ module Ci
where(id: max_id)
end
end
+ scope :internal, -> { where(source: internal_sources) }
def self.latest_status(ref = nil)
latest(ref).status
@@ -163,6 +164,10 @@ module Ci
where.not(duration: nil).sum(:duration)
end
+ def self.internal_sources
+ sources.reject { |source| source == "external" }.values
+ end
+
def stages_count
statuses.select(:stage).distinct.count
end