Skip to main content

GitLab Changelog Generator

CI/CD ci codecov
Docs docs
Package PyPI - Version PyPI - Python Version
Meta PyPI - License linting - Ruff code style - Black

What is it about?

Generate simple markdown changelogs for GitLab repositories. GitLab provides an API endpoint to generate Changelogs. However, this endpoint assumes that repository is using Git trailers in the commit message. If no Git trailers are found in the commit messages, the API endpoint returns nothing.

This is a huge problem for a lot of projects (including us) that do not use Git trailers. Although it is a good practice to use Git trailers we tend to forget them and it increases development time. Moreover we are more concerned to have MRs listed in the changelogs and we can tag MRs with labels that identify the type of MR. We can generate a changelog using these labels and group MRs according to the labels.

This is what this little package does to generate changelogs. In a nutshell, it does two things:

  1. Given a GitLab (upstream or self hosted) repository, an initial git reference or date, use the GitLab GraphQL API to return a DataFrame of all issue and MR activity for this time period.
  2. A CLI to render this activity as markdown, suitable for generating changelogs.

Prior art

  • gitlab-changelog-generator is a command line utility distributed as Python package to generate changelogs. However, it is mostly outdated and I could not make it work as of 2023.
  • gitlab-changelog-generator is another tool to generate changelogs based on Ruby. However there has been no development since last few years.

Features

  • Users can configure the labels and their descriptions that they use in their projects
  • gitlab-activity configuration supports pyproject.toml for Python projects, package.json for Node projects. For other projects, configuration can be included in a file .gitlab-activity.toml in the root of the repository.
  • It can be integrated into CI release jobs to update the changelogs from last stable tag to current before making the release.

:::important

This tool is heavily inspired from github-activity developed by the folks at Jupyter project. All the credit should go to them and we thank them.

:::

Installation

The easiest way to install this package is via pip:

pip install gitlab-activity

Usage

The easiest way to use gitlab-activity to generate activity markdown is to use the command-line interface. It takes the following form:

gitlab-activity -t [<group>/<repo>]

This will output a markdown with MRs activity since last tag.

:::tip

The Changelog file of the current repository is being generated by gitlab-activity. Have a look into CI file on how it is being done.

:::

Configuration

All the CLI options can be configured via configuration file. An example config file can be used as a reference.

As stated above the configuration can be integrated into pyproject.toml in [tool.gitlab-activity] section or package.json in gitlab-activity key.

To run the tests

The easiest way to run the test suite is using pytest.

pytest

Metadata

Release files for gitlab-activity 0.3.1

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

Source distribution (sdist)

Source distribution for gitlab-activity 0.3.1
File Size Uploaded
gitlab_activity-0.3.1.tar.gz 112.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gitlab-activity 0.3.1
File Interpreter ABI Platform
gitlab_activity-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 143.3 kB

Release files / gitlab_activity-0.3.1.tar.gz

Download URL gitlab_activity-0.3.1.tar.gz
Size 112.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4076a16831acf400b947ef5d0c7c3c16b6803db3be148c08ed86f357d32595f4
BLAKE2b-256 checksum
How to use checksums
f3110bcb37a9ca571596c81aa639b34c223f0136ee639b400d75e5e6b09fbb75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.11

Release files / gitlab_activity-0.3.1-py3-none-any.whl

Download URL gitlab_activity-0.3.1-py3-none-any.whl
Size 30.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
068e0a60d8c33c4776d5ac6ca8ba31ea591c04bbb176856955ec59f594e75d4a
BLAKE2b-256 checksum
How to use checksums
473f5f9100a2ca8fcda5e3467331e22532e5ec2eecc8c4d2f686ee36c140eb9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.11

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.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