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
Tatuya Kamada
gitlab-ce
Commits
08baa998
Commit
08baa998
authored
Jun 03, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use pipelines in context of Project
parent
0a51c954
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
20 additions
and
20 deletions
+20
-20
app/views/projects/commit/_commit_box.html.haml
app/views/projects/commit/_commit_box.html.haml
+3
-3
app/views/projects/graphs/ci/_overall.haml
app/views/projects/graphs/ci/_overall.haml
+1
-1
app/views/projects/issues/_merge_requests.html.haml
app/views/projects/issues/_merge_requests.html.haml
+2
-2
app/views/projects/issues/_related_branches.html.haml
app/views/projects/issues/_related_branches.html.haml
+3
-3
app/views/projects/merge_requests/_merge_request.html.haml
app/views/projects/merge_requests/_merge_request.html.haml
+2
-2
app/views/projects/merge_requests/widget/_show.html.haml
app/views/projects/merge_requests/widget/_show.html.haml
+1
-1
app/views/projects/pipelines/_head.html.haml
app/views/projects/pipelines/_head.html.haml
+1
-1
db/fixtures/development/14_builds.rb
db/fixtures/development/14_builds.rb
+1
-1
lib/api/builds.rb
lib/api/builds.rb
+1
-1
lib/api/commit_statuses.rb
lib/api/commit_statuses.rb
+2
-2
spec/requests/api/builds_spec.rb
spec/requests/api/builds_spec.rb
+1
-1
spec/requests/api/commits_spec.rb
spec/requests/api/commits_spec.rb
+1
-1
spec/services/ci/image_for_build_service_spec.rb
spec/services/ci/image_for_build_service_spec.rb
+1
-1
No files found.
app/views/projects/commit/_commit_box.html.haml
View file @
08baa998
...
@@ -53,13 +53,13 @@
...
@@ -53,13 +53,13 @@
-
if
@commit
.
status
-
if
@commit
.
status
.commit-info-row
.commit-info-row
Builds for
Builds for
=
pluralize
(
@commit
.
ci_commit
s
.
count
,
'pipeline'
)
=
pluralize
(
@commit
.
pipeline
s
.
count
,
'pipeline'
)
=
link_to
builds_namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
.
id
),
class:
"ci-status-link ci-status-icon-
#{
@commit
.
status
}
"
do
=
link_to
builds_namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
.
id
),
class:
"ci-status-link ci-status-icon-
#{
@commit
.
status
}
"
do
=
ci_icon_for_status
(
@commit
.
status
)
=
ci_icon_for_status
(
@commit
.
status
)
=
ci_label_for_status
(
@commit
.
status
)
=
ci_label_for_status
(
@commit
.
status
)
-
if
@commit
.
ci_commit
s
.
duration
-
if
@commit
.
pipeline
s
.
duration
in
in
=
time_interval_in_words
@commit
.
ci_commit
s
.
duration
=
time_interval_in_words
@commit
.
pipeline
s
.
duration
.commit-box.content-block
.commit-box.content-block
%h3
.commit-title
%h3
.commit-title
...
...
app/views/projects/graphs/ci/_overall.haml
View file @
08baa998
...
@@ -16,4 +16,4 @@
...
@@ -16,4 +16,4 @@
%li
%li
Commits covered:
Commits covered:
%strong
%strong
=
@project
.
ci_commit
s
.
count
(
:all
)
=
@project
.
pipeline
s
.
count
(
:all
)
app/views/projects/issues/_merge_requests.html.haml
View file @
08baa998
...
@@ -6,8 +6,8 @@
...
@@ -6,8 +6,8 @@
-
@merge_requests
.
each
do
|
merge_request
|
-
@merge_requests
.
each
do
|
merge_request
|
%li
%li
%span
.merge-request-ci-status
%span
.merge-request-ci-status
-
if
merge_request
.
ci_commit
-
if
merge_request
.
pipeline
=
render_pipeline_status
(
merge_request
.
ci_commit
)
=
render_pipeline_status
(
merge_request
.
pipeline
)
-
elsif
has_any_ci
-
elsif
has_any_ci
=
icon
(
'blank fw'
)
=
icon
(
'blank fw'
)
%span
.merge-request-id
%span
.merge-request-id
...
...
app/views/projects/issues/_related_branches.html.haml
View file @
08baa998
...
@@ -5,10 +5,10 @@
...
@@ -5,10 +5,10 @@
-
@related_branches
.
each
do
|
branch
|
-
@related_branches
.
each
do
|
branch
|
%li
%li
-
sha
=
@project
.
repository
.
find_branch
(
branch
).
target
-
sha
=
@project
.
repository
.
find_branch
(
branch
).
target
-
ci_commit
=
@project
.
ci_commit
(
sha
,
branch
)
if
sha
-
pipeline
=
@project
.
pipeline
(
sha
,
branch
)
if
sha
-
if
ci_commit
-
if
ci_co
pipeline
mmit
%span
.related-branch-ci-status
%span
.related-branch-ci-status
=
render_pipeline_status
(
ci_commit
)
=
render_pipeline_status
(
pipeline
)
%span
.related-branch-info
%span
.related-branch-info
%strong
%strong
=
link_to
namespace_project_compare_path
(
@project
.
namespace
,
@project
,
from:
@project
.
default_branch
,
to:
branch
),
class:
"label-branch"
do
=
link_to
namespace_project_compare_path
(
@project
.
namespace
,
@project
,
from:
@project
.
default_branch
,
to:
branch
),
class:
"label-branch"
do
...
...
app/views/projects/merge_requests/_merge_request.html.haml
View file @
08baa998
...
@@ -11,9 +11,9 @@
...
@@ -11,9 +11,9 @@
=
icon
(
'ban'
)
=
icon
(
'ban'
)
CLOSED
CLOSED
-
if
merge_request
.
ci_commit
-
if
merge_request
.
pipeline
%li
%li
=
render_pipeline_status
(
merge_request
.
ci_commit
)
=
render_pipeline_status
(
merge_request
.
pipeline
)
-
if
merge_request
.
open?
&&
merge_request
.
broken?
-
if
merge_request
.
open?
&&
merge_request
.
broken?
%li
%li
...
...
app/views/projects/merge_requests/widget/_show.html.haml
View file @
08baa998
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
check_enable
:
#{
@merge_request
.
unchecked?
?
"true"
:
"false"
}
,
check_enable
:
#{
@merge_request
.
unchecked?
?
"true"
:
"false"
}
,
ci_status_url
:
"
#{
ci_status_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
)
}
"
,
ci_status_url
:
"
#{
ci_status_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
)
}
"
,
gitlab_icon
:
"
#{
asset_path
'gitlab_logo.png'
}
"
,
gitlab_icon
:
"
#{
asset_path
'gitlab_logo.png'
}
"
,
ci_status
:
"
#{
@merge_request
.
ci_commit
?
@merge_request
.
ci_commit
.
status
:
''
}
"
,
ci_status
:
"
#{
@merge_request
.
pipeline
?
@merge_request
.
pipeline
.
status
:
''
}
"
,
ci_message
:
{
ci_message
:
{
normal
:
"
Build {{status}} for
\"
{{title}}
\"
"
,
normal
:
"
Build {{status}} for
\"
{{title}}
\"
"
,
preparing
:
"
{{status}} build for
\"
{{title}}
\"
"
preparing
:
"
{{status}} build for
\"
{{title}}
\"
"
...
...
app/views/projects/pipelines/_head.html.haml
View file @
08baa998
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
=
link_to
project_pipelines_path
(
@project
),
title:
'Pipelines'
,
class:
'shortcuts-pipelines'
do
=
link_to
project_pipelines_path
(
@project
),
title:
'Pipelines'
,
class:
'shortcuts-pipelines'
do
%span
%span
Pipelines
Pipelines
%span
.badge.count.ci_counter
=
number_with_delimiter
(
@project
.
ci_commit
s
.
running_or_pending
.
count
)
%span
.badge.count.ci_counter
=
number_with_delimiter
(
@project
.
pipeline
s
.
running_or_pending
.
count
)
-
if
project_nav_tab?
:builds
-
if
project_nav_tab?
:builds
=
nav_link
(
controller:
%w(builds)
)
do
=
nav_link
(
controller:
%w(builds)
)
do
...
...
db/fixtures/development/14_builds.rb
View file @
08baa998
...
@@ -19,7 +19,7 @@ class Gitlab::Seeder::Builds
...
@@ -19,7 +19,7 @@ class Gitlab::Seeder::Builds
commits
=
@project
.
repository
.
commits
(
'master'
,
nil
,
5
)
commits
=
@project
.
repository
.
commits
(
'master'
,
nil
,
5
)
commits_sha
=
commits
.
map
{
|
commit
|
commit
.
raw
.
id
}
commits_sha
=
commits
.
map
{
|
commit
|
commit
.
raw
.
id
}
commits_sha
.
map
do
|
sha
|
commits_sha
.
map
do
|
sha
|
@project
.
ensure_
ci_commit
(
sha
,
'master'
)
@project
.
ensure_
pipeline
(
sha
,
'master'
)
end
end
rescue
rescue
[]
[]
...
...
lib/api/builds.rb
View file @
08baa998
...
@@ -33,7 +33,7 @@ module API
...
@@ -33,7 +33,7 @@ module API
get
':id/repository/commits/:sha/builds'
do
get
':id/repository/commits/:sha/builds'
do
authorize_read_builds!
authorize_read_builds!
commit
=
user_project
.
ci_commit
s
.
find_by_sha
(
params
[
:sha
])
commit
=
user_project
.
pipeline
s
.
find_by_sha
(
params
[
:sha
])
return
not_found!
unless
commit
return
not_found!
unless
commit
builds
=
commit
.
builds
.
order
(
'id DESC'
)
builds
=
commit
.
builds
.
order
(
'id DESC'
)
...
...
lib/api/commit_statuses.rb
View file @
08baa998
...
@@ -22,7 +22,7 @@ module API
...
@@ -22,7 +22,7 @@ module API
not_found!
(
'Commit'
)
unless
user_project
.
commit
(
params
[
:sha
])
not_found!
(
'Commit'
)
unless
user_project
.
commit
(
params
[
:sha
])
ci_commits
=
user_project
.
ci_commit
s
.
where
(
sha:
params
[
:sha
])
ci_commits
=
user_project
.
pipeline
s
.
where
(
sha:
params
[
:sha
])
statuses
=
::
CommitStatus
.
where
(
commit:
ci_commits
)
statuses
=
::
CommitStatus
.
where
(
commit:
ci_commits
)
statuses
=
statuses
.
latest
unless
parse_boolean
(
params
[
:all
])
statuses
=
statuses
.
latest
unless
parse_boolean
(
params
[
:all
])
statuses
=
statuses
.
where
(
ref:
params
[
:ref
])
if
params
[
:ref
].
present?
statuses
=
statuses
.
where
(
ref:
params
[
:ref
])
if
params
[
:ref
].
present?
...
@@ -64,7 +64,7 @@ module API
...
@@ -64,7 +64,7 @@ module API
ref
=
branches
.
first
ref
=
branches
.
first
end
end
ci_commit
=
@project
.
ensure_
ci_commit
(
commit
.
sha
,
ref
)
ci_commit
=
@project
.
ensure_
pipeline
(
commit
.
sha
,
ref
)
name
=
params
[
:name
]
||
params
[
:context
]
name
=
params
[
:name
]
||
params
[
:context
]
status
=
GenericCommitStatus
.
running_or_pending
.
find_by
(
commit:
ci_commit
,
name:
name
,
ref:
params
[
:ref
])
status
=
GenericCommitStatus
.
running_or_pending
.
find_by
(
commit:
ci_commit
,
name:
name
,
ref:
params
[
:ref
])
...
...
spec/requests/api/builds_spec.rb
View file @
08baa998
...
@@ -59,7 +59,7 @@ describe API::API, api: true do
...
@@ -59,7 +59,7 @@ describe API::API, api: true do
describe
'GET /projects/:id/repository/commits/:sha/builds'
do
describe
'GET /projects/:id/repository/commits/:sha/builds'
do
before
do
before
do
project
.
ensure_
ci_commit
(
commit
.
sha
,
'master'
)
project
.
ensure_
pipeline
(
commit
.
sha
,
'master'
)
get
api
(
"/projects/
#{
project
.
id
}
/repository/commits/
#{
commit
.
sha
}
/builds"
,
api_user
)
get
api
(
"/projects/
#{
project
.
id
}
/repository/commits/
#{
commit
.
sha
}
/builds"
,
api_user
)
end
end
...
...
spec/requests/api/commits_spec.rb
View file @
08baa998
...
@@ -90,7 +90,7 @@ describe API::API, api: true do
...
@@ -90,7 +90,7 @@ describe API::API, api: true do
end
end
it
"should return status for CI"
do
it
"should return status for CI"
do
ci_commit
=
project
.
ensure_
ci_commit
(
project
.
repository
.
commit
.
sha
,
'master'
)
ci_commit
=
project
.
ensure_
pipeline
(
project
.
repository
.
commit
.
sha
,
'master'
)
get
api
(
"/projects/
#{
project
.
id
}
/repository/commits/
#{
project
.
repository
.
commit
.
id
}
"
,
user
)
get
api
(
"/projects/
#{
project
.
id
}
/repository/commits/
#{
project
.
repository
.
commit
.
id
}
"
,
user
)
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
json_response
[
'status'
]).
to
eq
(
ci_commit
.
status
)
expect
(
json_response
[
'status'
]).
to
eq
(
ci_commit
.
status
)
...
...
spec/services/ci/image_for_build_service_spec.rb
View file @
08baa998
...
@@ -5,7 +5,7 @@ module Ci
...
@@ -5,7 +5,7 @@ module Ci
let
(
:service
)
{
ImageForBuildService
.
new
}
let
(
:service
)
{
ImageForBuildService
.
new
}
let
(
:project
)
{
FactoryGirl
.
create
(
:empty_project
)
}
let
(
:project
)
{
FactoryGirl
.
create
(
:empty_project
)
}
let
(
:commit_sha
)
{
'01234567890123456789'
}
let
(
:commit_sha
)
{
'01234567890123456789'
}
let
(
:commit
)
{
project
.
ensure_
ci_commit
(
commit_sha
,
'master'
)
}
let
(
:commit
)
{
project
.
ensure_
pipeline
(
commit_sha
,
'master'
)
}
let
(
:build
)
{
FactoryGirl
.
create
(
:ci_build
,
pipeline:
commit
)
}
let
(
:build
)
{
FactoryGirl
.
create
(
:ci_build
,
pipeline:
commit
)
}
describe
:execute
do
describe
:execute
do
...
...
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