Commit 80360029 authored by James Lopez's avatar James Lopez

Merge branch 'dz-allow-plus-in-version' into 'master'

Allow plus symbol in maven package version

Closes #8680

See merge request gitlab-org/gitlab-ee!9657
parents c8600bde 59963b96
---
title: Allow plus symbol in maven package version
merge_request: 9657
author:
type: fixed
......@@ -20,7 +20,7 @@ module EE
end
def maven_path_regex
package_name_regex
@maven_path_regex ||= %r{\A\@?(([\w\-\.]*)/)*([\w\-\.\+]*)\z}.freeze
end
def maven_app_name_regex
......
......@@ -33,4 +33,21 @@ describe Gitlab::Regex do
it { is_expected.not_to match('my package name') }
it { is_expected.not_to match('!!()()') }
end
describe '.maven_path_regex' do
subject { described_class.maven_path_regex }
it { is_expected.to match('123') }
it { is_expected.to match('foo') }
it { is_expected.to match('foo/bar') }
it { is_expected.to match('@foo/bar') }
it { is_expected.to match('com/mycompany/app/my-app') }
it { is_expected.to match('com/mycompany/app/my-app/1.0-SNAPSHOT') }
it { is_expected.to match('com/mycompany/app/my-app/1.0-SNAPSHOT+debian64') }
it { is_expected.not_to match('com/mycompany/app/my+app/1.0-SNAPSHOT') }
it { is_expected.not_to match('$foo/bar') }
it { is_expected.not_to match('@foo/@/bar') }
it { is_expected.not_to match('my package name') }
it { is_expected.not_to match('!!()()') }
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment