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
a17ba43b
Commit
a17ba43b
authored
Dec 08, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move commit builds to partial
parent
f5430e48
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
72 deletions
+73
-72
app/controllers/projects/commit_controller.rb
app/controllers/projects/commit_controller.rb
+4
-4
app/views/projects/commit/_builds.html.haml
app/views/projects/commit/_builds.html.haml
+67
-0
app/views/projects/commit/_ci_menu.html.haml
app/views/projects/commit/_ci_menu.html.haml
+1
-1
app/views/projects/commit/builds.html.haml
app/views/projects/commit/builds.html.haml
+1
-67
No files found.
app/controllers/projects/commit_controller.rb
View file @
a17ba43b
...
...
@@ -37,7 +37,7 @@ class Projects::CommitController < Projects::ApplicationController
def
cancel_builds
ci_commit
.
builds
.
running_or_pending
.
each
(
&
:cancel
)
redirect_
to
builds_namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
.
sha
)
redirect_
back_or_default
default:
builds_namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
.
sha
)
end
def
retry_builds
...
...
@@ -47,7 +47,7 @@ class Projects::CommitController < Projects::ApplicationController
end
end
redirect_
to
builds_namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
.
sha
)
redirect_
back_or_default
default:
builds_namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
.
sha
)
end
def
branches
...
...
@@ -74,8 +74,8 @@ class Projects::CommitController < Projects::ApplicationController
end
@notes_count
=
commit
.
notes
.
count
@
builds
=
ci_commit
.
build
s
if
ci_commit
@
statuses
=
ci_commit
.
statuse
s
if
ci_commit
end
def
authorize_manage_builds!
...
...
app/views/projects/commit/_builds.html.haml
0 → 100644
View file @
a17ba43b
.gray-content-block.middle-block
.pull-right
-
if
@ci_project
&&
can?
(
current_user
,
:manage_builds
,
@ci_commit
.
gl_project
)
-
if
@ci_commit
.
builds
.
latest
.
failed
.
any?
(
&
:retryable?
)
=
link_to
"Retry failed"
,
retry_builds_namespace_project_commit_path
(
@ci_commit
.
gl_project
.
namespace
,
@ci_commit
.
gl_project
,
@ci_commit
.
sha
),
class:
'btn btn-grouped btn-primary'
,
method: :post
-
if
@ci_commit
.
builds
.
running_or_pending
.
any?
=
link_to
"Cancel running"
,
cancel_builds_namespace_project_commit_path
(
@ci_commit
.
gl_project
.
namespace
,
@ci_commit
.
gl_project
,
@ci_commit
.
sha
),
data:
{
confirm:
'Are you sure?'
},
class:
'btn btn-grouped btn-danger'
,
method: :post
.oneline
=
pluralize
@statuses
.
count
(
:id
),
"build"
-
if
defined?
(
link_to_commit
)
&&
link_to_commit
for commit
=
link_to
@ci_commit
.
short_sha
,
namespace_project_commit_path
(
@ci_commit
.
gl_project
.
namespace
,
@ci_commit
.
gl_project
,
@ci_commit
.
sha
),
class:
"monospace"
-
if
@ci_commit
.
duration
>
0
in
=
time_interval_in_words
@ci_commit
.
duration
-
if
@ci_commit
.
yaml_errors
.
present?
.bs-callout.bs-callout-danger
%h4
Found errors in your .gitlab-ci.yml:
%ul
-
@ci_commit
.
yaml_errors
.
split
(
","
).
each
do
|
error
|
%li
=
error
-
if
@ci_commit
.
gl_project
.
builds_enabled?
&&
!
@ci_commit
.
ci_yaml_file
.bs-callout.bs-callout-warning
\.gitlab-ci.yml not found in this commit
.table-holder
%table
.table.builds
%thead
%tr
%th
Status
%th
Build ID
%th
Ref
%th
Stage
%th
Name
%th
Duration
%th
Finished at
-
if
@ci_project
&&
@ci_project
.
coverage_enabled?
%th
Coverage
%th
-
@ci_commit
.
refs
.
each
do
|
ref
|
=
render
partial:
"projects/commit_statuses/commit_status"
,
collection:
@ci_commit
.
statuses
.
for_ref
(
ref
).
latest
.
ordered
,
locals:
{
coverage:
@ci_project
.
try
(
:coverage_enabled?
),
stage:
true
,
allow_retry:
true
}
-
if
@ci_commit
.
retried
.
any?
.gray-content-block.second-block
Retried builds
.table-holder
%table
.table.builds
%thead
%tr
%th
Status
%th
Build ID
%th
Ref
%th
Stage
%th
Name
%th
Duration
%th
Finished at
-
if
@ci_project
&&
@ci_project
.
coverage_enabled?
%th
Coverage
%th
=
render
partial:
"projects/commit_statuses/commit_status"
,
collection:
@ci_commit
.
retried
,
locals:
{
coverage:
@ci_project
.
try
(
:coverage_enabled?
),
stage:
true
}
app/views/projects/commit/_ci_menu.html.haml
View file @
a17ba43b
...
...
@@ -6,4 +6,4 @@
=
nav_link
(
path:
'commit#builds'
)
do
=
link_to
builds_namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
.
id
)
do
Builds
%span
.badge
=
@
builds
.
count
(
:id
)
%span
.badge
=
@
statuses
.
count
app/views/projects/commit/builds.html.haml
View file @
a17ba43b
...
...
@@ -3,70 +3,4 @@
=
render
"commit_box"
=
render
"ci_menu"
-
if
@ci_commit
.
yaml_errors
.
present?
.bs-callout.bs-callout-danger
%h4
Found errors in your .gitlab-ci.yml:
%ul
-
@ci_commit
.
yaml_errors
.
split
(
","
).
each
do
|
error
|
%li
=
error
-
unless
@ci_commit
.
ci_yaml_file
.bs-callout.bs-callout-warning
\.gitlab-ci.yml not found in this commit
.gray-content-block.second-block
Latest builds
.pull-right
-
if
@ci_commit
.
duration
>
0
%i
.fa.fa-time
#{
time_interval_in_words
@ci_commit
.
duration
}
-
if
@ci_project
&&
current_user
&&
can?
(
current_user
,
:manage_builds
,
@project
)
-
if
@ci_commit
.
builds
.
latest
.
failed
.
any?
(
&
:retryable?
)
=
link_to
"Retry failed"
,
retry_builds_namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
.
sha
),
class:
'btn btn-xs btn-primary'
,
method: :post
-
if
@ci_commit
.
builds
.
running_or_pending
.
any?
=
link_to
"Cancel running"
,
cancel_builds_namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
.
sha
),
class:
'btn btn-xs btn-danger'
,
method: :post
.table-holder
%table
.table.builds
%thead
%tr
%th
Status
%th
Build ID
%th
Ref
%th
Stage
%th
Name
%th
Duration
%th
Finished at
-
if
@ci_project
&&
@ci_project
.
coverage_enabled?
%th
Coverage
%th
-
@ci_commit
.
refs
.
each
do
|
ref
|
=
render
partial:
"projects/commit_statuses/commit_status"
,
collection:
@ci_commit
.
statuses
.
for_ref
(
ref
).
latest
.
ordered
,
locals:
{
coverage:
@ci_project
.
try
(
:coverage_enabled?
),
stage:
true
,
allow_retry:
true
}
-
if
@ci_commit
.
retried
.
any?
.gray-content-block.second-block
Retried builds
.table-holder
%table
.table.builds
%thead
%tr
%th
Status
%th
Build ID
%th
Ref
%th
Stage
%th
Name
%th
Duration
%th
Finished at
-
if
@ci_project
&&
@ci_project
.
coverage_enabled?
%th
Coverage
%th
=
render
partial:
"projects/commit_statuses/commit_status"
,
collection:
@ci_commit
.
retried
,
locals:
{
coverage:
@ci_project
.
try
(
:coverage_enabled?
),
stage:
true
}
=
render
"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