diff options
author | Robert Speicher <robert@gitlab.com> | 2018-04-12 17:04:08 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2018-04-12 17:04:08 +0000 |
commit | f5a3d8f75de50f0ac6a14e77c672da79df85866e (patch) | |
tree | b0d3655e4a738867696e82cee07309b17e175531 /db/fixtures | |
parent | 64f91be000bc2963a48851db4dcb0a6bbd2b57bc (diff) | |
parent | eae2ed3366ac13832c56aefe965513b986d7e8b1 (diff) | |
download | gitlab-ce-f5a3d8f75de50f0ac6a14e77c672da79df85866e.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/fixtures')
-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 |