Commit cf777261 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Make sure we're matching the same way.

Ruby's regular expression is unicode aware, therefore 'å' also
matches against /\p{alnum}/. If we want only ASCII-7bit, use
[a-zA-Z0-9]+ so they always match the same thing
parent 1f526071
...@@ -30,14 +30,14 @@ class Gitlab::Seeder::Environments ...@@ -30,14 +30,14 @@ class Gitlab::Seeder::Environments
def create_merge_request_review_deployments! def create_merge_request_review_deployments!
@project @project
.merge_requests .merge_requests
.select { |mr| mr.source_branch.match(/\p{Alnum}+/) } .select { |mr| mr.source_branch.match(/[^a-zA-Z0-9]+/) }
.sample(4) .sample(4)
.each do |merge_request| .each do |merge_request|
next unless merge_request.diff_head_sha next unless merge_request.diff_head_sha
create_deployment!( create_deployment!(
merge_request.source_project, merge_request.source_project,
"review/#{merge_request.source_branch.gsub(/[^a-zA-Z0-9]/, '')}", "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
) )
......
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