feat: Add task to generate AI release notes#2500
Conversation
Summary of ChangesHello @chmouel, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the release process by integrating AI-driven automation for generating release notes. By introducing a new Tekton task and an accompanying Python script, the system can now automatically compile detailed and categorized release information from GitHub commits and pull requests, including JIRA ticket references, and format it for official releases. This change aims to improve the efficiency and consistency of release documentation. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
🔍 PR Lint Feedback
|
There was a problem hiding this comment.
Pull request overview
This PR adds an AI-powered release notes generation feature to the Tekton release pipeline. The implementation introduces a new Python script (hack/generate-releasenotes.py) that automates the creation of release notes by fetching commit and PR data from GitHub, extracting JIRA ticket references, and using Google's Gemini AI model to categorize and summarize changes. The generated notes are then formatted and inserted into GitHub releases, replacing a TODO placeholder created by goreleaser.
Changes:
- Added
hack/generate-releasenotes.pyscript to generate AI-powered release notes using Gemini - Added new
ai-release-notestask to.tekton/release-pipeline.yamlthat runs after the gorelease task - Script fetches commits between tags, maps them to PRs, extracts JIRA tickets, and sends data to Gemini for categorization
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| hack/generate-releasenotes.py | New Python script that orchestrates release note generation: fetches commit/PR data from GitHub, extracts JIRA tickets, calls Gemini API for categorization, and updates GitHub release body |
| .tekton/release-pipeline.yaml | Adds new ai-release-notes task to release pipeline with environment configuration for GitHub and Gemini API credentials |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
eb700e5 to
ad325ba
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces an automated AI-powered release notes generator using the Gemini API, integrated into the Tekton pipeline. While the script effectively handles commit-to-PR mapping and JIRA ticket extraction, a security audit has identified several vulnerabilities in hack/generate-releasenotes.py. These include a high-severity path traversal and medium-severity issues related to insecure data handling, command injection, and improper handling of LLM output, which could expose credentials, allow unauthorized API access, or lead to content injection. Furthermore, critical issues concerning Gemini model naming and best practices for network requests (timeouts and error handling) require attention to ensure the script's reliability.
ad325ba to
c8c12dc
Compare
Added a new Tekton task, `ai-release-notes`, to the release pipeline. This task is responsible for generating release notes using an AI model. The task utilizes a new Python script, `hack/generate-releasenotes.py`, to: - Fetch commit data between the current and previous release tags. - Map commits to their corresponding pull requests. - Extract JIRA ticket identifiers from commit messages and PR bodies. - Send this information to a Gemini model for categorization and summarization. - Format the AI-generated notes along with static header, installation, and changelog sections. This enhances the release process by automating the creation of detailed and informative release notes. Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
c8c12dc to
11f2d19
Compare
theakshaypant
left a comment
There was a problem hiding this comment.
LGTM.
Also fixes a minor type error in pkg/provider/github/status.go: provider.StatusOpts → providerstatus.StatusOpts in the formatPipelineComment function.
I do not see this change from PR description in changed files
|
ah yeah that was a fix i pushed independently but that was part of the PR before merrging to main |
Added a new Tekton task,
ai-release-notes, to the release pipeline. This task generates release notes automatically using a Gemini AI model after each release.The task uses a new Python script,
hack/generate-releasenotes.py, to:--current-tag,--stdout, and--modelflags for flexibility📝 Description of the Change
Automates release note generation by adding a post-release Tekton task and a Python script (
hack/generate-releasenotes.py). The script queries the GitHub API, extracts relevant PR and JIRA data, and calls the Gemini API to produce categorized, human-readable release notes, which are then written back to the GitHub release page.👨🏻 Linked Jira
🔗 Linked GitHub Issue
Fixes #
🚀 Type of Change
fix:)feat:)feat!:,fix!:)docs:)chore:)refactor:)enhance:)deps:)🧪 Testing Strategy
🤖 AI Assistance
Which LLM was used?
Extent of AI Assistance:
Important
If the majority of the code in this PR was generated by an AI, please add a
Co-authored-bytrailer to your commit message....
✅ Submitter Checklist
make testandmake lintlocally.