summaryrefslogtreecommitdiff
path: root/lib/api/commit_statuses.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-06-10 22:27:06 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-06-10 22:27:06 +0200
commit95a10f4533fdb708c61ffda95099bddd94800f02 (patch)
treebf5c561472c47d34e5ff1f643c49cd2a6b206f15 /lib/api/commit_statuses.rb
parent17c6bec79d876ce932edc0edc5d17622adb2f724 (diff)
parentb4e84809e8170a43126507da0bc6a3b94c33804b (diff)
downloadgitlab-ce-95a10f4533fdb708c61ffda95099bddd94800f02.tar.gz
Merge remote-tracking branch 'origin/master' into ci-lfs-fetch
Diffstat (limited to 'lib/api/commit_statuses.rb')
-rw-r--r--lib/api/commit_statuses.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/api/commit_statuses.rb b/lib/api/commit_statuses.rb
index 9bcd33ff19e..323a7086890 100644
--- a/lib/api/commit_statuses.rb
+++ b/lib/api/commit_statuses.rb
@@ -22,8 +22,8 @@ module API
not_found!('Commit') unless user_project.commit(params[:sha])
- ci_commits = user_project.ci_commits.where(sha: params[:sha])
- statuses = ::CommitStatus.where(commit: ci_commits)
+ pipelines = user_project.pipelines.where(sha: params[:sha])
+ statuses = ::CommitStatus.where(pipeline: pipelines)
statuses = statuses.latest unless parse_boolean(params[:all])
statuses = statuses.where(ref: params[:ref]) if params[:ref].present?
statuses = statuses.where(stage: params[:stage]) if params[:stage].present?
@@ -50,7 +50,7 @@ module API
commit = @project.commit(params[:sha])
not_found! 'Commit' unless commit
- # Since the CommitStatus is attached to Ci::Commit (in the future Pipeline)
+ # Since the CommitStatus is attached to Ci::Pipeline (in the future Pipeline)
# We need to always have the pipeline object
# To have a valid pipeline object that can be attached to specific MR
# Other CI service needs to send `ref`
@@ -64,11 +64,11 @@ module API
ref = branches.first
end
- ci_commit = @project.ensure_ci_commit(commit.sha, ref)
+ pipeline = @project.ensure_pipeline(commit.sha, ref)
name = params[:name] || params[:context]
- status = GenericCommitStatus.running_or_pending.find_by(commit: ci_commit, name: name, ref: params[:ref])
- status ||= GenericCommitStatus.new(project: @project, commit: ci_commit, user: current_user)
+ status = GenericCommitStatus.running_or_pending.find_by(pipeline: pipeline, name: name, ref: params[:ref])
+ status ||= GenericCommitStatus.new(project: @project, pipeline: pipeline, user: current_user)
status.update(attrs)
case params[:state].to_s