Changelog Weaver is a powerful tool designed to automatically generate comprehensive release notes for projects hosted on Azure DevOps and GitHub. It leverages the capabilities of GPT (Generative Pre-trained Transformer) to summarize work items and produce professional, easy-to-read release notes in Markdown format.
- Multi-Platform Support: Seamlessly works with both Azure DevOps and GitHub repositories.
- Automated Work Item Retrieval: Automatically fetches work items, issues, and pull requests based on user-defined queries.
- Intelligent Summarization: Utilizes GPT to summarize work items into concise and meaningful release notes.
- Multi-Format Output: Generates release notes in Markdown and optionally converts them to HTML.
- Customizable Configuration: Offers customizable prompts and environment settings to fine-tune the summarization process.
- Automation Support: Easily integrated into CI/CD pipelines for automated release note generation.
You can see a generated changelog example here
- Python: Version 3.8 or higher.
- Azure DevOps Personal Access Token (PAT) or GitHub Access Token: Required for fetching work items/issues.
- OpenAI API Key: Required for utilizing GPT for summarization.
-
Clone the Repository
git clone https://github.com/Hankanman/Changelog-Weaver.git cd Changelog-Weaver
-
Create and Activate a Virtual Environment
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install Dependencies
pip install -r requirements.txt
-
Set Up Environment Variables
Create a
.env
file in the root directory with the following content:SOLUTION_NAME= RELEASE_VERSION= SOFTWARE_SUMMARY= GET_ITEM_SUMMARY=True GET_CHANGELOG_SUMMARY=True PROJECT_URL= QUERY= ACCESS_TOKEN= GPT_API_KEY= MODEL_BASE_URL=https://api.openai.com/v1 MODEL=gpt-4o-mini OUTPUT_FOLDER=Releases LOG_LEVEL=INFO
For GitHub projects, set the
PROJECT_URL
to your GitHub repository URL (e.g.,https://github.com/username/repo
).
To generate release notes, run:
python -m changelog_weaver
This will fetch work items based on the configuration and generate a Markdown file containing the release notes.
- Set
PROJECT_URL
to your Azure DevOps project URL (e.g.,https://dev.azure.com/organization/project
). QUERY
should be the ID of your Azure DevOps query.ACCESS_TOKEN
should be your Azure DevOps Personal Access Token.
- Set
PROJECT_URL
to your GitHub repository URL (e.g.,https://github.com/username/repo
). QUERY
can be a GitHub search query (e.g.,is:issue is:closed
).ACCESS_TOKEN
should be your GitHub Personal Access Token.
You can integrate Changelog Weaver into your CI/CD pipeline using the provided Azure DevOps YAML configuration or a GitHub Actions workflow:
- Azure DevOps: Copy the
Changelog-Weaver-Pipeline-Azure.yaml
from thepipelines/
directory to your project's pipeline configuration. - GitHub Actions: Copy the
Changelog-Weaver-Action.yml
from thepipelines/
directory. Adjust the provided GitHub Actions YAML to suit your repository setup.
This project includes a GitHub Actions workflow that automatically generates a changelog when a new release is created. Here's how it works:
- When you create a new release in your GitHub repository, the workflow is triggered.
- It sets up a Python environment and installs the necessary dependencies.
- It creates a
.env
file with the required configuration, using repository secrets and release information. - It runs the Changelog Weaver to generate the release notes.
- The generated changelog is uploaded as an artifact and attached to the release.
To use this workflow:
- Ensure you have set up the
GPT_API_KEY
secret in your repository settings. This should contain your OpenAI API key. - Create a new release in your GitHub repository.
- The workflow will automatically run and attach the generated changelog to the release.
You can customize the workflow by editing the .github/workflows/generate-changelog.yml
file in your repository.
Changelog Weaver is highly customizable. You can modify the GPT prompts in changelog_weaver/configuration/prompts.py
to change how the release notes are generated. Additionally, the output format and details can be adjusted in changelog_weaver/configuration/output.py
.
Unit tests are provided and can be run using pytest
:
pytest
Contributions are welcome! Please fork the repository, make your changes, and submit a pull request.
This project is licensed under the MIT License. See the LICENSE
file for details.