Some checks failed
Server CI / Postgres (shard 0) (push) Has been skipped
Server CI / Postgres (shard 3) (push) Has been skipped
BuildEnv Docker Image / build-image (push) Failing after 4s
BuildEnv Docker Image / build-image-fips (push) Failing after 4s
Migration Review & Release Notes / Generate migration review & release notes (push) Failing after 3s
Server CI / Build Environment (push) Failing after 3s
Server CI / Postgres (shard 1) (push) Has been skipped
Tools CI / check-style (mattermost-govet) (push) Failing after 4s
Server CI / Postgres (shard 2) (push) Has been skipped
Tools CI / check-style (mmgotool) (push) Failing after 3s
Server CI / Elasticsearch v8 Compatibility (push) Has been skipped
Server CI / OpenSearch v2 Compatibility (push) Has been skipped
Server CI / Postgres FIPS (shard 0) (push) Has been skipped
Tools CI / Test (mattermost-govet) (push) Failing after 3s
Server CI / Postgres FIPS (shard 1) (push) Has been skipped
Server CI / Postgres FIPS (shard 2) (push) Has been skipped
Tools CI / Test (mmgotool) (push) Failing after 3s
Server CI / Postgres FIPS (shard 3) (push) Has been skipped
Server CI / Run mmctl tests (push) Has been skipped
Server CI / Run mmctl tests (FIPS) (push) Has been skipped
Server CI / Merge Postgres Test Results (push) Has been skipped
Server CI / Merge Postgres FIPS Test Results (push) Has been skipped
Server CI / Check backport migrations (push) Has been skipped
Server CI / Check generated files (push) Has been skipped
Server CI / check-style (push) Has been skipped
Server CI / Vet API (push) Has been skipped
Server CI / Build mattermost server app (push) Has been skipped
Server CI / Server CI Complete (push) Failing after 2s
Server CI / Server CI Artifacts (push) Has been skipped
Server CI / Sentry Upload (push) Has been skipped
Server CI / Server CI Report (push) Failing after 5m1s
Server CI Nightly Race / Race Detector (push) Has been skipped
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Webapp CI Cache Warm / Warm Webapp node_modules Cache (push) Has been cancelled
E2E CI Cache Warm / Warm E2E npm Registry Cache (push) Has been cancelled
API / build (push) Has been cancelled
Web App CI / check-types (push) Has been cancelled
Web App CI / check-lint (push) Has been cancelled
Web App CI / check-i18n (push) Has been cancelled
Web App CI / check-external-links (push) Has been cancelled
Web App CI / test (platform) (push) Has been cancelled
Web App CI / test (mattermost-redux) (push) Has been cancelled
Web App CI / test (channels shard 1/4) (push) Has been cancelled
Web App CI / test (channels shard 2/4) (push) Has been cancelled
Web App CI / test (channels shard 3/4) (push) Has been cancelled
Web App CI / test (channels shard 4/4) (push) Has been cancelled
Web App CI / upload-coverage (push) Has been cancelled
Web App CI / build (push) Has been cancelled
YAML Lint / yamllint (push) Has been cancelled
Push mirrored docker images / cd/Push mirrored docker images (push) Has been cancelled
docs-cd / Build and deploy docs (push) Has been cancelled
Docs CI / build (push) Has been cancelled
E2E Cache Warm: Cypress deps / Warm Cypress deps cache (push) Has been cancelled
Scorecards supply-chain security / Scorecard analysis (push) Has been cancelled
Server CI Weekly / Postgres FIPS (push) Has been skipped
Server CI Weekly / Run mmctl tests (FIPS) (push) Has been skipped
Server CI Weekly / Postgres with binary parameters (push) Has been skipped
Server CI Weekly / Build Environment (push) Failing after 1s
Server CI Cache Warm / Warm Go Module and Build Cache (push) Failing after 2s
Server CI Nightly Race / Build Environment (push) Failing after 1s
216 lines
11 KiB
Plaintext
216 lines
11 KiB
Plaintext
---
|
|
title: "Connect GitLab to Mattermost"
|
|
sidebar_label: "GitLab"
|
|
---
|
|
import useBaseUrl from '@docusaurus/useBaseUrl';
|
|
import Tabs from '@theme/Tabs';
|
|
import TabItem from '@theme/TabItem';
|
|
|
|
<PlanAvailability slug="all-commercial" />
|
|
|
|
Minimize distractions and reduce context switching between your GitLab code repositories and your communication platform by integrating GitLab with Mattermost. You control which events trigger notifications beyond default events, including merges, issue comments, merge request comments, pipelines, pull reviews, and many more. Help your teams stay focused and productive with daily task summaries, real-time updates and notifications on new and closed merge requests, new and closed issues, and tag creation events, directly from Mattermost channel subscriptions.
|
|
|
|
Mattermost supports both Software-as-a-Service (SaaS) and on-premises versions of GitLab.
|
|
|
|

