<commit_before>Gitlab::Seeder.quiet do
  Project.all.reject(&:empty_repo?).each do |project|
    branches = project.repository.branch_names

    branches.each do |branch_name|
      break if branches.size < 2
      source_branch = branches.pop
      target_branch = branches.pop

      params = {
        source_branch: source_branch,
        target_branch: target_branch,
        title: Faker::Lorem.sentence(6),
        description: Faker::Lorem.sentences(3).join(" "),
        milestone: project.milestones.sample,
        assignee: project.team.users.sample
      }

      MergeRequests::CreateService.new(project, project.team.users.sample, params).execute
      print '.'
    end
  end
end
<commit_msg>Add predictable merge requests on dev seed.<commit_after>Gitlab::Seeder.quiet do
  Project.all.reject(&:empty_repo?).each do |project|
    branches = project.repository.branch_names

    branches.each do |branch_name|
      break if branches.size < 2
      source_branch = branches.pop
      target_branch = branches.pop

      params = {
        source_branch: source_branch,
        target_branch: target_branch,
        title: Faker::Lorem.sentence(6),
        description: Faker::Lorem.sentences(3).join(" "),
        milestone: project.milestones.sample,
        assignee: project.team.users.sample
      }

      MergeRequests::CreateService.new(project, project.team.users.sample, params).execute
      print '.'
    end
  end

  project = Project.find_with_namespace('gitlab-org/testme')

  params = {
    source_branch: 'feature',
    target_branch: 'master',
    title: 'Can be automatically merged'
  }
  MergeRequests::CreateService.new(project, User.admins.first, params).execute
  print '.'

  params = {
    source_branch: 'feature_conflict',
    target_branch: 'feature',
    title: 'Cannot be automatically merged'
  }
  MergeRequests::CreateService.new(project, User.admins.first, params).execute
  print '.'
end

{'fraction_non_alphanumeric': 0.110881897885508, 'fraction_numerical': 0.0030943785456420837, 'mean_word_length': 3.172043010752688, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2969442', 'n_tokens_mistral': 596, 'n_tokens_neox': 573, 'n_words': 113}