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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
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 {
font-weight
:
normal
;
font-size
:
15px
;
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
{
...
...
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
:authorize_read_pipeline!
before_action
:authorize_create_pipeline!
,
only:
[
:new
,
:create
]
...
...
app/helpers/ci_status_helper.rb
View file @
406a796f
...
...
@@ -37,7 +37,7 @@ module CiStatusHelper
return
unless
ci_commit
.
is_a?
(
Commit
)
||
ci_commit
.
is_a?
(
Ci
::
Commit
)
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
}
"
,
title:
"Build
#{
ci_label_for_status
(
ci_commit
.
status
)
}
"
,
data:
{
toggle:
'tooltip'
,
placement:
tooltip_placement
}
...
...
app/helpers/gitlab_routing_helper.rb
View file @
406a796f
...
...
@@ -37,7 +37,7 @@ module GitlabRoutingHelper
builds_namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
.
id
)
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
)
end
...
...
app/models/ci/commit.rb
View file @
406a796f
...
...
@@ -94,6 +94,10 @@ module Ci
end
end
def
triggered?
trigger_requests
.
any?
end
def
invalidate
write_attribute
(
:status
,
nil
)
write_attribute
(
:started_at
,
nil
)
...
...
app/views/layouts/nav/_project.html.haml
View file @
406a796f
...
...
@@ -40,7 +40,7 @@
-
if
project_nav_tab?
:builds
=
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'
)
%span
Pipelines
...
...
app/views/projects/ci/commits/_commit.html.haml
View file @
406a796f
-
status
=
commit
.
status
%tr
.commit
%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
)
%strong
##{commit.id}
...
...
@@ -14,7 +14,7 @@
%span
.label.label-primary
tag
-
if
commit
.
branch?
%span
.label.label-primary
branch
-
if
commit
.
trigger
_requests
.
any
?
-
if
commit
.
trigger
ed
?
%span
.label.label-primary
triggered
-
if
commit
.
yaml_errors
.
present?
%span
.label.label-danger.has-tooltip
(
title=
"#{commit.yaml_errors}"
) yaml invalid
...
...
@@ -27,22 +27,21 @@
%p
Cant find HEAD commit for this branch
-
stages_status
=
commit
.
statuses
.
stages_status
-
stages
.
each
do
|
stage
|
%td
-
status
=
commit
.
statuses
.
latest
.
where
(
stage:
stage
).
status
%span
.has-tooltip
(
title=
"#{status || "
missing
"}"
)
{
class:
"ci-status-icon-#{status || "
skipped
"}"
}
=
ci_icon_for_status
(
status
||
"missing"
)
-#- if status
-# = ci_status_with_icon(status)
-#- else
-# = ci_status_with_icon('missing')
-
if
status
=
stages_status
[
stage
]
%span
.has-tooltip
(
title=
"#{status}"
)
{
class:
"ci-status-icon-#{status}"
}
=
ci_icon_for_status
(
status
)
%td
-
if
commit
.
started_at
&&
commit
.
finished_at
%p
%i
.fa.fa-late-o
#{
duration_in_words
(
commit
.
finished_at
,
commit
.
started_at
)
}
-
if
commit
.
finished_at
%p
%i
.fa.fa-date-o
#{
time_ago_with_tooltip
(
commit
.
finished_at
)
}
%td
.content
...
...
@@ -63,11 +62,11 @@
-
if
can?
(
current_user
,
:update_pipeline
,
@project
)
-
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"
)
-
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"
)
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 @@
.top-area
%ul
.nav-links
%li
{
class:
(
'active'
if
@scope
.
nil?
)}
=
link_to
project_
ci_commit
s_path
(
@project
)
do
=
link_to
project_
pipeline
s_path
(
@project
)
do
All
%span
.badge.js-totalbuilds-count
=
number_with_delimiter
(
@all_commits
.
count
(
:id
))
%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
%span
.badge.js-running-count
=
number_with_delimiter
(
@all_commits
.
running_or_pending
.
count
(
:id
))
%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
%span
.badge.js-running-count
=
number_with_delimiter
(
@all_commits
.
running_or_pending
.
count
(
:id
))
%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
%span
.badge.js-running-count
=
number_with_delimiter
(
@all_commits
.
running_or_pending
.
count
(
:id
))
.nav-controls
-
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'
)
New
...
...
@@ -56,10 +56,10 @@
%th
Pipeline ID
%th
Commit
-
@commits
.
stages
.
each
do
|
stage
|
%th
%th
.rotate
=
stage
.
titleize
%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'
app/views/projects/
ci_commit
s/new.html.haml
→
app/views/projects/
pipeline
s/new.html.haml
View file @
406a796f
...
...
@@ -9,7 +9,7 @@
New Pipeline
%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
=
label_tag
:ref
,
'Create for'
,
class:
'control-label'
.col-sm-10
...
...
@@ -17,7 +17,7 @@
.help-block
Existing branch name, tag
.form-actions
=
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
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
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_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
(
:runner_projects
)
}
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