|
|
|
|
## Deploy
|
|
|
|
A Mattermost system admin must perform the following steps to deploy the GitLab integration.
|
|
|
|
### Install the integration
|
|
|
|
1. In Mattermost, from the Product menu <img src={useBaseUrl('/img/ui/products_E82F.svg')} alt="Navigate between Channels, collaborative playbooks, and boards using the product menu icon." className="theme-icon" />, select **App Marketplace**.
|
|
2. Search for or scroll to GitLab, and select **Install**.
|
|
|
|
### Set up the integration
|
|
|
|
You can configure the GitLab integration using either the built-in setup wizard (recommended) or by following the manual configuration steps.
|
|
|
|
<Tabs>
|
|
<TabItem value="setup-wizard-recommended" label="Setup wizard (recommended)">
|
|
|
|
The recommended way to configure the GitLab integration is using the built-in setup wizard. The wizard guides you through each step of the configuration process, including creating the OAuth app in GitLab.
|
|
|
|
1. In any Mattermost channel, run the `/gitlab setup` slash command.
|
|
2. Follow the interactive prompts to complete the setup.
|
|
|
|
The wizard walks you through:
|
|
|
|
- Creating and configuring an OAuth app in GitLab
|
|
- Configuring the plugin settings in Mattermost
|
|
- Announcing the integration to your team
|
|
|
|
You can also run individual setup steps at any time using the following subcommands:
|
|
|
|
- `/gitlab setup oauth`: Configure the OAuth2 application in GitLab.
|
|
- `/gitlab setup announce`: Announce the integration availability to designated channels.
|
|
|
|
</TabItem>
|
|
<TabItem value="manual-configuration" label="Manual configuration">
|
|
|
|
If you prefer to configure the integration manually instead of using the setup wizard, follow the steps below.
|
|
|
|
**Register an OAuth app in GitLab**
|
|
|
|
1. Go to `https://gitlab.com/-/profile/applications` or `https://gitlab.YOURDOMAIN.com/-/profile/applications`, replacing `YOURDOMAIN.COM` with your GitLab URL, to register an OAuth app with GitLab.
|
|
2. Set the following values:
|
|
|
|
> - **Name**: `Mattermost GitLab Plugin - <YOUR COMPANY NAME>`
|
|
> - **Redirect URI**: `https://YOUR-MATTERMOST-URL.COM/plugins/com.github.manland.mattermost-plugin-gitlab/oauth/complete`, replacing `YOUR-MATTERMOST-URL.COM` with your Mattermost URL. This value must match the Mattermost server URL you use to log in.
|
|
|
|
3. Select `api` and `read_user` in **Scopes**.
|
|
4. Save your changes. Copy the **Application ID** and **Secret** fields in the resulting screen.
|
|
|
|
**Configure the integration in Mattermost**
|
|
|
|
1. In Mattermost, go to **System Console \> Plugins \> GitLab** and configure the following settings, then select **Save**:
|
|
|
|
> - Enter the **GitLab URL**, **GitLab OAuth Client ID**, and **GitLab OAuth Client Secret** you obtained when registering the OAuth app in GitLab.
|
|
>
|
|
> - Generate a **Webhook Secret** and **At Rest Encryption Key** by selecting **Generate**.
|
|
>
|
|
> - (Optional) **GitLab Group**: Lock the integration to a single GitLab group.
|
|
>
|
|
> - (Optional) **Enable Private Repositories**: Enable the ability to work with private repositories. Affected users are notified once private repositories are enabled, and must reconnect their GitLab accounts to gain access to private repositories.
|
|
>
|
|
> - (Optional) **Enable Child Pipeline Notifications**: When enabled, allows notifications for child pipeline events in addition to parent pipeline events. When disabled, only parent pipeline notifications are sent. This setting helps reduce notification noise in environments with complex CI/CD pipeline structures that use child pipelines extensively.
|
|
>
|
|
> - (Optional) **Enable Code Previews**: Control automatic expansion of GitLab file permalinks with code previews. Options include:
|
|
>
|
|
> - **Enable for public projects** (Default): Shows previews only for public GitLab repositories.
|
|
>
|
|
> - **Enable for public and private projects**: Shows previews for both public and private repositories.
|
|
>
|
|
> <div class="warning">
|
|
>
|
|
> <div class="title">
|
|
>
|
|
> Warning
|
|
>
|
|
> </div>
|
|
>
|
|
> This setting has the potential to leak confidential code into public channels in cases where users with access to private GitLab repositories post permalinks in public Mattermost channels. The plugin automatically generates previews using the poster's GitLab permissions, allowing other channel members without access to view the confidential code.
|
|
>
|
|
> </div>
|
|
>
|
|
> - **Disable**: Completely disables code preview functionality.
|
|
>
|
|
> **Supported Permalink Types:**
|
|
>
|
|
> - Single line permalinks: Shows target line plus 3 lines of context
|
|
> - File permalinks: Shows file information (no code preview)
|
|
> - Line range permalinks: Shows file information (no code preview)
|
|
>
|
|
> **Preview Limits:**
|
|
>
|
|
> - Maximum 10 lines displayed per preview (single line permalinks may show fewer preview lines due to context limits)
|
|
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
|
|
## Upgrade
|
|
|
|
We recommend updating this integration as new versions are released. Generally, updates are seamless and don't interrupt the user experience in Mattermost. Visit the [Releases page](https://github.com/mattermost/mattermost-plugin-gitlab/releases) for the latest release, available releases, and compatibility considerations.
|
|
|
|
## Enable
|
|
|
|
Once you setup the integration, notify your teams that they can [connect their GitLab accounts to Mattermost](#connect-a-gitlab-account-to-mattermost).
|
|
|
|
## Use
|
|
|
|
Users who want to use GitLab interconnectivity must connect their GitLab account to Mattermost.
|
|
|
|
Once connected, you'll receive direct messages from the GitLab bot in Mattermost when someone mentions you, requests a review, comments on, or modifies one of your merge requests/issues, or assigns you to an issue on GitLab.
|
|
|
|
### Connect a GitLab account to Mattermost
|
|
|
|
Run the `/gitlab connect` slash command in any Mattermost channel to link your Mattermost account with your GitLab account.
|
|
|
|
Disconnect a GitLab account by running the `/gitlab disconnect` slash command. Run the `/gitlab me` slash command to review which account is connected to GitLab.
|
|
|
|
Once connected, run the `/gitlab help` slash command to see what you can do.
|
|
|
|
### Get started
|
|
|
|
Run the `/gitlab todo` slash command to get a list of to-do's, assigned issues, assigned merge requests and merge requests awaiting your review. Alternatively, use the options located in the left sidebar.
|
|
|
|
Run the `/gitlab webhook` slash command to have GitLab send events to Mattermost. For example: `/gitlab webhook add group[/project]`
|
|
|
|
### Channel subscriptions
|
|
|
|
Run the `/gitlab subscriptions list` to review all of your subscriptions.
|
|
|
|
Run the `/gitlab subscriptions add group[/project] [features]` slash command to subscribe a Mattermost channel and receive posts for new merge requests, issues, or other features, from a GitLab project. To unsubscribe and stop receiving posts, run the `/gitlab subscriptions delete group[/project]` slash command.
|
|
|
|
The following features are supported for channel subscriptions:
|
|
|
|
- `merges` - Get notified when merge requests are merged
|
|
- `issues` - Get notified when issues are created
|
|
- `pushes` - Get notified when commits are pushed to a branch
|
|
- `issue_comments` - Get notified when comments are made on issues
|
|
- `merge_request_comments` - Get notified when comments are made on merge requests
|
|
- `tag` - Get notified when tags are created
|
|
- `pipeline` - Get notified about pipeline events (includes child pipeline events if enabled in plugin configuration)
|
|
- `wiki` - Get notified about wiki page events
|
|
- `releases` - Get notified when releases are created
|
|
- `deployments` - Get notified about deployment events
|
|
|
|
For example, to subscribe to release and deployment events: `/gitlab subscriptions add group[/project] releases,deployments`
|
|
|
|
For each project you want to receive notifications for or subscribe to, create a webhook in a channel where you want to watch events sent from GitLab by running the `/gitlab webhook` slash command. For example: `/gitlab webhook add group[/project]`
|
|
|
|
<Note>
|
|
|
|
For GitLab versions prior to 1.2:
|
|
|
|
1. In GitLab, go to the project you want to subscribe to, and select **Settings \> Integrations** in the sidebar.
|
|
2. Set the following values:
|
|
|
|
> - **URL**: `https://YOUR-MATTERMOST-URL.COM/plugins/com.github.manland.mattermost-plugin-gitlab/webhook`, replacing `https://YOUR-MATTERMOST-URL.COM` with your Mattermost URL. Ensure that you add `/plugins/com.github.manland.mattermost-plugin-gitlab/webhook` to the URL, or the webhook won't work.
|
|
> - **Secret Token**: Copy the webhook secret you generated earlier.
|
|
> - Select all the events in **Triggers**.
|
|
> - Add the webhook.
|
|
|
|
</Note>
|
|
|
|
### Create issues and manage comments
|
|
|
|
You can create GitLab issues and manage issue comments directly from Mattermost using slash commands and interactive modals.
|
|
|
|
#### Create a GitLab issue
|
|
|
|
Run the `/gitlab issue create` slash command to open an interactive modal where you can create a new GitLab issue. The modal allows you to perform the following actions:
|
|
|
|
- Set the issue title and description
|
|
- Assign labels
|
|
- Set the assignee
|
|
- Choose the milestone
|
|
- Select the target project
|
|
|
|
#### Attach comments to existing issues
|
|
|
|
Run the `/gitlab issue comment [issue-number]` slash command to attach a comment to an existing GitLab issue. This opens an interactive modal where you can compose and submit your comment directly from Mattermost.
|
|
|
|
### Update settings
|
|
|
|
Run the `/gitlab settings [setting] [value]` slash command to update your preferences for the integration:
|
|
|
|
- Turn personal notifications on or off.
|
|
- Turn reminders on or off when you connect initially each day.
|
|
|
|
## Get help
|
|
|
|
Mattermost customers can open a [Mattermost support case](https://support.mattermost.com/hc/en-us/requests/new). To report a bug, please open a GitHub issue against the [Mattermost GitLab plugin repository](https://github.com/mattermost/mattermost-plugin-gitlab).
|
|
|
|
For questions, feedback, and assistance, join our public [Integrations and Apps channel](https://community.mattermost.com/core/channels/integrations) on the [Mattermost Community Server](https://community.mattermost.com/) for assistance.
|
|
|
|
Mattermost Team Edition and Free customers can visit the Mattermost [peer-to-peer troubleshooting forum](https://forum.mattermost.com/c/trouble-shoot/16) to access the global Mattermost Community for assistance.
|
|
|
|
<Tip>
|
|
|
|
Watch [this on-demand webinar on release management with Mattermost and GitLab](https://mattermost.com/webinar/release-management-with-gitlab/) to learn how to streamline and standardize your release processes, while reducing the amount of effort required to ship your latest releases.
|
|
|
|
</Tip>
|