summaryrefslogtreecommitdiff
path: root/lib/api/merge_requests.rb
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2018-01-15 16:21:04 +0100
committerYorick Peterse <yorickpeterse@gmail.com>2018-02-01 17:00:46 +0100
commitcca61980d5ad9c4db65b9498fe49d936657bc0e2 (patch)
tree1a844c4121c0530ea35f29d035e65a16be6e491a /lib/api/merge_requests.rb
parent5b73e0eb35f5b9b78c228a4867ef78538ef05653 (diff)
downloadgitlab-ce-cca61980d5ad9c4db65b9498fe49d936657bc0e2.tar.gz
Track and act upon the number of executed queriesquery-counts
This ensures that we have more visibility in the number of SQL queries that are executed in web requests. The current threshold is hardcoded to 100 as we will rarely (maybe once or twice) change it. In production and development we use Sentry if enabled, in the test environment we raise an error. This feature is also only enabled in production/staging when running on GitLab.com as it's not very useful to other users.
Diffstat (limited to 'lib/api/merge_requests.rb')
-rw-r--r--lib/api/merge_requests.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/api/merge_requests.rb b/lib/api/merge_requests.rb
index 420aaf1c964..719afa09295 100644
--- a/lib/api/merge_requests.rb
+++ b/lib/api/merge_requests.rb
@@ -152,6 +152,8 @@ module API
use :optional_params
end
post ":id/merge_requests" do
+ Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab-ce/issues/42316')
+
authorize! :create_merge_request, user_project
mr_params = declared_params(include_missing: false)
@@ -256,6 +258,8 @@ module API
at_least_one_of(*at_least_one_of_ce)
end
put ':id/merge_requests/:merge_request_iid' do
+ Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab-ce/issues/42318')
+
merge_request = find_merge_request_with_access(params.delete(:merge_request_iid), :update_merge_request)
mr_params = declared_params(include_missing: false)
@@ -283,6 +287,8 @@ module API
optional :sha, type: String, desc: 'When present, must have the HEAD SHA of the source branch'
end
put ':id/merge_requests/:merge_request_iid/merge' do
+ Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab-ce/issues/42317')
+
merge_request = find_project_merge_request(params[:merge_request_iid])
merge_when_pipeline_succeeds = to_boolean(params[:merge_when_pipeline_succeeds])