gitlab-org/gitlab
Integrations and webhooks
Outbound webhooks, third-party integrations (Slack, Jira, Mattermost, etc.), and the unified "integrations" framework.
Source
app/models/integration.rb # Base STI class
app/models/integrations/ # ~70 integrations: jira, slack, mattermost, ...
app/services/integrations/ # CRUD
app/services/web_hook_service.rb # Webhook delivery
app/services/web_hooks/ # Per-hook services
app/models/web_hook.rb, web_hook_log.rb
app/workers/web_hooks/ # Async delivery
lib/gitlab/data_builder/ # Build webhook payloads
lib/gitlab/hook_data/ # Polymorphic hook data buildersFrontend lives under app/assets/javascripts/integrations/.
Integrations
Each integration is a single-table-inheritance subclass of Integration. Common types:
Integrations::Jira(and Jira Cloud / Jira Server variants).Integrations::Slack,SlackSlashCommands,MattermostSlashCommands.Integrations::Mattermost,Telegram,MicrosoftTeams.Integrations::Jenkins,Bamboo,Buildkite.Integrations::Pipelines::Email.Integrations::Discord,Pumble,Webex Teams.Integrations::Zentao,Asana,Bugzilla.Integrations::Datadog,EmailsOnPush,Pivotaltracker.Integrations::Prometheus(legacy),Apple App Store,Google Play.Integrations::ExternalWiki,Hangouts Chat,Unify Circuit.Integrations::Phorge,Confluence,IrkerService.- Many more — about 70 in total.
Each integration declares:
- Configurable fields (URLs, tokens, channel names).
- Which events it listens to (push, MR, issue, pipeline, deployment, etc.).
- An
execute(data)method that performs the integration action.
Webhooks
WebHook is a generic hook. Subclasses include ProjectHook, GroupHook, SystemHook, ServiceHook. Lifecycle:
- A producer (e.g.,
Notes::CreateService) publishes data viaapp/services/system_hooks_service.rbor viaWebHookService. WebHookServiceenqueues a job per matching hook.- The worker delivers via HTTP, retries on failure, and logs to
web_hook_log. - Repeated failures eventually disable the hook (auto-disable rule) until manually re-enabled.
Hook data builders
Each hook event (push, MR, issue, deploy) has a builder under lib/gitlab/data_builder/ that produces the JSON payload. lib/gitlab/hook_data/ builds polymorphic event payloads (consumed by both webhooks and integrations).
Slack and slash commands
GitLab offers two flavors:
- Slack Notifications (outbound).
- Slack Slash Commands (inbound
/gitlab issue new ...).
Slash commands are routed through lib/api/slack/ and app/controllers/projects/slash_commands_controller.rb.
Jira Connect (Atlassian Marketplace)
app/controllers/jira_connect/, app/services/jira_connect_*, and app/services/atlassian/jira_connect/. The Atlassian app is registered separately and posts to webhooks here.
Microsoft Teams
app/controllers/microsoft_teams/, app/models/integrations/microsoft_teams.rb. Includes Adaptive Card payloads.
EE-only integrations
Integrations gated by license:
- Compliance integrations.
- Beyond Identity device trust.
- Atlassian Crowd, OneLogin SAML, etc.
Where to add a new integration
- Add
app/models/integrations/<name>.rbsubclassingIntegration. - Implement
execute(data),fields,title,description. - Add to the registration list (
Integration.available_integration_names). - Add tests under
spec/models/integrations/<name>_spec.rb. - Add UI fields to
app/assets/javascripts/integrations/.
Related
- EventStore — many integrations subscribe to events.
- Sidekiq jobs — webhook delivery.
- Source code management — push events drive most webhooks.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.