GitLab Google Chat Integration
Project description
Gitlab Google Chat Integration
A Python Flask web application that forwards webhook requests from GitLab to Google Chat.
Installation
ggci
is available as a Python package
on PyPI.
It can be installed via standard package managers in Python, e.g. pip:
pip install ggci
Usage
ggci
provides a standard Flask application factory create_app()
:
from ggci import create_app
app = create_app()
For how to use this application factory refer to the official Flask documentation.
Configuration
There are several ways how ggci
can be configured.
YAML config (default)
By default create_app()
looks for a YAML configuration file specified
by GGCI_CONFIG
environment variable.
Example config:
gitlab_token: xxxxxxx
google_chat_url: https://chat.googleapis.com/v1/spaces/...
user_mappings: # OPTIONAL, used for mentions; key: GitLab ID, val: Google Chat ID
5894317: 120984893489384029908 # Gandalf
4985120: 109238409842809234892 # Chuck Norris
Config Object
Alternatively, create_app()
also accepts optional argument config
of type
ggci.Config
.
from ggci import Config, create_app
config = Config(
gitlab_token='xxxxxxxxxx',
google_chat_url='https://chat.googleapis.com/v1/spaces/...',
user_mappings={
5894317: 120984893489384029908, # Gandalf
4985120: 109238409842809234892, # Chuck Norris
},
)
app = create_app(config=config)
Features
Merge Request Events Notifications
Notifications for merge requests actions. All notifications for one MR are posted to the same thread (identified by merge request ID). Supported actions:
- open: includes link with title, event author, mentions of assignees and description
- approved: includes link and event author
- update of assigness: includes link, event author, list of previous assigness and mentions of current assignees
- merged: includes link and action author
- closed: includes link and action author
- reopened: includes link and action author
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.