diff --git a/CHANGELOG b/CHANGELOG index 49bf983eb5ed5f4da2480361955172613562269c..61c5e707e9e1fd05e5f3d6bb74dfb2ca3cd57ac0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -27,6 +27,7 @@ v 7.3.0 - Project wiki search (Ralf Seidler) - Enabled Shibboleth authentication support (Matus Banas) - Zen mode (fullscreen) for issues/MR/notes (Robert Schilling) + - Add ability to configure webhook timeout via gitlab.yml (Wes Gurney) v 7.2.1 - Delete orphaned labels during label migration (James Brooks) diff --git a/app/models/web_hook.rb b/app/models/web_hook.rb index 6cf0c1f683e1cec77858ce229d9610735635d920..752eb8074ac8369b3f106e8b1fca21db9b5fb601 100644 --- a/app/models/web_hook.rb +++ b/app/models/web_hook.rb @@ -23,7 +23,7 @@ class WebHook < ActiveRecord::Base default_value_for :merge_requests_events, false # HTTParty timeout - default_timeout 10 + default_timeout Gitlab.config.gitlab.webhook_timeout validates :url, presence: true, format: { with: URI::regexp(%w(http https)), message: "should be a valid url" } diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 8e85634d0546a96a946807820c350eb852b0a815..f041d692f10901ff76d3530ab95163978d9b488d 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -80,6 +80,10 @@ production: &base snippets: false visibility_level: "private" # can be "private" | "internal" | "public" + ## Webhook settings + # Number of seconds to wait for HTTP response after sending webhook HTTP POST request (default: 10) + # webhook_timeout: 10 + ## Repository downloads directory # When a user clicks e.g. 'Download zip' on a project, a temporary zip file is created in the following directory. # The default is 'tmp/repositories' relative to the root of the Rails app. @@ -263,9 +267,9 @@ test: port: 80 # When you run tests we clone and setup gitlab-shell - # In order to setup it correctly you need to specify + # In order to setup it correctly you need to specify # your system username you use to run GitLab - # user: YOUR_USERNAME + # user: YOUR_USERNAME satellites: path: tmp/tests/gitlab-satellites/ gitlab_shell: diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 136622c65a227dfe6b10ccfe772c6a45477d169d..5b7e69fbc6af909432e0abc5df5faf278506313a 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -92,6 +92,7 @@ Settings.gitlab['restricted_visibility_levels'] = Settings.send(:verify_constant Settings.gitlab['username_changing_enabled'] = true if Settings.gitlab['username_changing_enabled'].nil? Settings.gitlab['issue_closing_pattern'] = '([Cc]lose[sd]|[Ff]ixe[sd]) #(\d+)' if Settings.gitlab['issue_closing_pattern'].nil? Settings.gitlab['default_projects_features'] ||= {} +Settings.gitlab['webhook_timeout'] ||= 10 Settings.gitlab.default_projects_features['issues'] = true if Settings.gitlab.default_projects_features['issues'].nil? Settings.gitlab.default_projects_features['merge_requests'] = true if Settings.gitlab.default_projects_features['merge_requests'].nil? Settings.gitlab.default_projects_features['wiki'] = true if Settings.gitlab.default_projects_features['wiki'].nil?