Commit 15d5fa08 authored by Kerri Miller's avatar Kerri Miller

Merge branch '287636-auto-assign-author' into 'master'

Auto-assign merge request author when creating from issue

See merge request gitlab-org/gitlab!50263
parents 63d6eeb7 824f99ff
...@@ -85,7 +85,8 @@ module MergeRequests ...@@ -85,7 +85,8 @@ module MergeRequests
source_project_id: target_project.id, source_project_id: target_project.id,
source_branch: branch_name, source_branch: branch_name,
target_project_id: target_project.id, target_project_id: target_project.id,
target_branch: target_branch target_branch: target_branch,
assignee_ids: [current_user.id]
} }
end end
......
---
title: Auto-assign merge request author when creating from issue
merge_request: 50263
author:
type: added
...@@ -66,10 +66,11 @@ RSpec.describe MergeRequests::CreateFromIssueService do ...@@ -66,10 +66,11 @@ RSpec.describe MergeRequests::CreateFromIssueService do
expect { service.execute }.to change(target_project.merge_requests, :count).by(1) expect { service.execute }.to change(target_project.merge_requests, :count).by(1)
end end
it 'sets the merge request author to current user', :sidekiq_might_not_need_inline do it 'sets the merge request author to current user and assigns them', :sidekiq_might_not_need_inline do
result = service.execute result = service.execute
expect(result[:merge_request].author).to eq(user) expect(result[:merge_request].author).to eq(user)
expect(result[:merge_request].assignees).to eq([user])
end end
it 'sets the merge request source branch to the new issue branch', :sidekiq_might_not_need_inline do it 'sets the merge request source branch to the new issue branch', :sidekiq_might_not_need_inline do
......
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