BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
59058a25
Commit
59058a25
authored
Oct 06, 2015
by
Kamil Trzciński
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix-ci-bugs' into 'master'
Fix CI regressions introduced by ci_commit changes /cc @dzaporozhets See merge request !1518
parents
4b8101dc
065fe557
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
15 deletions
+26
-15
projects_controller.rb
app/controllers/ci/projects_controller.rb
+5
-3
build.rb
app/models/ci/build.rb
+1
-1
commit.rb
app/models/ci/commit.rb
+1
-1
_commit.html.haml
app/views/ci/commits/_commit.html.haml
+2
-1
show.html.haml
app/views/ci/commits/show.html.haml
+17
-9
No files found.
app/controllers/ci/projects_controller.rb
View file @
59058a25
...
...
@@ -14,9 +14,11 @@ module Ci
def
show
@ref
=
params
[
:ref
]
@commits
=
@project
.
commits
.
reverse_order
# TODO: this is broken
# @commits = @commits.where(ref: @ref) if @ref
@commits
=
@project
.
commits
.
group
(
:sha
).
reverse_order
if
@ref
builds
=
@project
.
builds
.
where
(
ref:
@ref
).
select
(
:commit_id
).
distinct
@commits
=
@commits
.
where
(
id:
builds
)
end
@commits
=
@commits
.
page
(
params
[
:page
]).
per
(
20
)
end
...
...
app/models/ci/build.rb
View file @
59058a25
...
...
@@ -47,7 +47,7 @@ module Ci
scope
:failed
,
->
()
{
where
(
status:
"failed"
)
}
scope
:unstarted
,
->
()
{
where
(
runner_id:
nil
)
}
scope
:running_or_pending
,
->
()
{
where
(
status
:[
:running
,
:pending
])
}
scope
:latest
,
->
()
{
where
(
id:
unscope
(
:select
).
select
(
'max(id)'
).
group
(
:name
)).
order
(
stage_idx: :asc
)
}
scope
:latest
,
->
()
{
where
(
id:
unscope
(
:select
).
select
(
'max(id)'
).
group
(
:name
,
:ref
)).
order
(
stage_idx: :asc
)
}
scope
:ignore_failures
,
->
()
{
where
(
allow_failure:
false
)
}
scope
:for_ref
,
->
(
ref
)
{
where
(
ref:
ref
)
}
scope
:similar
,
->
(
build
)
{
where
(
ref:
build
.
ref
,
tag:
build
.
tag
,
trigger_request_id:
build
.
trigger_request_id
)
}
...
...
app/models/ci/commit.rb
View file @
59058a25
...
...
@@ -211,7 +211,7 @@ module Ci
end
def
ci_yaml_file
gl_project
.
repository
.
blob_at
(
sha
,
'.gitlab-ci.yml'
)
gl_project
.
repository
.
blob_at
(
sha
,
'.gitlab-ci.yml'
)
.
data
rescue
nil
end
...
...
app/views/ci/commits/_commit.html.haml
View file @
59058a25
...
...
@@ -16,7 +16,8 @@
%td
.build-branch
-
unless
@ref
%span
=
link_to
truncate
(
commit
.
last_ref
,
length:
25
),
ci_project_path
(
@project
,
ref:
commit
.
last_ref
)
-
commit
.
refs
.
each
do
|
ref
|
=
link_to
truncate
(
ref
,
length:
25
),
ci_project_path
(
@project
,
ref:
ref
)
%td
.duration
-
if
commit
.
duration
>
0
...
...
app/views/ci/commits/show.html.haml
View file @
59058a25
...
...
@@ -4,14 +4,22 @@
.gray-content-block.middle-block
%pre
.commit-message
#{
@commit
.
git_commit_message
}
-
if
@commit
.
git_commit_message
#{
@commit
.
git_commit_message
}
-
else
No commit message
.gray-content-block.second-block
.row
.col-sm-6
%p
%span
.attr-name
Commit:
#{
gitlab_commit_link
(
@project
,
@commit
.
sha
)
}
%p
%span
.attr-name
Commit:
#{
gitlab_commit_link
(
@project
,
@commit
.
sha
)
}
%p
-
if
@commit
.
refs
.
present?
%span
.attr-name
Refs:
-
@commit
.
refs
.
each
do
|
ref
|
#{
gitlab_ref_link
(
@project
,
ref
)
}
.col-sm-6
-
if
@commit
.
git_author_name
||
@commit
.
git_author_email
%p
...
...
@@ -22,10 +30,10 @@
%span
.attr-name
Created at:
#{
@commit
.
created_at
.
to_s
(
:short
)
}
-
if
current_user
&&
can?
(
current_user
,
:manage_builds
,
gl_project
)
.pull-right
-
if
@commit
.
builds
.
running_or_pending
.
any?
=
link_to
"Cancel"
,
cancel_ci_project_commits_path
(
@project
,
@commit
),
class:
'btn btn-sm btn-danger'
-
if
current_user
&&
can?
(
current_user
,
:manage_builds
,
gl_project
)
-
if
@commit
.
builds
.
running_or_pending
.
any?
.pull-right
=
link_to
"Cancel"
,
cancel_ci_project_commits_path
(
@project
,
@commit
),
class:
'btn btn-sm btn-danger'
-
if
@commit
.
yaml_errors
.
present?
...
...
@@ -41,7 +49,7 @@
-
@commit
.
refs
.
each
do
|
ref
|
%h3
Builds for
#{
ref
}
Builds for
#{
gitlab_ref_link
(
@project
,
ref
)
}
-
if
@commit
.
duration_for_ref
(
ref
)
>
0
%small
.pull-right
%i
.fa.fa-time
...
...
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