Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
f7da5065
Commit
f7da5065
authored
Oct 17, 2016
by
Grzegorz Bizon
Committed by
Annabel Dunstone Gray
Oct 18, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract pipeline vars in merge requests controller
parent
db0e700d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+13
-5
app/views/projects/merge_requests/_show.html.haml
app/views/projects/merge_requests/_show.html.haml
+1
-1
No files found.
app/controllers/projects/merge_requests_controller.rb
View file @
f7da5065
...
@@ -483,13 +483,12 @@ class Projects::MergeRequestsController < Projects::ApplicationController
...
@@ -483,13 +483,12 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@noteable
=
@merge_request
@noteable
=
@merge_request
@commits_count
=
@merge_request
.
commits
.
count
@commits_count
=
@merge_request
.
commits
.
count
@pipeline
=
@merge_request
.
pipeline
@statuses
=
@pipeline
.
statuses
.
relevant
if
@pipeline
if
@merge_request
.
locked_long_ago?
if
@merge_request
.
locked_long_ago?
@merge_request
.
unlock_mr
@merge_request
.
unlock_mr
@merge_request
.
close
@merge_request
.
close
end
end
define_pipelines_vars
end
end
# Discussion tab data is rendered on html responses of actions
# Discussion tab data is rendered on html responses of actions
...
@@ -543,6 +542,15 @@ class Projects::MergeRequestsController < Projects::ApplicationController
...
@@ -543,6 +542,15 @@ class Projects::MergeRequestsController < Projects::ApplicationController
)
)
end
end
def
define_pipelines_vars
@pipelines
=
@merge_request
.
all_pipelines
if
@pipelines
.
any?
@pipeline
=
@pipelines
.
first
@statuses
=
@pipeline
.
statuses
.
relevant
end
end
def
define_new_vars
def
define_new_vars
@noteable
=
@merge_request
@noteable
=
@merge_request
...
@@ -558,10 +566,10 @@ class Projects::MergeRequestsController < Projects::ApplicationController
...
@@ -558,10 +566,10 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@commit
=
@merge_request
.
diff_head_commit
@commit
=
@merge_request
.
diff_head_commit
@base_commit
=
@merge_request
.
diff_base_commit
@base_commit
=
@merge_request
.
diff_base_commit
@pipelines
=
@merge_request
.
all_pipelines
@statuses
=
@pipelines
.
first
.
statuses
.
relevant
if
@pipelines
.
any?
@note_counts
=
Note
.
where
(
commit_id:
@commits
.
map
(
&
:id
)).
@note_counts
=
Note
.
where
(
commit_id:
@commits
.
map
(
&
:id
)).
group
(
:commit_id
).
count
group
(
:commit_id
).
count
define_pipelines_vars
end
end
def
invalid_mr
def
invalid_mr
...
...
app/views/projects/merge_requests/_show.html.haml
View file @
f7da5065
...
@@ -61,7 +61,7 @@
...
@@ -61,7 +61,7 @@
%li
.pipelines-tab
%li
.pipelines-tab
=
link_to
pipelines_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'#pipelines'
,
action:
'pipelines'
,
toggle:
'tab'
}
do
=
link_to
pipelines_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'#pipelines'
,
action:
'pipelines'
,
toggle:
'tab'
}
do
Pipelines
Pipelines
%span
.badge
=
@
merge_request
.
all_
pipelines
.
size
%span
.badge
=
@pipelines
.
size
%li
.builds-tab
%li
.builds-tab
=
link_to
builds_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'#builds'
,
action:
'builds'
,
toggle:
'tab'
}
do
=
link_to
builds_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'#builds'
,
action:
'builds'
,
toggle:
'tab'
}
do
Builds
Builds
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment