Class: ProjectHook

Inherits:
WebHook show all
Extended by:
Gitlab::Utils::Override
Includes:
Limitable, Presentable, TriggerableHooks
Defined in:
app/models/hooks/project_hook.rb

Constant Summary

Constants included from Limitable

Limitable::GLOBAL_SCOPE

Constants included from TriggerableHooks

TriggerableHooks::AVAILABLE_TRIGGERS

Constants inherited from WebHook

WebHook::BACKOFF_GROWTH_FACTOR, WebHook::FAILURE_THRESHOLD, WebHook::INITIAL_BACKOFF, WebHook::MAX_BACKOFF, WebHook::MAX_FAILURES

Constants inherited from ApplicationRecord

ApplicationRecord::MAX_PLUCK

Instance Method Summary collapse

Methods included from Gitlab::Utils::Override

extended, extensions, included, method_added, override, prepended, queue_verification, verify!

Methods included from Presentable

#present

Methods inherited from WebHook

#active_state, #allow_local_requests?, #async_execute, #backoff!, #disable!, #enable!, #executable?, #execute, #failed!, #help_path, #next_backoff, #permanently_disabled?, #rate_limited?, #temporarily_disabled?

Methods inherited from ApplicationRecord

cached_column_list, #create_or_load_association, declarative_enum, default_select_columns, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, #readable_by?, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, #to_ability_name, underscore, where_exists, where_not_exists, with_fast_read_statement_timeout, without_order

Methods included from SensitiveSerializableHash

#serializable_hash

Instance Method Details

#application_contextObject


40
41
42
# File 'app/models/hooks/project_hook.rb', line 40

def application_context
  super.merge(project: project)
end

#parentObject


45
46
47
# File 'app/models/hooks/project_hook.rb', line 45

def parent
  project
end

#pluralized_nameObject


30
31
32
# File 'app/models/hooks/project_hook.rb', line 30

def pluralized_name
  _('Webhooks')
end

#rate_limitObject


35
36
37
# File 'app/models/hooks/project_hook.rb', line 35

def rate_limit
  project.actual_limits.limit_for(:web_hook_calls)
end