Giter Club home page Giter Club logo

mergentle-reminder's Introduction

Mergentle Reminder

Workflow status Docker Pulls

Bot Icon

Mergentle Reminder is a Slack bot that periodically checks configured GitLab projects and groups for opened merge requests, then sends a summary list of merge requests to review to the configured Slack channel.

The name "Mergentle Reminder" is a playful combination of the words "merge" and "gentle." The name emphasizes the purpose of the project, which is to gently remind the team to review open merge requests.

Features

  • Sends a summary list of merge requests to a Slack channel.
  • Supports GitLab projects and groups.
  • Filters out draft merge requests.
  • Retrieves approvers and additional merge request information.
  • Configurable with a YAML file or environment variables.

Screenshot

Screenshot

Configuration

You can configure the Mergentle Reminder bot using a config.yaml file or by setting the environment variables.

Example config can be found in config.yaml.example.

In addition to the config.yaml file, the following environment variables can be set:

  • GITLAB_URL: The URL of your GitLab instance (defaults to https://gitlab.com).
  • GITLAB_TOKEN: Your GitLab personal access token.
  • SLACK_WEBHOOK_URL: The webhook URL for the Slack channel where the bot will send messages.
  • PROJECTS: A comma-separated list of GitLab project IDs to check for merge requests.
  • GROUPS: A comma-separated list of GitLab group IDs to check for merge requests.
  • CONFIG_PATH (optional): The path to the config.yaml configuration file. Defaults to config.yaml.

Environment variables take precedence over the config.yaml file.

Building and Running the Application

Locally

Build the application:

go build

Run the application:

GITLAB_TOKEN=<your_gitlab_token> SLACK_WEBHOOK_URL=<your_slack_webhook_url> ./mergentle-reminder

Using Docker

Build the Docker image:

docker build -t your-dockerhub-username/mergentle-reminder:latest .

Run the Docker container:

docker run -e GITLAB_TOKEN=<your_gitlab_token> -e SLACK_WEBHOOK_URL=<your_slack_webhook_url> -v $(pwd)/config.yaml:/config/config.yaml your-dockerhub-username/mergentle-reminder:latest

Deploying to Kubernetes

Create a configmap for the config.yaml file:

kubectl -n mergentle-reminder create configmap mergentle-reminder-config --from-file=config.yaml

Create a secret for the GitLab API token and Slack webhook URL:

kubectl -n mergentle-reminder create secret generic mergentle-reminder-secrets --from-literal=gitlab-token=<your_gitlab_token> --from-literal=slack-webhook-url=<your_slack_webhook_url>

Edit schedule in k8s/cronjob.yaml to specify the desired schedule. Set to run every hour by default. See the CronJob documentation for more information.

Apply the Kubernetes manifests:

kubectl apply -f k8s/

The application will now run as a CronJob in your Kubernetes cluster, periodically sending reminders to the configured Slack channel.

mergentle-reminder's People

Contributors

flexoid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

niraj-fonseka

mergentle-reminder's Issues

Feature Request: provide groups/project via CLI parameter

Ideally I would like to create a single Docker image that I could run via GitLab scheduled tasks for multiple projects/groups.
In that case I would want to pass the list of Groups or Projects via a CLI parameter rather than via a config file.

Is that possible?

Example:

groups:
  - id: 1
  - id: 2

would be equivalent to:

GROUPS=1,2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.