Skip to main content

python3-cyberfusion-work-item-automations

Automations for GitLab work items (issues, PRs, etc.)

The following automations are supported:

  • Create recurring issues (using cron schedule)
  • Create milestones
  • Summarise issues (useful for sprints, stand-ups, etc.)

GitLab doesn't support workflows natively. For example, there's no built-in way to create recurring issues, or take actions on issues when something happens to a PR, etc. For the purpose of developing GitLab itself, GitLab does provide the external tool gitlab-triage. However, it is quite limiting: for example, it doesn't allow for creating standalone, recurring issues.

Although there are plans to implement workflows for automation in GitLab itself, the timeline is unclear. Hence this project.

Install

PyPI

Run the following command to install the package from PyPI:

pip3 install python3-cyberfusion-work-item-automations

Debian

Run the following commands to build a Debian package:

mk-build-deps -i -t 'apt -o Debug::pkgProblemResolver=yes --no-install-recommends -y'
dpkg-buildpackage -us -uc

Configure

No configuration is supported.

Usage

Create config file

In its most basic form, the config file must contain the URL to your GitLab instance, and a private token (PAT).

Create the PAT according to the documentation with the api scope. To the private token's user - usually a dedicated bot account - grant access to projects and/or groups it must be able to access, depending on your configuration. The necessary role, e.g. 'Guest' or 'Developer', depends on the actions taken. Usually, granting the 'Developer' role suffices.

automations: {}
private_token: glpat-...
url: https://gitlab.example.com
state_directory_path: /tmp/glwia

On Debian, add the config file to /etc/glwia.yml (used by the automatically configured cron, running automations). In any other environment, use a path of your choosing.

Add automations

Add one or more automations to the automations key.

⚠️ Every automation must have a unique name.

Create issues

automations:
  create_issue:
    - name: Do something repetitive
      schedule: 5 13 3 * *
      # Project to create issue in. Format: # namespace/project
      project: example-group/example-project
      # Issue title
      #
      # Variables:
      #   - next_week_number (example: 5)
      #   - current_month_number (example: 1)
      #   - current_year (example: 2025)
      title: Check the yard for month {current_month_number}-{current_year}
      # Assign the issue to a member of this group
      #
      # Optional:
      #   If specified, issue is assigned to a **random** user in the specified group.
      #   If unspecified, the issue is not assigned to anyone.
      assignee_group: best-developers
      # Issue contents
      #
      # Variables:
      #   - year (example: 2025)
      #   - month (example: April)
      description: Check stuff, do stuff, ...
      # or use a template (see https://docs.gitlab.com/user/project/description_templates/#create-an-issue-template)
      template: check_stuff.md

Want to add properties to the issue, such as labels or an assignee? Use quick actions. For example:

automations:
  create_issue:
    - name: Do something repetitive
      ...
      description: |
        /assign @ceo
        /label ~"status::to do"

Create milestones

automations:
  create_milestone:
    - name: Create monthly milestone
      schedule: 0 0 1 * *
      # Project to create milestone in. Format: namespace/project
      project: example-group/example-project
      # Milestone title
      #
      # Variables:
      #   - year (example: 2025)
      #   - month (example: April)
      title: "{month} {year}"
      # Optional
      description: Monthly milestone

Summarise issues

automations:
  summarise_issues:
    - name: Summarise this week's issues (start-of-week stand-up)
      schedule: 0 11 * * 1  # Monday, 11:00
      # Project to create issue in. Format: # namespace/project
      project: example-group/example-project
      # Optional:
      #   If specified, summarised are open issues in the given iteration.
      #   If unspecified, summarised are all open issues in projects that the bot can access.
      #
      # Variables:
      #   - today_minus_7_days (example: 2025-01-02)
      #   - today_plus_7_days (example: 2025-01-08)
      #   - today (example: 2025-01-14)
      # Note: these variables don't add or subtract the given amount of days
      # (e.g. 7 days) to/from today, but equal a total of 7 days (including
      # today). This matches GitLab iterations, which span exactly 7 days
      # (e.g. days 20 from start - 26 to finish).
      #
      iteration_date_range: '{today_minus_7_days}/{today}'
      # Additional issue contents (added to top)
      description: Check stuff, do stuff, ...

NOP

An automation that does nothing, for testing purposes.

automations:
  nop:
    - name: Do nothing
      schedule: 5 13 3 * *

Run automations

Debian

On Debian, automations are automatically run every minute (according to each automation's respective schedule).

Other environments

Run automations manually:

glwia --config-file-path /tmp/glwia.yml  # Short for 'GitLab Work Item Automations'

Set --config-file-path to a path of your choosing.

Release files for python3-cyberfusion-work-item-automations 1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python3-cyberfusion-work-item-automations 1.7
File Size Uploaded
python3_cyberfusion_work_item_automations-1.7.tar.gz 10.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python3-cyberfusion-work-item-automations 1.7
File Interpreter ABI Platform
python3_cyberfusion_work_item_automations-1.7-py3-none-any.whl Python 3 none any Details

Total release size: 21.5 kB

Release files / python3_cyberfusion_work_item_automations-1.7.tar.gz

Download URL python3_cyberfusion_work_item_automations-1.7.tar.gz
Size 10.2 kB
Tags Source
SHA-256 checksum
How to use checksums
07d781dae24f94cd7fa5e5ea77b8d38f826541d258bccf5781b044aaa973c875
BLAKE2b-256 checksum
How to use checksums
12cb17f3e11707c2f6610fcd973e7a2cff89110315337da0e544348cd7331e8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Release files / python3_cyberfusion_work_item_automations-1.7-py3-none-any.whl

Download URL python3_cyberfusion_work_item_automations-1.7-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b9b860a026a4bb5475f3d41774e1bb23f9a7fbe6a04226ce495108abeff9289
BLAKE2b-256 checksum
How to use checksums
9d3986370ac1e21997c32951a58110986407decf6f74b919916982e5e835aba1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Release history Release notifications | RSS feed

This release

1.7 This release

2 release files

1.6

2 release files

1.5

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4

2 release files

1.3

2 release files

1.2

2 release files

1.1.1

2 release files

1.1

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page