Commit 824f99ff authored by Patrick Bajao's avatar Patrick Bajao

Auto-assign merge request author when creating from issue

When creating a merge request from an issue via "Create merge
request" button, whoever clicked it will be the author of
the merge request.

Additional to that, we are now auto-assigning the merge request
to the author. This is to make it more convenient for the
author to assign themselves.
parent 18937395
......@@ -85,7 +85,8 @@ module MergeRequests
source_project_id: target_project.id,
source_branch: branch_name,
target_project_id: target_project.id,
target_branch: target_branch
target_branch: target_branch,
assignee_ids: [current_user.id]
}
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
expect { service.execute }.to change(target_project.merge_requests, :count).by(1)
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
expect(result[:merge_request].author).to eq(user)
expect(result[:merge_request].assignees).to eq([user])
end
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