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
73a5e1cf
Commit
73a5e1cf
authored
Jan 26, 2022
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expand CI regular expressions validation message
parent
492e543a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
lib/gitlab/config/entry/validators.rb
lib/gitlab/config/entry/validators.rb
+2
-2
spec/lib/gitlab/ci/config/entry/policy_spec.rb
spec/lib/gitlab/ci/config/entry/policy_spec.rb
+1
-1
spec/lib/gitlab/ci/yaml_processor_spec.rb
spec/lib/gitlab/ci/yaml_processor_spec.rb
+4
-4
No files found.
lib/gitlab/config/entry/validators.rb
View file @
73a5e1cf
...
@@ -245,7 +245,7 @@ module Gitlab
...
@@ -245,7 +245,7 @@ module Gitlab
private
private
def
validation_message
def
validation_message
'should be an array of strings or reg
exp
s using re2 syntax'
'should be an array of strings or reg
ular expression
s using re2 syntax'
end
end
def
validate_array_of_strings_or_regexps
(
values
)
def
validate_array_of_strings_or_regexps
(
values
)
...
@@ -270,7 +270,7 @@ module Gitlab
...
@@ -270,7 +270,7 @@ module Gitlab
#
#
def
validation_message
def
validation_message
if
::
Feature
.
enabled?
(
:allow_unsafe_ruby_regexp
,
default_enabled: :yaml
)
if
::
Feature
.
enabled?
(
:allow_unsafe_ruby_regexp
,
default_enabled: :yaml
)
'should be an array of strings or reg
exp
s'
'should be an array of strings or reg
ular expression
s'
else
else
super
super
end
end
...
...
spec/lib/gitlab/ci/config/entry/policy_spec.rb
View file @
73a5e1cf
...
@@ -88,7 +88,7 @@ RSpec.describe Gitlab::Ci::Config::Entry::Policy do
...
@@ -88,7 +88,7 @@ RSpec.describe Gitlab::Ci::Config::Entry::Policy do
describe
'#errors'
do
describe
'#errors'
do
it
'saves errors'
do
it
'saves errors'
do
expect
(
entry
.
errors
)
expect
(
entry
.
errors
)
.
to
include
/policy config should be an array of strings or reg
exp
s/
.
to
include
/policy config should be an array of strings or reg
ular expression
s/
end
end
end
end
end
end
...
...
spec/lib/gitlab/ci/yaml_processor_spec.rb
View file @
73a5e1cf
...
@@ -613,13 +613,13 @@ module Gitlab
...
@@ -613,13 +613,13 @@ module Gitlab
context
'when it is an array of integers'
do
context
'when it is an array of integers'
do
let
(
:only
)
{
[
1
,
1
]
}
let
(
:only
)
{
[
1
,
1
]
}
it_behaves_like
'returns errors'
,
'jobs:rspec:only config should be an array of strings or reg
exp
s using re2 syntax'
it_behaves_like
'returns errors'
,
'jobs:rspec:only config should be an array of strings or reg
ular expression
s using re2 syntax'
end
end
context
'when it is invalid regex'
do
context
'when it is invalid regex'
do
let
(
:only
)
{
[
"/*invalid/"
]
}
let
(
:only
)
{
[
"/*invalid/"
]
}
it_behaves_like
'returns errors'
,
'jobs:rspec:only config should be an array of strings or reg
exp
s using re2 syntax'
it_behaves_like
'returns errors'
,
'jobs:rspec:only config should be an array of strings or reg
ular expression
s using re2 syntax'
end
end
end
end
...
@@ -637,13 +637,13 @@ module Gitlab
...
@@ -637,13 +637,13 @@ module Gitlab
context
'when it is an array of integers'
do
context
'when it is an array of integers'
do
let
(
:except
)
{
[
1
,
1
]
}
let
(
:except
)
{
[
1
,
1
]
}
it_behaves_like
'returns errors'
,
'jobs:rspec:except config should be an array of strings or reg
exp
s using re2 syntax'
it_behaves_like
'returns errors'
,
'jobs:rspec:except config should be an array of strings or reg
ular expression
s using re2 syntax'
end
end
context
'when it is invalid regex'
do
context
'when it is invalid regex'
do
let
(
:except
)
{
[
"/*invalid/"
]
}
let
(
:except
)
{
[
"/*invalid/"
]
}
it_behaves_like
'returns errors'
,
'jobs:rspec:except config should be an array of strings or reg
exp
s using re2 syntax'
it_behaves_like
'returns errors'
,
'jobs:rspec:except config should be an array of strings or reg
ular expression
s using re2 syntax'
end
end
end
end
end
end
...
...
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