Merge branch 'check-environment-regex-ce' into 'master'
Backport "Fix environment scope regex" to CE Closes gitlab-ee#4308 See merge request gitlab-org/gitlab-ce!15945
This commit is contained in:
commit
a04ef4db58
2 changed files with 3 additions and 2 deletions
|
@ -37,7 +37,7 @@ module Gitlab
|
||||||
end
|
end
|
||||||
|
|
||||||
def environment_name_regex_chars
|
def environment_name_regex_chars
|
||||||
'a-zA-Z0-9_/\\$\\{\\}\\. -'
|
'a-zA-Z0-9_/\\$\\{\\}\\. \\-'
|
||||||
end
|
end
|
||||||
|
|
||||||
def environment_name_regex
|
def environment_name_regex
|
||||||
|
|
|
@ -14,7 +14,7 @@ describe Gitlab::Regex do
|
||||||
it { is_expected.not_to match('?gitlab') }
|
it { is_expected.not_to match('?gitlab') }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '.environment_slug_regex' do
|
describe '.environment_name_regex' do
|
||||||
subject { described_class.environment_name_regex }
|
subject { described_class.environment_name_regex }
|
||||||
|
|
||||||
it { is_expected.to match('foo') }
|
it { is_expected.to match('foo') }
|
||||||
|
@ -24,6 +24,7 @@ describe Gitlab::Regex do
|
||||||
it { is_expected.to match('foo.1') }
|
it { is_expected.to match('foo.1') }
|
||||||
it { is_expected.not_to match('9&foo') }
|
it { is_expected.not_to match('9&foo') }
|
||||||
it { is_expected.not_to match('foo-^') }
|
it { is_expected.not_to match('foo-^') }
|
||||||
|
it { is_expected.not_to match('!!()()') }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '.environment_slug_regex' do
|
describe '.environment_slug_regex' do
|
||||||
|
|
Loading…
Reference in a new issue