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
d392f147
Commit
d392f147
authored
Sep 07, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Group similar builds
parent
1d548869
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
5 deletions
+30
-5
app/models/commit_status.rb
app/models/commit_status.rb
+4
-0
app/views/projects/commit/_pipeline.html.haml
app/views/projects/commit/_pipeline.html.haml
+7
-2
app/views/projects/commit/_pipeline_grouped_status.html.haml
app/views/projects/commit/_pipeline_grouped_status.html.haml
+12
-0
db/fixtures/development/14_pipelines.rb
db/fixtures/development/14_pipelines.rb
+7
-3
No files found.
app/models/commit_status.rb
View file @
d392f147
...
@@ -95,6 +95,10 @@ class CommitStatus < ActiveRecord::Base
...
@@ -95,6 +95,10 @@ class CommitStatus < ActiveRecord::Base
pipeline
.
before_sha
||
Gitlab
::
Git
::
BLANK_SHA
pipeline
.
before_sha
||
Gitlab
::
Git
::
BLANK_SHA
end
end
def
group_name
name
.
gsub
(
/\d+[\s:]+\d+\s*/
,
''
)
end
def
self
.
stages
def
self
.
stages
# We group by stage name, but order stages by theirs' index
# We group by stage name, but order stages by theirs' index
unscoped
.
from
(
all
,
:sg
).
group
(
'stage'
).
order
(
'max(stage_idx)'
,
'stage'
).
pluck
(
'sg.stage'
)
unscoped
.
from
(
all
,
:sg
).
group
(
'stage'
).
order
(
'max(stage_idx)'
,
'stage'
).
pluck
(
'sg.stage'
)
...
...
app/views/projects/commit/_pipeline.html.haml
View file @
d392f147
...
@@ -39,8 +39,13 @@
...
@@ -39,8 +39,13 @@
=
stage
.
titleize
=
stage
.
titleize
.builds-container
.builds-container
%ul
%ul
-
statuses
.
each
do
|
status
|
-
status_groups
=
statuses
.
group_by
(
&
:group_name
)
-
status_groups
.
each
do
|
group_name
,
grouped_statuses
|
-
if
grouped_statuses
.
one?
-
status
=
grouped_statuses
.
first
=
render
"projects/
#{
status
.
to_partial_path
}
_pipeline"
,
subject:
status
=
render
"projects/
#{
status
.
to_partial_path
}
_pipeline"
,
subject:
status
-
else
=
render
"projects/commit/pipeline_grouped_status"
,
name:
group_name
,
subject:
grouped_statuses
-
if
pipeline
.
yaml_errors
.
present?
-
if
pipeline
.
yaml_errors
.
present?
...
...
app/views/projects/commit/_pipeline_grouped_status.html.haml
0 → 100644
View file @
d392f147
%li
.build
.curve
.build-content
-
group_status
=
CommitStatus
.
where
(
id:
subject
).
status
=
render_status_with_link
(
'build'
,
group_status
)
%span
.ci-status-text
=
name
=
subject
.
length
// Access all other grouped statuses
//- subject.each do |status|
// = render "projects/#{status.to_partial_path}_pipeline", subject: status
db/fixtures/development/14_pipelines.rb
View file @
d392f147
...
@@ -3,9 +3,13 @@ class Gitlab::Seeder::Pipelines
...
@@ -3,9 +3,13 @@ class Gitlab::Seeder::Pipelines
BUILDS
=
[
BUILDS
=
[
{
name:
'build:linux'
,
stage:
'build'
,
status: :success
},
{
name:
'build:linux'
,
stage:
'build'
,
status: :success
},
{
name:
'build:osx'
,
stage:
'build'
,
status: :success
},
{
name:
'build:osx'
,
stage:
'build'
,
status: :success
},
{
name:
'rspec:linux'
,
stage:
'test'
,
status: :success
},
{
name:
'rspec:linux 0 3'
,
stage:
'test'
,
status: :success
},
{
name:
'rspec:windows'
,
stage:
'test'
,
status: :success
},
{
name:
'rspec:linux 1 3'
,
stage:
'test'
,
status: :success
},
{
name:
'rspec:windows'
,
stage:
'test'
,
status: :success
},
{
name:
'rspec:linux 2 3'
,
stage:
'test'
,
status: :success
},
{
name:
'rspec:windows 0 3'
,
stage:
'test'
,
status: :success
},
{
name:
'rspec:windows 1 3'
,
stage:
'test'
,
status: :success
},
{
name:
'rspec:windows 2 3'
,
stage:
'test'
,
status: :success
},
{
name:
'rspec:windows 2 3'
,
stage:
'test'
,
status: :success
},
{
name:
'rspec:osx'
,
stage:
'test'
,
status_event: :success
},
{
name:
'rspec:osx'
,
stage:
'test'
,
status_event: :success
},
{
name:
'spinach:linux'
,
stage:
'test'
,
status: :success
},
{
name:
'spinach:linux'
,
stage:
'test'
,
status: :success
},
{
name:
'spinach:osx'
,
stage:
'test'
,
status: :failed
,
allow_failure:
true
},
{
name:
'spinach:osx'
,
stage:
'test'
,
status: :failed
,
allow_failure:
true
},
...
...
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