diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-22 12:07:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-22 12:07:15 +0300 |
commit | 4c7e34071eceb05a9ce271354c21de7487e4ff84 (patch) | |
tree | c8dde05c2cd3ad6d110668db9b3a87f79fd57b85 /app/services/web_hook_service.rb | |
parent | 07bb2516a08ccfec493ba661502f8fd8a6229c67 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/web_hook_service.rb')
-rw-r--r-- | app/services/web_hook_service.rb | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/app/services/web_hook_service.rb b/app/services/web_hook_service.rb index b1d8872aa5e..c0727e52cc3 100644 --- a/app/services/web_hook_service.rb +++ b/app/services/web_hook_service.rb @@ -36,7 +36,7 @@ class WebHookService def initialize(hook, data, hook_name, uniqueness_token = nil, force: false) @hook = hook - @data = data + @data = data.to_h @hook_name = hook_name.to_s @uniqueness_token = uniqueness_token @force = force @@ -70,9 +70,6 @@ class WebHookService end log_execution( - trigger: hook_name, - url: hook.url, - request_data: data, response: response, execution_duration: Gitlab::Metrics::System.monotonic_time - start_time ) @@ -86,9 +83,6 @@ class WebHookService Gitlab::Json::LimitedEncoder::LimitExceeded, URI::InvalidURIError => e execution_duration = Gitlab::Metrics::System.monotonic_time - start_time log_execution( - trigger: hook_name, - url: hook.url, - request_data: data, response: InternalErrorResponse.new, execution_duration: execution_duration, error_message: e.to_s @@ -139,14 +133,14 @@ class WebHookService make_request(post_url, basic_auth) end - def log_execution(trigger:, url:, request_data:, response:, execution_duration:, error_message: nil) + def log_execution(response:, execution_duration:, error_message: nil) category = response_category(response) log_data = { - trigger: trigger, - url: url, + trigger: hook_name, + url: hook.url, execution_duration: execution_duration, request_headers: build_headers, - request_data: request_data, + request_data: data, response_headers: format_response_headers(response), response_body: safe_response_body(response), response_status: response.code, |