Skip to main content

antsichaut automates ansible changelog generation from GitHub Pull Requests

Project description

Antsichaut

Antsichaut automates the filling of a changelog.yaml used by antsibull-changelog.

You define a Github repository and a Github release. Then the script searches all pull requests since the release and adds them to the changelog.yaml.

The PR's get categorized into the changelog-sections based on these default labels:

group_config = [
  {"title": "major_changes", "labels": ["major", "breaking"]},
  {"title": "minor_changes", "labels": ["minor", "enhancement"]},
  {"title": "breaking_changes", "labels": ["major", "breaking"]},
  {"title": "deprecated_features", "labels": ["deprecated"]},
  {"title": "removed_features", "labels": ["removed"]},
  {"title": "security_fixes", "labels": ["security"]},
  {"title": "bugfixes", "labels": ["bug", "bugfix"]},
  {"title": "skip_changelog", "labels": ["skip_changelog"]},
]

This means for example that PR's with the label major get categorized into the major_changes section of the changelog.

PR's that have a skip_changelog do not get added to the changelog at all.

PR's that do not have one of the above labels get categorized into the trivial section.

Installation

pip install antsichaut

Manual Usage

You need a minimal changelog.yml created by antsibull-changelog:

antsibull-changelog release --version 1.17.0

Then define the version and the github repository you want to fetch the PRs from. Either via arguments or via environment variables:

> cd /path/to/your/ansible/collection
> antsichaut \
  --github_token 123456789012345678901234567890abcdefabcd \
  --since_version 1.17.0 \
  --to_version 1.18.0 \
  --major_changes_labels=foo
  --major_changes_labels=bar
  --minor_changes_labels=baz
  --repository=T-Systems-MMS/ansible-collection-icinga-director
> cd /path/to/your/ansible/collection
> export SINCE_VERSION=1.17.0  # (or `latest`)
> export TO_VERSION=1.18.0     # optional. if unset, defaults to current date
> export REPOSITORY=T-Systems-MMS/ansible-collection-icinga-director
> export MAJOR_CHANGES_LABELS=["foo","bar"]
> export MINOR_CHANGES_LABELS=["baz"]
> antsichaut

This will fill the changelog.yaml with Pull Requests. Then run antsibull-changelog generate to create the final changelog.

Usage with Github Actions

Inputs

since_version

Required the version to fetch PRs since

to_version

the version to fetch PRs to

Usage

---
- name: "Get Previous tag"
  id: previoustag
  uses: "WyriHaximus/github-action-get-previous-tag@master"
  env:
    GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

- name: "Run antsichaut"
  uses: ansible-community/antsichaut@main
  with:
    GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
    since_version: "${{ steps.previoustag.outputs.tag }}"

Examples

Check these examples out: telekom_mms.icinga_director prometheus.prometheus

Acknowledgements and Kudos

This script was initially forked from https://github.com/saadmk11/changelog-ci/ and modified by @rndmh3ro. Thank you, @saadmk11!

From May 2021 through May 2023, this project was maintained by @rndmh3ro and then graciously transferred to the ansible community organization. Thank you @rndmh3ro!

License

The code in this project is released under the MIT License.

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

antsichaut-0.4.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

antsichaut-0.4.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file antsichaut-0.4.0.tar.gz.

File metadata

  • Download URL: antsichaut-0.4.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/6.2.0-1018-azure

File hashes

Hashes for antsichaut-0.4.0.tar.gz
Algorithm Hash digest
SHA256 5bf981d29f99e47f98b1306004baa04e0f2d0bd10784ca9731ffc61f92cb679c
MD5 90d87933e771760919643ed8d170c7a3
BLAKE2b-256 e78b2bc72bd91dbffd5894e85badb0237fef7917dbbcf3495de3cc28a121531d

See more details on using hashes here.

File details

Details for the file antsichaut-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: antsichaut-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/6.2.0-1018-azure

File hashes

Hashes for antsichaut-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 86bf9c4f332a56b9bbacc8a158add4ac94ef21e05881bce3e8883f651551c0f1
MD5 2b758783c946e41a8742a11be2cd62da
BLAKE2b-256 e36b14594170a72c0d6008279bd0843674c8847d6da9c49c07071b9f75d4006a

See more details on using hashes here.

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