diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 12:45:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 12:45:46 +0300 |
commit | a7b3560714b4d9cc4ab32dffcd1f74a284b93580 (patch) | |
tree | 7452bd5c3545c2fa67a28aa013835fb4fa071baf /app/workers/web_hook_worker.rb | |
parent | ee9173579ae56a3dbfe5afe9f9410c65bb327ca7 (diff) |
Add latest changes from gitlab-org/gitlab@14-8-stable-eev14.8.0-rc42
Diffstat (limited to 'app/workers/web_hook_worker.rb')
-rw-r--r-- | app/workers/web_hook_worker.rb | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/app/workers/web_hook_worker.rb b/app/workers/web_hook_worker.rb index 952ac94d5e6..fdcd22128a3 100644 --- a/app/workers/web_hook_worker.rb +++ b/app/workers/web_hook_worker.rb @@ -6,14 +6,14 @@ class WebHookWorker include ApplicationWorker feature_category :integrations - loggable_arguments 2 + loggable_arguments 2, 3 data_consistency :delayed sidekiq_options retry: 4, dead: false urgency :low worker_has_external_dependencies! - # Webhook recursion detection properties are passed through the `data` arg. + # 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 = {}) @@ -21,12 +21,14 @@ class WebHookWorker return unless hook data = data.with_indifferent_access + params.symbolize_keys! - # 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. - recursion_detection_uuid = data.delete(:_gitlab_recursion_detection_request_uuid) - Gitlab::WebHooks::RecursionDetection.set_request_uuid(recursion_detection_uuid) + # 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]) WebHookService.new(hook, data, hook_name, jid).execute end |