A GitLab plugin for Mattermost. This plugin supports a two-way integration between Mattermost and GitLab. This plugin supports Software-as-a-Service (SaaS) or on-premises versions of GitLab.
Originally developed by Romain Maneschi. This project is a fork of the mattermost-plugin-github. Thanks to all contributors of it.
Maintainer: @mickmister
Co-Maintainer: @hanzei
Notify your team of the latest updates by sending notifications from your GitLab group or repository to Mattermost channels. When team members log in the first time to Mattermost each day, they can get a post letting them know what issues and merge requests need their attention. They can also get a refresh of new events by selecting Refresh from every webhook configured in GitLab.
You can specify which events trigger a notification. They can see:
- issues - includes new and closed issues
- merges - includes new and closed merge requests
- pushes - includes pushes
- issue_comments - includes new issue comments
- merge_request_comments - include new merge-request comments
- pipeline - include pipeline
- tag - include tag creation
- pull_reviews - includes merge request reviews
- label:"" - must include "merges" or "issues" in feature list when using a label
- Defaults to "merges,issues,tag"
Each user in Mattermost is connected with their own personal GitLab account. Users can get a direct message in Mattermost when someone mentions them, requests their review, comments on, or modifies one of their merge requests/issues, or assigns them on GitLab.
Team members can stay up-to-date with how many reviews, todos, assigned issues, and assigned merge requests they have by using buttons in the Mattermost sidebar.
Get started by installing the GitLab plugin from the Marketplace.
- The GitLab plugin is included in the Plugin Marketplace in Mattermost v5.16 and above.
- For Mattermost v5.13 and earlier, a manual install is necessary.
- Go to Main Menu > Plugin Marketplace in Mattermost.
- Search for "gitlab" or manually find the plugin from the list and select Install.
- After the plugin has downloaded and been installed, select the Configure button.
If your server doesn't have access to the internet, you can download the latest plugin binary release and upload it to your server via System Console > Plugins > Plugin Management. The releases on this page are the same used by the Marketplace.
See the GitLab plugin release page for compatibility considerations.
- Go to https://gitlab.com/-/profile/applications or https://gitlab.yourdomain.com/-/profile/applications to register an OAuth app.
- 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
, replacinghttps://your-mattermost-url.com
with your Mattermost URL
- Name:
- Select
api
andread_user
in Scopes. - Save the application. Copy the Application ID and Secret fields in the resulting screen.
- In Mattermost, go to Plugins Marketplace > GitLab > Configure, and enter the GitLab URL, GitLab OAuth Client ID, and GitLab OAuth Client Secret.
- Go to System Console > Plugins > GitLab and do the following:
- Generate a new value for Webhook Secret.
- Generate a new value for At Rest Encryption Key.
- (Optional) GitLab Group: Lock the plugin to a single GitLab group by setting this field to the name of your GitLab group.
- (Optional) Enable Private Repositories: Allow the plugin to receive notifications from private repositories by setting this value to
true
. When enabled, existing users must reconnect their accounts to gain access to private project. Affected users will be notified by the plugin once private repositories are enabled.
- Select Save.
- Go to Plugins Marketplace > GitLab > Configure > Enable Plugin and select Enable to enable the GitLab plugin.
Run the /gitlab connect
slash command to connect your Mattermost account with GitLab.
For each project you want to receive notifications for or subscribe to, you must create a webhook. Run the subscribe slash command to watch events sent from GitLab.
/gitlab subscriptions add group[/project]
Run the webhook slash command to have GitLab send events to Mattermost.
/gitlab webhook add group[/project]
For versions prior to 1.2:
- In GitLab, go to the project you want to subscribe to, select Settings > Integrations in the sidebar.
- Set the following values:
- URL:
https://your-mattermost-url.com/plugins/com.github.manland.mattermost-plugin-gitlab/webhook
, replacinghttps://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: The webhook secret you copied previously.
- URL:
- Select all the events in Triggers.
- Add the webhook.
Mattermost-Plugin-Gitlab | Mattermost | GitLab |
---|---|---|
0.3.0 | 5.10+ | 11.2+ |
0.2.0 | 5.8+ | 11.2+ |
0.1.0 | 5.8+ | 11.2+ |
When a new version of the plugin is released to the Plugin Marketplace, the system will display a prompt asking you to update your current version of the GitLab plugin to the newest one. There may be a warning shown if there is a major version change that may affect the installation. Generally, updates are seamless and don't interrupt the user experience in Mattermost.
Interact with the GitLab plugin using the /gitlab
slash command.
Use /gitlab subscriptions add owner[/repo] [features]
to subscribe a Mattermost channel to receive posts for new merge requests and/or issues, or other features (as listed above), from a GitLab repository. Ensure that the webhook is configured, otherwise this will not work properly.
Use /gitlab subscriptions delete owner/repo
to unsubscribe from it.
/gitlab subscriptions list
lists what you have subscribed to.
Connect your Mattermost account to your GitLab account using /gitlab connect
and disconnect it using/gitlab disconnect
.
/gitlab me
displays the connected GitLab account.
Use /gitlab todo
to get a list of todos, assigned issues, assigned merge requests and merge requests awaiting your review.
Use /gitlab settings [setting] [value]
to update your settings for the plugin. There are two settings:
- To turn personal notifications
on
oroff
. - To turn reminders
on
oroff
for when you connect for the first time each day.
Run /gitlab help
to see what else the slash command can do.
Tip: Don't forget to add a webhook in GitLab!
This plugin contains both a server and web app portion. Read our documentation about the Developer Workflow and Developer Setup for more information about developing and extending plugins.
If you're interested in joining our community of developers who contribute to Mattermost - check out the current set of issues that are being requested.
You can also find issues labeled "Help Wanted" in the GitLab plugin repository that we have laid out the primary requirements for and could use some coding help from the community.
For Mattermost customers - please open a support case to ensure your issue is tracked properly.
For Questions, suggestions, and help - please find us on our forum at https://forum.mattermost.org/c/plugins.
Alternatively, join our public Mattermost server and join the Integrations and Apps channel.
Feel free to create a GitHub issue or join the GitLab Plugin channel on our community Mattermost instance to discuss.
Share your thoughts in the Plugin: GitLab Channel on our Mattermost community!
The version of a plugin is determined at compile time, automatically populating a version
field in the plugin manifest:
- If the current commit matches a tag, the version will match after stripping any leading
v
, e.g.1.3.1
. - Otherwise, the version will combine the nearest tag with
git rev-parse --short HEAD
, e.g.1.3.1+d06e53e1
. - If there is no version tag, an empty version will be combined with the short hash, e.g.
0.0.0+76081421
.
To disable this behaviour, manually populate and maintain the version
field.