Commit 20fb62c2 authored by Ethan Urie's avatar Ethan Urie

Merge branch '347389-remove-support-for-recursion-param-passed-in-data' into 'master'

Remove support for recursion param passed to worker in `data`

See merge request gitlab-org/gitlab!81772
parents 150d854e d2c1558f
......@@ -13,9 +13,6 @@ class WebHookWorker
worker_has_external_dependencies!
# Webhook recursion detection properties may be passed through the `data` arg.
# This will be migrated to the `params` arg over the next few releases.
# See https://gitlab.com/gitlab-org/gitlab/-/issues/347389.
def perform(hook_id, data, hook_name, params = {})
hook = WebHook.find_by_id(hook_id)
return unless hook
......@@ -23,9 +20,6 @@ class WebHookWorker
data = data.with_indifferent_access
params.symbolize_keys!
# TODO: Remove in 14.9 https://gitlab.com/gitlab-org/gitlab/-/issues/347389
params[:recursion_detection_request_uuid] ||= data.delete(:_gitlab_recursion_detection_request_uuid)
# Before executing the hook, reapply any recursion detection UUID that was initially
# present in the request header so the hook can pass this same header value in its request.
Gitlab::WebHooks::RecursionDetection.set_request_uuid(params[:recursion_detection_request_uuid])
......
......@@ -28,15 +28,6 @@ RSpec.describe WebHookWorker do
.to change { Gitlab::WebHooks::RecursionDetection::UUID.instance.request_uuid }.to(uuid)
end
it 'retrieves recursion detection data, reinstates it, and cleans it from payload when passed through as data', :request_store, :aggregate_failures do
uuid = SecureRandom.uuid
full_data = data.merge({ _gitlab_recursion_detection_request_uuid: uuid })
expect_next(WebHookService, project_hook, data.with_indifferent_access, hook_name, anything).to receive(:execute)
expect { subject.perform(project_hook.id, full_data, hook_name) }
.to change { Gitlab::WebHooks::RecursionDetection::UUID.instance.request_uuid }.to(uuid)
end
it_behaves_like 'worker with data consistency',
described_class,
data_consistency: :delayed
......
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