Skip to main content

GitLab Issue Bot for Isochronal Heads-Up Monitoring

Project description

GitLab Issue Bot for Isochronal Heads-up Monitoring

About

This bot can be used to periodically create issues in a GitLab project. It uses an arbitrary set of issue templates and a schedule configuraiton to create matching issues.

gibihm was developed at Tecids e.V. for the scenario of managing infrastructure in a GitLab project, and the need for creating issues / to-dos for periodic maintenance tasks

Usage

General

The bot's configuration lives entirely inside the project the bot will be used in. To start using the bot in a project, invite the bot user to the project. The bot user is a regular GitLab user.

Add templates and a schedule configuration to your repository, as described below. You can find an example project in the example/ directory.

Defining tasks

Tasks are defined as issue templates. For every kind of tasks that has to be scheduled, a template has to be created. Ideally, the template contains a good description on what has to be done, including a checklist of action items for the task's completion.

Scheduling tasks

The schedule is a YAML document living either at .gitlab/issue_schedule.yaml or .issue_schedule.yaml. It must contain an array of dictionaries, each containing the following keys:

Key Description Default
template Base filename (without .md) of the issue template to use
title Title for the issue to create
assignee User name of responsible user
due Date expression (parsable by dateparser when task is due in one week
labels Array of labels to assign to the created issue
confidential Set created issue as confidential false
schedule A crontab-like schedule defining when the task has to be scheduled @weekly
tag Short tag to identify issues related to this task Same as template

Configuration

The bot is configured through environment variables.

Variable Description Default
GIBIHM_API_URL URL of GitLab v4 API endpoint Value of CI_API_V4_URL
GIBIHM_API_TOKEN Access Token with api and read_user scopes

Installation

You can either use the bot from a Docker image directly in GitLab CI (see below), or install it whereever you want and run it

Installing and running using pip

Installation from PyPI using pip and running is straightforward:

pip3 install gibihm

export GIBIHM_API_URL=https://gitlab.example.com
export GIBIHM_API_TOKEN=Foo_Bar_Token

gibihm

Installing and running using Docker

The bot is also available using Docker:

docker pull natureshadow/gibihm
docerk run \
    -e GIBIHM_API_URL=https://gitlab.example.com-it \
	-e GIBIHM_API_TOKEN=Foo_Bar_Token \
	natureshadow/gibihm 

Running for a single project

Normally, the bot will operate on all projects its user is a member of.

You can pass it a numeric project ID using the --project-id command-line argument to run for only one project.

Running from project CI

If you do not want to use a site-wide installation, but rather add the bot to a single project, you can configure and run it directly in GitLab CI.

A minimal .gitlab-ci.yml looks like this:

schedule_issues:
  only:
    - schedules
  image: natureshadow/gibihm
  script: [ "true" ]

In your project settings. add the GIBIHM_API_TOKEN variable.

You can then use GitLab's Pipeline schedules to periodically run the bot and schedule your issues.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gibihm-0.1.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

gibihm-0.1.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file gibihm-0.1.0.tar.gz.

File metadata

  • Download URL: gibihm-0.1.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.9.4 Linux/4.19.0-16-amd64

File hashes

Hashes for gibihm-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1804968edf947e48de0eab9efbd1c10fe8cfbfaa009b79dc062b4f94a70b7fc8
MD5 768c704bd60c675157134d1124128704
BLAKE2b-256 d5d0d245526f483d50f828e4000cbb96be8e2c20a4f1bd52046332b9a5ee6fcf

See more details on using hashes here.

Provenance

File details

Details for the file gibihm-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: gibihm-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.9.4 Linux/4.19.0-16-amd64

File hashes

Hashes for gibihm-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2f376f8ab3e5870ac7a9885ff99dc4a48795acbdae16c4050bcc9e5774a38521
MD5 c6bb00b9e8ea74ff5d4492a648f87f78
BLAKE2b-256 a6c819fb6dc9dfd4a62af26cef7957bbe67895a40e2ff9eaa23839c18fd65c12

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page