summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2018-05-31 08:33:06 +0000
committerSean McGivern <sean@mcgivern.me.uk>2018-05-31 08:33:06 +0000
commitec1d3e104afddf7c8a5f6f5d8bf1ffee99a8f551 (patch)
treeb21e4cd378a6e936f4891d73c97c9ce43b72493c
parent539b2afd051e1891e946356420705bb37bb858a4 (diff)
parentc8a30e3d83158a6ec759e656fe0dba55ac10593a (diff)
downloadgitlab-ce-ec1d3e104afddf7c8a5f6f5d8bf1ffee99a8f551.tar.gz
Merge branch '46903-osw-fix-permitted-params-filtering-on-merge-scheduling' into 'master'
Adjust permitted params filtering on merge scheduling Closes #46903 See merge request gitlab-org/gitlab-ce!19255
-rw-r--r--app/controllers/projects/merge_requests_controller.rb4
-rw-r--r--changelogs/unreleased/46903-osw-fix-permitted-params-filtering-on-merge-scheduling.yml5
-rw-r--r--spec/controllers/projects/merge_requests_controller_spec.rb4
3 files changed, 9 insertions, 4 deletions
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb
index 507a07c6e1b..ecea6e1b2bf 100644
--- a/app/controllers/projects/merge_requests_controller.rb
+++ b/app/controllers/projects/merge_requests_controller.rb
@@ -296,14 +296,14 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
elsif @merge_request.actual_head_pipeline.success?
# This can be triggered when a user clicks the auto merge button while
# the tests finish at about the same time
- @merge_request.merge_async(current_user.id, params)
+ @merge_request.merge_async(current_user.id, merge_params)
:success
else
:failed
end
else
- @merge_request.merge_async(current_user.id, params)
+ @merge_request.merge_async(current_user.id, merge_params)
:success
end
diff --git a/changelogs/unreleased/46903-osw-fix-permitted-params-filtering-on-merge-scheduling.yml b/changelogs/unreleased/46903-osw-fix-permitted-params-filtering-on-merge-scheduling.yml
new file mode 100644
index 00000000000..b3c8c8e4045
--- /dev/null
+++ b/changelogs/unreleased/46903-osw-fix-permitted-params-filtering-on-merge-scheduling.yml
@@ -0,0 +1,5 @@
+---
+title: Adjust permitted params filtering on merge scheduling
+merge_request:
+author:
+type: fixed
diff --git a/spec/controllers/projects/merge_requests_controller_spec.rb b/spec/controllers/projects/merge_requests_controller_spec.rb
index 5efaaf2bb3a..6e8de6db9c3 100644
--- a/spec/controllers/projects/merge_requests_controller_spec.rb
+++ b/spec/controllers/projects/merge_requests_controller_spec.rb
@@ -326,8 +326,8 @@ describe Projects::MergeRequestsController do
expect(json_response).to eq('status' => 'success')
end
- it 'starts the merge immediately' do
- expect(MergeWorker).to receive(:perform_async).with(merge_request.id, anything, anything)
+ it 'starts the merge immediately with permitted params' do
+ expect(MergeWorker).to receive(:perform_async).with(merge_request.id, anything, { 'squash' => false })
merge_with_sha
end