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
5cd504ed
Commit
5cd504ed
authored
Oct 12, 2015
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename builds_without_retry to latest_builds
parent
2e9c1608
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
14 additions
and
14 deletions
+14
-14
app/models/ci/commit.rb
app/models/ci/commit.rb
+7
-7
app/models/project_services/ci/hip_chat_service.rb
app/models/project_services/ci/hip_chat_service.rb
+1
-1
app/models/project_services/ci/mail_service.rb
app/models/project_services/ci/mail_service.rb
+1
-1
app/models/project_services/ci/slack_message.rb
app/models/project_services/ci/slack_message.rb
+1
-1
app/models/project_services/ci/slack_service.rb
app/models/project_services/ci/slack_service.rb
+1
-1
app/services/ci/create_commit_service.rb
app/services/ci/create_commit_service.rb
+1
-1
app/views/projects/builds/show.html.haml
app/views/projects/builds/show.html.haml
+2
-2
No files found.
app/models/ci/commit.rb
View file @
5cd504ed
...
@@ -48,7 +48,7 @@ module Ci
...
@@ -48,7 +48,7 @@ module Ci
end
end
def
retry
def
retry
builds_without_retry
.
each
do
|
build
|
latest_builds
.
each
do
|
build
|
Ci
::
Build
.
retry
(
build
)
Ci
::
Build
.
retry
(
build
)
end
end
end
end
...
@@ -113,12 +113,12 @@ module Ci
...
@@ -113,12 +113,12 @@ module Ci
@latest_statuses
||=
statuses
.
latest
.
to_a
@latest_statuses
||=
statuses
.
latest
.
to_a
end
end
def
builds_without_retry
def
latest_builds
@
builds_without_retry
||=
builds
.
latest
.
to_a
@
latest_builds
||=
builds
.
latest
.
to_a
end
end
def
builds_without_retry
_for_ref
(
ref
)
def
latest_builds
_for_ref
(
ref
)
builds_without_retry
.
select
{
|
build
|
build
.
ref
==
ref
}
latest_builds
.
select
{
|
build
|
build
.
ref
==
ref
}
end
end
def
retried
def
retried
...
@@ -181,7 +181,7 @@ module Ci
...
@@ -181,7 +181,7 @@ module Ci
def
coverage
def
coverage
if
project
.
coverage_enabled?
if
project
.
coverage_enabled?
coverage_array
=
builds_without_retry
.
map
(
&
:coverage
).
compact
coverage_array
=
latest_builds
.
map
(
&
:coverage
).
compact
if
coverage_array
.
size
>=
1
if
coverage_array
.
size
>=
1
'%.2f'
%
(
coverage_array
.
reduce
(:
+
)
/
coverage_array
.
size
)
'%.2f'
%
(
coverage_array
.
reduce
(:
+
)
/
coverage_array
.
size
)
end
end
...
@@ -189,7 +189,7 @@ module Ci
...
@@ -189,7 +189,7 @@ module Ci
end
end
def
matrix_for_ref?
(
ref
)
def
matrix_for_ref?
(
ref
)
builds_without_retry
_for_ref
(
ref
).
size
>
1
latest_builds
_for_ref
(
ref
).
size
>
1
end
end
def
config_processor
def
config_processor
...
...
app/models/project_services/ci/hip_chat_service.rb
View file @
5cd504ed
...
@@ -49,7 +49,7 @@ module Ci
...
@@ -49,7 +49,7 @@ module Ci
commit
=
build
.
commit
commit
=
build
.
commit
return
unless
commit
return
unless
commit
return
unless
commit
.
builds_without_retry
.
include?
build
return
unless
commit
.
latest_builds
.
include?
build
case
commit
.
status
.
to_sym
case
commit
.
status
.
to_sym
when
:failed
when
:failed
...
...
app/models/project_services/ci/mail_service.rb
View file @
5cd504ed
...
@@ -48,7 +48,7 @@ module Ci
...
@@ -48,7 +48,7 @@ module Ci
# it doesn't make sense to send emails for retried builds
# it doesn't make sense to send emails for retried builds
commit
=
build
.
commit
commit
=
build
.
commit
return
unless
commit
return
unless
commit
return
unless
commit
.
builds_without_retry
.
include?
(
build
)
return
unless
commit
.
latest_builds
.
include?
(
build
)
case
build
.
status
.
to_sym
case
build
.
status
.
to_sym
when
:failed
when
:failed
...
...
app/models/project_services/ci/slack_message.rb
View file @
5cd504ed
...
@@ -23,7 +23,7 @@ module Ci
...
@@ -23,7 +23,7 @@ module Ci
def
attachments
def
attachments
fields
=
[]
fields
=
[]
commit
.
builds_without_retry
.
each
do
|
build
|
commit
.
latest_builds
.
each
do
|
build
|
next
if
build
.
allow_failure?
next
if
build
.
allow_failure?
next
unless
build
.
failed?
next
unless
build
.
failed?
fields
<<
{
fields
<<
{
...
...
app/models/project_services/ci/slack_service.rb
View file @
5cd504ed
...
@@ -48,7 +48,7 @@ module Ci
...
@@ -48,7 +48,7 @@ module Ci
commit
=
build
.
commit
commit
=
build
.
commit
return
unless
commit
return
unless
commit
return
unless
commit
.
builds_without_retry
.
include?
(
build
)
return
unless
commit
.
latest_builds
.
include?
(
build
)
case
commit
.
status
.
to_sym
case
commit
.
status
.
to_sym
when
:failed
when
:failed
...
...
app/services/ci/create_commit_service.rb
View file @
5cd504ed
...
@@ -21,7 +21,7 @@ module Ci
...
@@ -21,7 +21,7 @@ module Ci
commit
.
update_committed!
commit
.
update_committed!
commit
.
create_builds
(
ref
,
tag
,
user
)
commit
.
create_builds
(
ref
,
tag
,
user
)
end
end
commit
commit
end
end
end
end
...
...
app/views/projects/builds/show.html.haml
View file @
5cd504ed
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
#up-build-trace
#up-build-trace
-
if
@commit
.
matrix_for_ref?
(
@build
.
ref
)
-
if
@commit
.
matrix_for_ref?
(
@build
.
ref
)
%ul
.center-top-menu.build-top-menu
%ul
.center-top-menu.build-top-menu
-
@commit
.
builds_without_retry
_for_ref
(
@build
.
ref
).
each
do
|
build
|
-
@commit
.
latest_builds
_for_ref
(
@build
.
ref
).
each
do
|
build
|
%li
{
class:
(
'active'
if
build
==
@build
)
}
%li
{
class:
(
'active'
if
build
==
@build
)
}
=
link_to
namespace_project_build_path
(
@project
.
namespace
,
@project
,
build
)
do
=
link_to
namespace_project_build_path
(
@project
.
namespace
,
@project
,
build
)
do
=
ci_icon_for_status
(
build
.
status
)
=
ci_icon_for_status
(
build
.
status
)
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
=
build
.
id
=
build
.
id
-
unless
@commit
.
builds_without_retry
_for_ref
(
@build
.
ref
).
include?
(
@build
)
-
unless
@commit
.
latest_builds
_for_ref
(
@build
.
ref
).
include?
(
@build
)
%li
.active
%li
.active
%a
%a
Build ##{@build.id}
Build ##{@build.id}
...
...
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