Skip to main content

Grab recent issue/PR activity from a GitLab repository and render it as markdown.

Project description

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

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

gitlab_activity-0.1.4.tar.gz (110.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gitlab_activity-0.1.4-py3-none-any.whl (30.1 kB view details)

Uploaded Python 3

File details

Details for the file gitlab_activity-0.1.4.tar.gz.

File metadata

  • Download URL: gitlab_activity-0.1.4.tar.gz
  • Upload date:
  • Size: 110.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for gitlab_activity-0.1.4.tar.gz
Algorithm Hash digest
SHA256 de40c0c3cf66c0508d9666387e08fe9987abb64af0153e22110f6fdab578ea2a
MD5 430e58d67a2bcd9e1077b2cf89c68ec0
BLAKE2b-256 c0794bd0f3f7411144c9788b57d4f05da80d5072487ac99d2a073724d412e677

See more details on using hashes here.

File details

Details for the file gitlab_activity-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for gitlab_activity-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 782fd9897484a86a4b6d6ab7e472647b3ac502d83f7413b14f96736757350121
MD5 f3f28059a878255ba553ab8881f2bbd6
BLAKE2b-256 649d2e6cdcbd0d5d26712d58cb9a8267e292654dd321de93ad75947dfe237621

See more details on using hashes here.

Supported by

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