From 539694a383bce9f02025c20aa777f283e106b158 Mon Sep 17 00:00:00 2001 From: haseeb Date: Fri, 18 Aug 2017 20:04:26 +0530 Subject: [PATCH] [skip ci] changelog and minor style changes added --- app/services/merge_requests/create_from_issue_service.rb | 2 +- .../unreleased/35343-inherit-milestones-and-labels.yml | 5 +++++ .../merge_requests/create_from_issue_service_spec.rb | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 changelogs/unreleased/35343-inherit-milestones-and-labels.yml diff --git a/app/services/merge_requests/create_from_issue_service.rb b/app/services/merge_requests/create_from_issue_service.rb index 6bc70d8175e..e9e4513e0d0 100644 --- a/app/services/merge_requests/create_from_issue_service.rb +++ b/app/services/merge_requests/create_from_issue_service.rb @@ -3,7 +3,7 @@ module MergeRequests def execute return error('Invalid issue iid') unless issue_iid.present? && issue.present? - params[:label_ids] = issue.label_ids if issue.label_ids.any? + params[:label_ids] = issue.label_ids if issue.label_ids.any? result = CreateBranchService.new(project, current_user).execute(branch_name, ref) return result if result[:status] == :error diff --git a/changelogs/unreleased/35343-inherit-milestones-and-labels.yml b/changelogs/unreleased/35343-inherit-milestones-and-labels.yml new file mode 100644 index 00000000000..ce737a67356 --- /dev/null +++ b/changelogs/unreleased/35343-inherit-milestones-and-labels.yml @@ -0,0 +1,5 @@ +--- +title: inherits milestone and labels when a merge request is created from issue +merge_request: 13461 +author: haseebeqx +type: added diff --git a/spec/services/merge_requests/create_from_issue_service_spec.rb b/spec/services/merge_requests/create_from_issue_service_spec.rb index b3c0e6518ef..313f87ae1f6 100644 --- a/spec/services/merge_requests/create_from_issue_service_spec.rb +++ b/spec/services/merge_requests/create_from_issue_service_spec.rb @@ -2,10 +2,10 @@ require 'spec_helper' describe MergeRequests::CreateFromIssueService do let(:project) { create(:project, :repository) } - let(:user) { create(:user) } + let(:user) { create(:user) } let(:label_ids) { create_pair(:label, project: project).map(&:id) } let(:milestone_id) { create(:milestone, project: project).id } - let(:issue) { create(:issue, project: project, milestone_id: milestone_id) } + let(:issue) { create(:issue, project: project, milestone_id: milestone_id) } subject(:service) { described_class.new(project, user, issue_iid: issue.iid) }