Commit fe6ec80e authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Render CI status on merge requests index page

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 61fcb3c5
...@@ -11,6 +11,7 @@ v 8.2.0 (unreleased) ...@@ -11,6 +11,7 @@ v 8.2.0 (unreleased)
- Show "Empty Repository Page" for repository without branches (Artem V. Navrotskiy) - Show "Empty Repository Page" for repository without branches (Artem V. Navrotskiy)
- Fix: Inability to reply to code comments in the MR view, if the MR comes from a fork - Fix: Inability to reply to code comments in the MR view, if the MR comes from a fork
- Use git follow flag for commits page when retrieve history for file or directory - Use git follow flag for commits page when retrieve history for file or directory
- Show merge request CI status on merge requests index page
v 8.1.0 v 8.1.0
- Ensure MySQL CI limits DB migrations occur after the fields have been created (Stan Hu) - Ensure MySQL CI limits DB migrations occur after the fields have been created (Stan Hu)
......
...@@ -159,11 +159,11 @@ class MergeRequest < ActiveRecord::Base ...@@ -159,11 +159,11 @@ class MergeRequest < ActiveRecord::Base
def last_commit def last_commit
merge_request_diff ? merge_request_diff.last_commit : compare_commits.last merge_request_diff ? merge_request_diff.last_commit : compare_commits.last
end end
def first_commit def first_commit
merge_request_diff ? merge_request_diff.first_commit : compare_commits.first merge_request_diff ? merge_request_diff.first_commit : compare_commits.first
end end
def last_commit_short_sha def last_commit_short_sha
last_commit.short_id last_commit.short_id
...@@ -470,4 +470,10 @@ class MergeRequest < ActiveRecord::Base ...@@ -470,4 +470,10 @@ class MergeRequest < ActiveRecord::Base
unlock_mr if locked? unlock_mr if locked?
end end
end end
def ci_commit
if last_commit
source_project.ci_commit(last_commit.id)
end
end
end end
- ci_commit = merge_request.ci_commit
%li{ class: mr_css_classes(merge_request) } %li{ class: mr_css_classes(merge_request) }
.merge-request-title .merge-request-title
%span.merge-request-title-text %span.merge-request-title-text
...@@ -6,6 +7,9 @@ ...@@ -6,6 +7,9 @@
- merge_request.labels.each do |label| - merge_request.labels.each do |label|
= link_to_label(label, project: merge_request.project) = link_to_label(label, project: merge_request.project)
.pull-right.light .pull-right.light
- if ci_commit
= link_to ci_status_path(ci_commit), class: "c#{ci_status_color(ci_commit)}" do
= ci_status_icon(ci_commit)
- if merge_request.merged? - if merge_request.merged?
%span %span
%i.fa.fa-check %i.fa.fa-check
......
- ci_commit = @merge_request.source_project.ci_commit(@merge_request.source_sha) - ci_commit = @merge_request.ci_commit
- if ci_commit - if ci_commit
- status = ci_commit.status - status = ci_commit.status
.mr-widget-heading .mr-widget-heading
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment