Package: gibihm
AboutThis 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 atTecids e.V.for
the scenario of managing infrastructure in a GitLab project, and the
need for creating issues / to-dos for periodic maintenance tasksThe nameMan bräuchte ein Tool, in das man Templates mit Checklisten und so
’ne Art crontab schmeißt, und dann gib ihm!In English, freely translated:One could use a tool to throw templates with checklists and some kind
of crontab at, and off it goes!UsageGeneralThe 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 theexample/directory.Defining tasksTasks are defined asissue
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 tasksThe schedule is a YAML document living either at.gitlab/issue_schedule.yamlor.issue_schedule.yaml. It must
contain an array of dictionaries, each containing the following keys:KeyDescriptionDefaulttemplateBase filename (without.md) of the
issue template to usetitleTitle for the issue to createassigneeUser name of responsible userdueDate expression (parsable bydateparserwhen task is duein one weeklabelsArray of labels to assign to the created
issueconfidentialSet created issue as confidentialfalsescheduleAcrontab-like
schedule defining when the task has to be
scheduled@weeklytagShort tag to identify issues related to
this taskSame astemplateConfigurationThe bot is configured through environment variables.VariableDescriptionDefaultGIBIHM_API_URLURL of GitLab v4 API
endpointValue ofCI_API_V4_URLGIBIHM_API_TOKENAccess Token withapiandread_userscopesInstallationYou can either use the bot from a Docker image directly in GitLab CI
(see below), or install it whereever you want and run itInstalling and running using pipInstallation from PyPI using pip and running is straightforward:pip3installgibihmexportGIBIHM_API_URL=https://gitlab.example.comexportGIBIHM_API_TOKEN=Foo_Bar_TokengibihmInstalling and running using DockerThe bot is also available using Docker:dockerpullnatureshadow/gibihmdocerkrun\-eGIBIHM_API_URL=https://gitlab.example.com-it\-eGIBIHM_API_TOKEN=Foo_Bar_Token\natureshadow/gibihmRunning for a single projectNormally, the bot will operate on all projects its user is a member of.You can pass it a numeric project ID using the--project-idcommand-line argument to run for only one project.Running from project CIIf 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.ymllooks like this:schedule_issues:only:-schedulesimage:natureshadow/gibihmscript:["true"]In your project settings. add theGIBIHM_API_TOKENvariable.You can then useGitLab’s Pipeline
schedulesto
periodically run the bot and schedule your issues.