summaryrefslogtreecommitdiff
path: root/app/controllers/projects
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-03-31 19:51:28 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-04-11 23:32:54 +0200
commit5d69f5b46d475f34fb71dfb4e8b683e90897f1da (patch)
tree48f268cb483ecab1d8d7e042c60931596838b1a3 /app/controllers/projects
parent986b4a54ee159de56a7ebe51327887b49474813b (diff)
downloadgitlab-ce-5d69f5b46d475f34fb71dfb4e8b683e90897f1da.tar.gz
Use Ci::Commit as Pipeline
Diffstat (limited to 'app/controllers/projects')
-rw-r--r--app/controllers/projects/commit_controller.rb7
-rw-r--r--app/controllers/projects/merge_requests_controller.rb3
-rw-r--r--app/controllers/projects/pipelines_controller.rb0
3 files changed, 7 insertions, 3 deletions
diff --git a/app/controllers/projects/commit_controller.rb b/app/controllers/projects/commit_controller.rb
index 576fa3cedb2..f9a4aeaa627 100644
--- a/app/controllers/projects/commit_controller.rb
+++ b/app/controllers/projects/commit_controller.rb
@@ -94,8 +94,8 @@ class Projects::CommitController < Projects::ApplicationController
@commit ||= @project.commit(params[:id])
end
- def ci_commit
- @ci_commit ||= project.ci_commit(commit.sha)
+ def ci_commits
+ @ci_commits ||= project.ci_commits.where(sha: commit.sha)
end
def define_show_vars
@@ -108,7 +108,8 @@ class Projects::CommitController < Projects::ApplicationController
@diff_refs = [commit.parent || commit, commit]
@notes_count = commit.notes.count
- @statuses = ci_commit.statuses if ci_commit
+ @statuses = CommitStatus.where(commit: ci_commits)
+ @builds = Ci::Build.where(commit: ci_commits)
end
def assign_revert_commit_vars
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb
index 49064f5d505..ed5a1901056 100644
--- a/app/controllers/projects/merge_requests_controller.rb
+++ b/app/controllers/projects/merge_requests_controller.rb
@@ -118,6 +118,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@diffs = @merge_request.compare.diffs(diff_options) if @merge_request.compare
@ci_commit = @merge_request.ci_commit
+ @ci_commits = [@ci_commit].compact
@statuses = @ci_commit.statuses if @ci_commit
@note_counts = Note.where(commit_id: @commits.map(&:id)).
@@ -308,6 +309,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@merge_request_diff = @merge_request.merge_request_diff
@ci_commit = @merge_request.ci_commit
+ @ci_commits = [@ci_commit].compact
@statuses = @ci_commit.statuses if @ci_commit
if @merge_request.locked_long_ago?
@@ -318,6 +320,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
def define_widget_vars
@ci_commit = @merge_request.ci_commit
+ @ci_commits = [@ci_commit].compact
closes_issues
end
diff --git a/app/controllers/projects/pipelines_controller.rb b/app/controllers/projects/pipelines_controller.rb
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/app/controllers/projects/pipelines_controller.rb