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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
5eb940da
Commit
5eb940da
authored
Jun 21, 2017
by
Zeger-Jan van de Weg
Committed by
Grzegorz Bizon
Jun 21, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace invalid chars while seeding environments
parent
6a3da45a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
2 deletions
+14
-2
db/fixtures/development/19_environments.rb
db/fixtures/development/19_environments.rb
+1
-1
lib/gitlab/regex.rb
lib/gitlab/regex.rb
+1
-1
spec/lib/gitlab/regex_spec.rb
spec/lib/gitlab/regex_spec.rb
+12
-0
No files found.
db/fixtures/development/19_environments.rb
View file @
5eb940da
...
@@ -33,7 +33,7 @@ class Gitlab::Seeder::Environments
...
@@ -33,7 +33,7 @@ class Gitlab::Seeder::Environments
create_deployment!
(
create_deployment!
(
merge_request
.
source_project
,
merge_request
.
source_project
,
"review/
#{
merge_request
.
source_branch
}
"
,
"review/
#{
merge_request
.
source_branch
.
gsub
(
/[^a-zA-Z0-9]/
,
''
)
}
"
,
merge_request
.
source_branch
,
merge_request
.
source_branch
,
merge_request
.
diff_head_sha
merge_request
.
diff_head_sha
)
)
...
...
lib/gitlab/regex.rb
View file @
5eb940da
...
@@ -43,7 +43,7 @@ module Gitlab
...
@@ -43,7 +43,7 @@ module Gitlab
end
end
def
environment_name_regex_message
def
environment_name_regex_message
"can contain only letters, digits, '-', '_', '/', '$', '{', '}', '.' and spaces"
"can contain only letters, digits, '-', '_', '/', '$', '{', '}', '.'
,
and spaces"
end
end
def
kubernetes_namespace_regex
def
kubernetes_namespace_regex
...
...
spec/lib/gitlab/regex_spec.rb
View file @
5eb940da
...
@@ -20,6 +20,18 @@ describe Gitlab::Regex, lib: true do
...
@@ -20,6 +20,18 @@ describe Gitlab::Regex, lib: true do
it
{
is_expected
.
to
match
(
'foo@bar'
)
}
it
{
is_expected
.
to
match
(
'foo@bar'
)
}
end
end
describe
'.environment_slug_regex'
do
subject
{
described_class
.
environment_name_regex
}
it
{
is_expected
.
to
match
(
'foo'
)
}
it
{
is_expected
.
to
match
(
'foo-1'
)
}
it
{
is_expected
.
to
match
(
'FOO'
)
}
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
(
'foo-^'
)
}
end
describe
'.environment_slug_regex'
do
describe
'.environment_slug_regex'
do
subject
{
described_class
.
environment_slug_regex
}
subject
{
described_class
.
environment_slug_regex
}
...
...
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