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
1039f101
Commit
1039f101
authored
Jun 13, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'zj-commit-status-sortable-name' into 'master'
Handle legacy jobs without name Closes #33403 See merge request !12118
parents
e44502f6
93b555af
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
2 deletions
+17
-2
commit_status.rb
app/models/commit_status.rb
+2
-2
zj-commit-status-sortable-name.yml
changelogs/unreleased/zj-commit-status-sortable-name.yml
+4
-0
legacy_stage_spec.rb
spec/models/ci/legacy_stage_spec.rb
+11
-0
No files found.
app/models/commit_status.rb
View file @
1039f101
...
...
@@ -112,7 +112,7 @@ class CommitStatus < ActiveRecord::Base
end
def
group_name
name
.
gsub
(
/\d+[\s:\/\\]+\d+\s*/
,
''
).
strip
name
.
to_s
.
gsub
(
/\d+[\s:\/\\]+\d+\s*/
,
''
).
strip
end
def
failed_but_allowed?
...
...
@@ -156,7 +156,7 @@ class CommitStatus < ActiveRecord::Base
end
def
sortable_name
name
.
split
(
/(\d+)/
).
map
do
|
v
|
name
.
to_s
.
split
(
/(\d+)/
).
map
do
|
v
|
v
=~
/\d+/
?
v
.
to_i
:
v
end
end
...
...
changelogs/unreleased/zj-commit-status-sortable-name.yml
0 → 100644
View file @
1039f101
---
title
:
Handle nameless legacy jobs
merge_request
:
author
:
spec/models/ci/legacy_stage_spec.rb
View file @
1039f101
...
...
@@ -55,6 +55,17 @@ describe Ci::LegacyStage, :models do
expect
(
stage
.
groups
.
map
(
&
:name
))
.
to
eq
%w[aaaaa rspec spinach]
end
context
'when a name is nil on legacy pipelines'
do
before
do
pipeline
.
builds
.
first
.
update_attribute
(
:name
,
nil
)
end
it
'returns an array of three groups'
do
expect
(
stage
.
groups
.
map
(
&
:name
))
.
to
eq
[
''
,
'aaaaa'
,
'rspec'
,
'spinach'
]
end
end
end
describe
'#statuses_count'
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