Get ci_commit in MR controller
This commit is contained in:
parent
35fd7112bf
commit
9907a7e6ed
3 changed files with 7 additions and 6 deletions
|
@ -264,6 +264,8 @@ class Projects::MergeRequestsController < Projects::ApplicationController
|
|||
|
||||
@merge_request_diff = @merge_request.merge_request_diff
|
||||
|
||||
@ci_commit = @merge_request.ci_commit
|
||||
|
||||
if @merge_request.locked_long_ago?
|
||||
@merge_request.unlock_mr
|
||||
@merge_request.close
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
- ci_commit = @merge_request.ci_commit
|
||||
- if ci_commit
|
||||
- status = ci_commit.status
|
||||
- if @ci_commit
|
||||
- status = @ci_commit.status
|
||||
.mr-widget-heading
|
||||
.ci_widget{class: "ci-#{status}"}
|
||||
= ci_status_icon(ci_commit)
|
||||
= ci_status_icon(@ci_commit)
|
||||
%span CI build #{status}
|
||||
for #{@merge_request.last_commit_short_sha}.
|
||||
%span.ci-coverage
|
||||
= link_to "View build details", ci_status_path(ci_commit)
|
||||
= link_to "View build details", ci_status_path(@ci_commit)
|
||||
|
||||
- elsif @merge_request.has_ci?
|
||||
- # Compatibility with old CI integrations (ex jenkins) when you request status from CI server via AJAX
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
- status_class = @merge_request.ci_commit ? " ci-#{@merge_request.ci_commit.status}" : nil
|
||||
- status_class = @ci_commit ? " ci-#{@ci_commit.status}" : nil
|
||||
|
||||
= form_for [:merge, @project.namespace.becomes(Namespace), @project, @merge_request], remote: true, method: :post, html: { class: 'accept-mr-form js-requires-input' } do |f|
|
||||
= hidden_field_tag :authenticity_token, form_authenticity_token
|
||||
|
|
Loading…
Reference in a new issue