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
Jérome Perrin
gitlab-ce
Commits
406a796f
Commit
406a796f
authored
Apr 12, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make Pipeline view work
parent
e84c155f
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
48 additions
and
26 deletions
+48
-26
app/assets/stylesheets/framework/tables.scss
app/assets/stylesheets/framework/tables.scss
+19
-0
app/controllers/projects/pipelines_controller.rb
app/controllers/projects/pipelines_controller.rb
+1
-1
app/helpers/ci_status_helper.rb
app/helpers/ci_status_helper.rb
+1
-1
app/helpers/gitlab_routing_helper.rb
app/helpers/gitlab_routing_helper.rb
+1
-1
app/models/ci/commit.rb
app/models/ci/commit.rb
+4
-0
app/views/layouts/nav/_project.html.haml
app/views/layouts/nav/_project.html.haml
+1
-1
app/views/projects/ci/commits/_commit.html.haml
app/views/projects/ci/commits/_commit.html.haml
+10
-11
app/views/projects/ci_commits/_header_title.html.haml
app/views/projects/ci_commits/_header_title.html.haml
+0
-1
app/views/projects/pipelines/_header_title.html.haml
app/views/projects/pipelines/_header_title.html.haml
+1
-0
app/views/projects/pipelines/index.html.haml
app/views/projects/pipelines/index.html.haml
+7
-7
app/views/projects/pipelines/new.html.haml
app/views/projects/pipelines/new.html.haml
+2
-2
spec/models/project_spec.rb
spec/models/project_spec.rb
+1
-1
No files found.
app/assets/stylesheets/framework/tables.scss
View file @
406a796f
...
@@ -34,6 +34,25 @@ table {
...
@@ -34,6 +34,25 @@ table {
font-weight
:
normal
;
font-weight
:
normal
;
font-size
:
15px
;
font-size
:
15px
;
border-bottom
:
1px
solid
$border-color
;
border-bottom
:
1px
solid
$border-color
;
.rotate
{
height
:
140px
;
white-space
:
nowrap
;
}
.rotate
>
div
{
transform
:
/*
Magic
Numbers
*/
translate
(
25px
,
51px
)
/*
45
is
really
360
-
45
*/
rotate
(
315deg
);
width
:
30px
;
}
.rotate
>
div
>
span
{
border-bottom
:
1px
solid
#ccc
;
padding
:
5px
10px
;
}
}
}
td
{
td
{
...
...
app/controllers/projects/pipelines_controller.rb
View file @
406a796f
class
Projects::PipelineController
<
Projects
::
ApplicationController
class
Projects::Pipeline
s
Controller
<
Projects
::
ApplicationController
before_action
:ci_commit
,
except:
[
:index
,
:new
,
:create
]
before_action
:ci_commit
,
except:
[
:index
,
:new
,
:create
]
before_action
:authorize_read_pipeline!
before_action
:authorize_read_pipeline!
before_action
:authorize_create_pipeline!
,
only:
[
:new
,
:create
]
before_action
:authorize_create_pipeline!
,
only:
[
:new
,
:create
]
...
...
app/helpers/ci_status_helper.rb
View file @
406a796f
...
@@ -37,7 +37,7 @@ module CiStatusHelper
...
@@ -37,7 +37,7 @@ module CiStatusHelper
return
unless
ci_commit
.
is_a?
(
Commit
)
||
ci_commit
.
is_a?
(
Ci
::
Commit
)
return
unless
ci_commit
.
is_a?
(
Commit
)
||
ci_commit
.
is_a?
(
Ci
::
Commit
)
link_to
ci_icon_for_status
(
ci_commit
.
status
),
link_to
ci_icon_for_status
(
ci_commit
.
status
),
project_
ci_commit
_path
(
ci_commit
.
project
,
ci_commit
),
project_
pipeline
_path
(
ci_commit
.
project
,
ci_commit
),
class:
"ci-status-link ci-status-icon-
#{
ci_commit
.
status
.
dasherize
}
"
,
class:
"ci-status-link ci-status-icon-
#{
ci_commit
.
status
.
dasherize
}
"
,
title:
"Build
#{
ci_label_for_status
(
ci_commit
.
status
)
}
"
,
title:
"Build
#{
ci_label_for_status
(
ci_commit
.
status
)
}
"
,
data:
{
toggle:
'tooltip'
,
placement:
tooltip_placement
}
data:
{
toggle:
'tooltip'
,
placement:
tooltip_placement
}
...
...
app/helpers/gitlab_routing_helper.rb
View file @
406a796f
...
@@ -37,7 +37,7 @@ module GitlabRoutingHelper
...
@@ -37,7 +37,7 @@ module GitlabRoutingHelper
builds_namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
.
id
)
builds_namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
.
id
)
end
end
def
project_
ci_commit
_path
(
project
,
ci_commit
)
def
project_
pipeline
_path
(
project
,
ci_commit
)
builds_namespace_project_commit_path
(
project
.
namespace
,
project
,
ci_commit
.
sha
)
builds_namespace_project_commit_path
(
project
.
namespace
,
project
,
ci_commit
.
sha
)
end
end
...
...
app/models/ci/commit.rb
View file @
406a796f
...
@@ -94,6 +94,10 @@ module Ci
...
@@ -94,6 +94,10 @@ module Ci
end
end
end
end
def
triggered?
trigger_requests
.
any?
end
def
invalidate
def
invalidate
write_attribute
(
:status
,
nil
)
write_attribute
(
:status
,
nil
)
write_attribute
(
:started_at
,
nil
)
write_attribute
(
:started_at
,
nil
)
...
...
app/views/layouts/nav/_project.html.haml
View file @
406a796f
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
-
if
project_nav_tab?
:builds
-
if
project_nav_tab?
:builds
=
nav_link
(
controller:
%w(ci_commits)
)
do
=
nav_link
(
controller:
%w(ci_commits)
)
do
=
link_to
project_
ci_commit
s_path
(
@project
),
title:
'Pipelines'
,
class:
'shortcuts-builds'
do
=
link_to
project_
pipeline
s_path
(
@project
),
title:
'Pipelines'
,
class:
'shortcuts-builds'
do
=
icon
(
'ship fw'
)
=
icon
(
'ship fw'
)
%span
%span
Pipelines
Pipelines
...
...
app/views/projects/ci/commits/_commit.html.haml
View file @
406a796f
-
status
=
commit
.
status
-
status
=
commit
.
status
%tr
.commit
%tr
.commit
%td
.commit-link
%td
.commit-link
=
link_to
namespace_project_commit_
url
(
@project
.
namespace
,
@project
,
commit
),
class:
"ci-status ci-
#{
status
}
"
do
=
link_to
namespace_project_commit_
path
(
@project
.
namespace
,
@project
,
commit
.
sha
),
class:
"ci-status ci-
#{
status
}
"
do
=
ci_icon_for_status
(
status
)
=
ci_icon_for_status
(
status
)
%strong
##{commit.id}
%strong
##{commit.id}
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
%span
.label.label-primary
tag
%span
.label.label-primary
tag
-
if
commit
.
branch?
-
if
commit
.
branch?
%span
.label.label-primary
branch
%span
.label.label-primary
branch
-
if
commit
.
trigger
_requests
.
any
?
-
if
commit
.
trigger
ed
?
%span
.label.label-primary
triggered
%span
.label.label-primary
triggered
-
if
commit
.
yaml_errors
.
present?
-
if
commit
.
yaml_errors
.
present?
%span
.label.label-danger.has-tooltip
(
title=
"#{commit.yaml_errors}"
) yaml invalid
%span
.label.label-danger.has-tooltip
(
title=
"#{commit.yaml_errors}"
) yaml invalid
...
@@ -27,22 +27,21 @@
...
@@ -27,22 +27,21 @@
%p
%p
Cant find HEAD commit for this branch
Cant find HEAD commit for this branch
-
stages_status
=
commit
.
statuses
.
stages_status
-
stages
.
each
do
|
stage
|
-
stages
.
each
do
|
stage
|
%td
%td
-
status
=
commit
.
statuses
.
latest
.
where
(
stage:
stage
).
status
-
if
status
=
stages_status
[
stage
]
%span
.has-tooltip
(
title=
"#{status || "
missing
"}"
)
{
class:
"ci-status-icon-#{status || "
skipped
"}"
}
%span
.has-tooltip
(
title=
"#{status}"
)
{
class:
"ci-status-icon-#{status}"
}
=
ci_icon_for_status
(
status
||
"missing"
)
=
ci_icon_for_status
(
status
)
-#- if status
-# = ci_status_with_icon(status)
-#- else
-# = ci_status_with_icon('missing')
%td
%td
-
if
commit
.
started_at
&&
commit
.
finished_at
-
if
commit
.
started_at
&&
commit
.
finished_at
%p
%p
%i
.fa.fa-late-o
#{
duration_in_words
(
commit
.
finished_at
,
commit
.
started_at
)
}
#{
duration_in_words
(
commit
.
finished_at
,
commit
.
started_at
)
}
-
if
commit
.
finished_at
-
if
commit
.
finished_at
%p
%p
%i
.fa.fa-date-o
#{
time_ago_with_tooltip
(
commit
.
finished_at
)
}
#{
time_ago_with_tooltip
(
commit
.
finished_at
)
}
%td
.content
%td
.content
...
@@ -63,11 +62,11 @@
...
@@ -63,11 +62,11 @@
-
if
can?
(
current_user
,
:update_pipeline
,
@project
)
-
if
can?
(
current_user
,
:update_pipeline
,
@project
)
-
if
commit
.
retryable?
-
if
commit
.
retryable?
=
link_to
retry_namespace_project_
ci_commit
_path
(
@project
.
namespace
,
@project
,
commit
.
id
),
class:
'btn has-tooltip'
,
title:
"Retry"
,
method: :post
do
=
link_to
retry_namespace_project_
pipeline
_path
(
@project
.
namespace
,
@project
,
commit
.
id
),
class:
'btn has-tooltip'
,
title:
"Retry"
,
method: :post
do
=
icon
(
"repeat"
)
=
icon
(
"repeat"
)
-
if
commit
.
active?
-
if
commit
.
active?
=
link_to
cancel_namespace_project_
ci_commit
_path
(
@project
.
namespace
,
@project
,
commit
.
id
),
class:
'btn btn-remove has-tooltip'
,
title:
"Cancel"
,
method: :post
do
=
link_to
cancel_namespace_project_
pipeline
_path
(
@project
.
namespace
,
@project
,
commit
.
id
),
class:
'btn btn-remove has-tooltip'
,
title:
"Cancel"
,
method: :post
do
=
icon
(
"remove cred"
)
=
icon
(
"remove cred"
)
app/views/projects/ci_commits/_header_title.html.haml
deleted
100644 → 0
View file @
e84c155f
-
header_title
project_title
(
@project
,
"Pipelines"
,
project_ci_commits_path
(
@project
))
app/views/projects/pipelines/_header_title.html.haml
0 → 100644
View file @
406a796f
-
header_title
project_title
(
@project
,
"Pipelines"
,
project_pipelines_path
(
@project
))
app/views/projects/
ci_commit
s/index.html.haml
→
app/views/projects/
pipeline
s/index.html.haml
View file @
406a796f
...
@@ -4,32 +4,32 @@
...
@@ -4,32 +4,32 @@
.top-area
.top-area
%ul
.nav-links
%ul
.nav-links
%li
{
class:
(
'active'
if
@scope
.
nil?
)}
%li
{
class:
(
'active'
if
@scope
.
nil?
)}
=
link_to
project_
ci_commit
s_path
(
@project
)
do
=
link_to
project_
pipeline
s_path
(
@project
)
do
All
All
%span
.badge.js-totalbuilds-count
%span
.badge.js-totalbuilds-count
=
number_with_delimiter
(
@all_commits
.
count
(
:id
))
=
number_with_delimiter
(
@all_commits
.
count
(
:id
))
%li
{
class:
(
'active'
if
@scope
==
'branches'
)}
%li
{
class:
(
'active'
if
@scope
==
'branches'
)}
=
link_to
project_
ci_commit
s_path
(
@project
,
scope: :branches
)
do
=
link_to
project_
pipeline
s_path
(
@project
,
scope: :branches
)
do
Branches
Branches
%span
.badge.js-running-count
%span
.badge.js-running-count
=
number_with_delimiter
(
@all_commits
.
running_or_pending
.
count
(
:id
))
=
number_with_delimiter
(
@all_commits
.
running_or_pending
.
count
(
:id
))
%li
{
class:
(
'active'
if
@scope
==
'tags'
)}
%li
{
class:
(
'active'
if
@scope
==
'tags'
)}
=
link_to
project_
ci_commit
s_path
(
@project
,
scope: :tags
)
do
=
link_to
project_
pipeline
s_path
(
@project
,
scope: :tags
)
do
Tags
Tags
%span
.badge.js-running-count
%span
.badge.js-running-count
=
number_with_delimiter
(
@all_commits
.
running_or_pending
.
count
(
:id
))
=
number_with_delimiter
(
@all_commits
.
running_or_pending
.
count
(
:id
))
%li
{
class:
(
'active'
if
@scope
==
'running'
)}
%li
{
class:
(
'active'
if
@scope
==
'running'
)}
=
link_to
project_
ci_commit
s_path
(
@project
,
scope: :running
)
do
=
link_to
project_
pipeline
s_path
(
@project
,
scope: :running
)
do
Failed
Failed
%span
.badge.js-running-count
%span
.badge.js-running-count
=
number_with_delimiter
(
@all_commits
.
running_or_pending
.
count
(
:id
))
=
number_with_delimiter
(
@all_commits
.
running_or_pending
.
count
(
:id
))
.nav-controls
.nav-controls
-
if
can?
current_user
,
:create_pipeline
,
@project
-
if
can?
current_user
,
:create_pipeline
,
@project
=
link_to
new_namespace_project_
ci_commit
_path
(
@project
.
namespace
,
@project
),
class:
'btn btn-create'
do
=
link_to
new_namespace_project_
pipeline
_path
(
@project
.
namespace
,
@project
),
class:
'btn btn-create'
do
=
icon
(
'plus'
)
=
icon
(
'plus'
)
New
New
...
@@ -56,10 +56,10 @@
...
@@ -56,10 +56,10 @@
%th
Pipeline ID
%th
Pipeline ID
%th
Commit
%th
Commit
-
@commits
.
stages
.
each
do
|
stage
|
-
@commits
.
stages
.
each
do
|
stage
|
%th
%th
.rotate
=
stage
.
titleize
=
stage
.
titleize
%th
%th
%th
%th
=
render
@commits
.
includes
(
:statuses
).
includes
(
:builds
)
,
commit_sha:
true
,
stage:
true
,
allow_retry:
true
,
stages:
stages
=
render
@commits
,
commit_sha:
true
,
stage:
true
,
allow_retry:
true
,
stages:
stages
=
paginate
@commits
,
theme:
'gitlab'
=
paginate
@commits
,
theme:
'gitlab'
app/views/projects/
ci_commit
s/new.html.haml
→
app/views/projects/
pipeline
s/new.html.haml
View file @
406a796f
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
New Pipeline
New Pipeline
%hr
%hr
=
form_tag
namespace_project_
ci_commit
s_path
,
method: :post
,
id:
"new-pipeline-form"
,
class:
"form-horizontal js-create-branch-form js-requires-input"
do
=
form_tag
namespace_project_
pipeline
s_path
,
method: :post
,
id:
"new-pipeline-form"
,
class:
"form-horizontal js-create-branch-form js-requires-input"
do
.form-group
.form-group
=
label_tag
:ref
,
'Create for'
,
class:
'control-label'
=
label_tag
:ref
,
'Create for'
,
class:
'control-label'
.col-sm-10
.col-sm-10
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
.help-block
Existing branch name, tag
.help-block
Existing branch name, tag
.form-actions
.form-actions
=
button_tag
'Create pipeline'
,
class:
'btn btn-create'
,
tabindex:
3
=
button_tag
'Create pipeline'
,
class:
'btn btn-create'
,
tabindex:
3
=
link_to
'Cancel'
,
namespace_project_
ci_commit
s_path
(
@project
.
namespace
,
@project
),
class:
'btn btn-cancel'
=
link_to
'Cancel'
,
namespace_project_
pipeline
s_path
(
@project
.
namespace
,
@project
),
class:
'btn btn-cancel'
:javascript
:javascript
var
availableRefs
=
#{
@project
.
repository
.
ref_names
.
to_json
}
;
var
availableRefs
=
#{
@project
.
repository
.
ref_names
.
to_json
}
;
...
...
spec/models/project_spec.rb
View file @
406a796f
...
@@ -62,7 +62,7 @@ describe Project, models: true do
...
@@ -62,7 +62,7 @@ describe Project, models: true do
it
{
is_expected
.
to
have_one
(
:pushover_service
).
dependent
(
:destroy
)
}
it
{
is_expected
.
to
have_one
(
:pushover_service
).
dependent
(
:destroy
)
}
it
{
is_expected
.
to
have_one
(
:asana_service
).
dependent
(
:destroy
)
}
it
{
is_expected
.
to
have_one
(
:asana_service
).
dependent
(
:destroy
)
}
it
{
is_expected
.
to
have_many
(
:commit_statuses
)
}
it
{
is_expected
.
to
have_many
(
:commit_statuses
)
}
it
{
is_expected
.
to
have_many
(
:
ci_commit
s
)
}
it
{
is_expected
.
to
have_many
(
:
pipeline
s
)
}
it
{
is_expected
.
to
have_many
(
:builds
)
}
it
{
is_expected
.
to
have_many
(
:builds
)
}
it
{
is_expected
.
to
have_many
(
:runner_projects
)
}
it
{
is_expected
.
to
have_many
(
:runner_projects
)
}
it
{
is_expected
.
to
have_many
(
:runners
)
}
it
{
is_expected
.
to
have_many
(
:runners
)
}
...
...
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