diff options
author | Robert Speicher <robert@gitlab.com> | 2018-04-12 17:04:08 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2018-04-17 15:20:32 +0100 |
commit | 58590b8a94510a00fa7fd6df4204b21a65addf8f (patch) | |
tree | 876cbf4e8303a8b7887bfe62aa3ccb4ed7160a01 /db | |
parent | 30acfab516e19679c8f19aaa38883daf98114258 (diff) | |
download | gitlab-ce-58590b8a94510a00fa7fd6df4204b21a65addf8f.tar.gz |
Merge branch 'dm-archived-read-only' into 'master'
Make archived projects completely read-only
Closes #44788
See merge request gitlab-org/gitlab-ce!18136
Diffstat (limited to 'db')
-rw-r--r-- | db/fixtures/development/10_merge_requests.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/db/fixtures/development/10_merge_requests.rb b/db/fixtures/development/10_merge_requests.rb index 30244ee4431..bcfdd058a1c 100644 --- a/db/fixtures/development/10_merge_requests.rb +++ b/db/fixtures/development/10_merge_requests.rb @@ -4,7 +4,7 @@ Gitlab::Seeder.quiet do # Limit the number of merge requests per project to avoid long seeds MAX_NUM_MERGE_REQUESTS = 10 - Project.all.reject(&:empty_repo?).each do |project| + Project.non_archived.with_merge_requests_enabled.reject(&:empty_repo?).each do |project| branches = project.repository.branch_names.sample(MAX_NUM_MERGE_REQUESTS * 2) branches.each do |branch_name| @@ -21,7 +21,11 @@ Gitlab::Seeder.quiet do assignee: project.team.users.sample } - MergeRequests::CreateService.new(project, project.team.users.sample, params).execute + # Only create MRs with users that are allowed to create MRs + developer = project.team.developers.sample + break unless developer + + MergeRequests::CreateService.new(project, developer, params).execute print '.' end end |