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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
156d34ee
Commit
156d34ee
authored
Aug 31, 2020
by
Marius Bobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement reviewer feedback
parent
2de4647f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
app/models/commit_status.rb
app/models/commit_status.rb
+8
-8
spec/models/commit_status_spec.rb
spec/models/commit_status_spec.rb
+5
-1
No files found.
app/models/commit_status.rb
View file @
156d34ee
...
...
@@ -198,15 +198,15 @@ class CommitStatus < ApplicationRecord
will_save_change_to_status?
end
# Extracts common job name for matrix and parallel builds:
# 'rspec:linux: 1/10' => 'rspec:linux'
# 'rspec:linux: [aws, max memory]' => 'rspec:linux'
#
def
group_name
group_name
=
name
.
to_s
.
gsub
(
%r{
\d
+[
\s
:
\/\\
]+
\d
+
\s
*}
,
''
)
group_name
.
gsub!
(
%r{:
\[
.+, .+
\]\s
*
\z
}
,
''
)
if
Gitlab
::
Ci
::
Features
.
new_matrix_job_names_enabled?
group_name
.
strip!
group_name
# 'rspec:linux: 1/10' => 'rspec:linux'
common_name
=
name
.
to_s
.
gsub
(
%r{
\d
+[
\s
:
\/\\
]+
\d
+
\s
*}
,
''
)
# 'rspec:linux: [aws, max memory]' => 'rspec:linux'
common_name
.
gsub!
(
%r{:
\[
.*, .*
\]\s
*
\z
}
,
''
)
if
Gitlab
::
Ci
::
Features
.
new_matrix_job_names_enabled?
common_name
.
strip!
common_name
end
def
failed_but_allowed?
...
...
spec/models/commit_status_spec.rb
View file @
156d34ee
...
...
@@ -517,7 +517,11 @@ RSpec.describe CommitStatus do
'rspec:linux: [aws, max memory, data]'
=>
'rspec:linux'
,
'rspec: [inception: [something, other thing], value]'
=>
'rspec'
,
'rspec:windows 0/1: [name, other]'
=>
'rspec:windows'
,
'rspec:windows: [name, other] 0/1'
=>
'rspec:windows'
'rspec:windows: [name, other] 0/1'
=>
'rspec:windows'
,
'rspec:windows: [name, 0/1] 0/1'
=>
'rspec:windows'
,
'rspec:windows: [0/1, name]'
=>
'rspec:windows'
,
'rspec:windows: [, ]'
=>
'rspec:windows'
,
'rspec:windows: [name]'
=>
'rspec:windows: [name]'
}
tests
.
each
do
|
name
,
group_name
|
...
...
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