summaryrefslogtreecommitdiff
path: root/db/fixtures
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2018-04-09 19:35:11 +0200
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2018-04-10 09:07:32 +0200
commit43b0dddf3859887b78569b832dd9a820ea66d652 (patch)
tree7153e38126bb421286468f0164d5c0fcaf2ca6fb /db/fixtures
parent91a3a4b526214f4174f4f12de23dfb5baf033211 (diff)
downloadgitlab-ce-43b0dddf3859887b78569b832dd9a820ea66d652.tar.gz
Fix enviroments seeding on certain branch names
Bit of a cryptic commit title, but our seeding will try to guard against branchnames being anything but alphanumerical. These charachters we gsub away but can't have an empty string as replacement. This change is less efficient, but given that the number of seeded MRs per project is very limited, this should be ok.
Diffstat (limited to 'db/fixtures')
-rw-r--r--db/fixtures/development/19_environments.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/db/fixtures/development/19_environments.rb b/db/fixtures/development/19_environments.rb
index c1bbc9af6d6..00a14f458d1 100644
--- a/db/fixtures/development/19_environments.rb
+++ b/db/fixtures/development/19_environments.rb
@@ -28,7 +28,11 @@ class Gitlab::Seeder::Environments
end
def create_merge_request_review_deployments!
- @project.merge_requests.sample(4).map do |merge_request|
+ @project
+ .merge_requests
+ .select { |mr| mr.source_branch.match(/\p{Alnum}+/) }
+ .sample(4)
+ .each do |merge_request|
next unless merge_request.diff_head_sha
create_deployment!(