summaryrefslogtreecommitdiff
path: root/app/models/ci/pipeline.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-02-22 16:54:59 -0600
committerDouwe Maan <douwe@selenight.nl>2017-02-23 09:33:19 -0600
commit56de781a2cef437b6e1af748dc0c231af74e044d (patch)
treec8186a283904e3cc7461c4289cd2e1a8a9daa69c /app/models/ci/pipeline.rb
parent1fe7501b49f896b74102c4b970310aa9ae34da85 (diff)
downloadgitlab-ce-56de781a2cef437b6e1af748dc0c231af74e044d.tar.gz
Revert "Enable Style/DotPosition"
This reverts commit e00fb2bdc2090e9cabeb1eb35a2672a882cc96e9. # Conflicts: # .rubocop.yml # .rubocop_todo.yml # lib/gitlab/ci/config/entry/global.rb # lib/gitlab/ci/config/entry/jobs.rb # spec/lib/gitlab/ci/config/entry/factory_spec.rb # spec/lib/gitlab/ci/config/entry/global_spec.rb # spec/lib/gitlab/ci/config/entry/job_spec.rb # spec/lib/gitlab/ci/status/build/factory_spec.rb # spec/lib/gitlab/incoming_email_spec.rb
Diffstat (limited to 'app/models/ci/pipeline.rb')
-rw-r--r--app/models/ci/pipeline.rb34
1 files changed, 17 insertions, 17 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index 04d43ca3c5c..80e11a5b58f 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -91,9 +91,9 @@ module Ci
# ref can't be HEAD or SHA, can only be branch/tag name
scope :latest, ->(ref = nil) do
- max_id = unscope(:select).
- select("max(#{quoted_table_name}.id)").
- group(:ref, :sha)
+ max_id = unscope(:select)
+ .select("max(#{quoted_table_name}.id)")
+ .group(:ref, :sha)
if ref
where(ref: ref, id: max_id.where(ref: ref))
@@ -135,16 +135,16 @@ module Ci
def stages
# TODO, this needs refactoring, see gitlab-ce#26481.
- stages_query = statuses.
- group('stage').select(:stage).order('max(stage_idx)')
+ stages_query = statuses
+ .group('stage').select(:stage).order('max(stage_idx)')
status_sql = statuses.latest.where('stage=sg.stage').status_sql
- warnings_sql = statuses.latest.select('COUNT(*) > 0').
- where('stage=sg.stage').failed_but_allowed.to_sql
+ warnings_sql = statuses.latest.select('COUNT(*) > 0')
+ .where('stage=sg.stage').failed_but_allowed.to_sql
- stages_with_statuses = CommitStatus.from(stages_query, :sg).
- pluck('sg.stage', status_sql, "(#{warnings_sql})")
+ stages_with_statuses = CommitStatus.from(stages_query, :sg)
+ .pluck('sg.stage', status_sql, "(#{warnings_sql})")
stages_with_statuses.map do |stage|
Ci::Stage.new(self, Hash[%i[name status warnings].zip(stage)])
@@ -220,8 +220,8 @@ module Ci
end
def retry_failed(current_user)
- Ci::RetryPipelineService.new(project, current_user).
- execute(self)
+ Ci::RetryPipelineService.new(project, current_user)
+ .execute(self)
end
def mark_as_processable_after_stage(stage_idx)
@@ -353,15 +353,15 @@ module Ci
# Merge requests for which the current pipeline is running against
# the merge request's latest commit.
def merge_requests
- @merge_requests ||= project.merge_requests.
- where(source_branch: self.ref).
- select { |merge_request| merge_request.head_pipeline.try(:id) == self.id }
+ @merge_requests ||= project.merge_requests
+ .where(source_branch: self.ref)
+ .select { |merge_request| merge_request.head_pipeline.try(:id) == self.id }
end
def detailed_status(current_user)
- Gitlab::Ci::Status::Pipeline::Factory.
- new(self, current_user).
- fabricate!
+ Gitlab::Ci::Status::Pipeline::Factory
+ .new(self, current_user)
+ .fabricate!
end
private