Skip to content

feat: Add task to generate AI release notes#2500

Merged
chmouel merged 1 commit intotektoncd:mainfrom
chmouel:ai-release-notes
Feb 24, 2026
Merged

feat: Add task to generate AI release notes#2500
chmouel merged 1 commit intotektoncd:mainfrom
chmouel:ai-release-notes

Conversation

@chmouel
Copy link
Copy Markdown
Member

@chmouel chmouel commented Feb 23, 2026

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:

  • Fetch commits between the current and previous release tags via GitHub's compare API
  • Map commits to their associated pull requests
  • Extract JIRA ticket identifiers (SRVKP-XXXX) from commit messages and PR bodies
  • Send PR metadata to Google's Gemini model for categorization and summarization
  • Output structured release notes (Major Features, Bug Fixes, Documentation, Chores)
  • Prepend static installation instructions and append GitHub's auto-generated changelog
  • Support --current-tag, --stdout, and --model flags 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

  • 🐛 Bug fix (fix:)
  • ✨ New feature (feat:)
  • 💥 Breaking change (feat!:, fix!:)
  • 📚 Documentation update (docs:)
  • ⚙️ Chore (chore:)
  • 💅 Refactor (refactor:)
  • 🔧 Enhancement (enhance:)
  • 📦 Dependency update (deps:)

🧪 Testing Strategy

  • Unit tests
  • Integration tests
  • End-to-end tests
  • Manual testing
  • Not Applicable

🤖 AI Assistance

  • I have not used any AI assistance for this PR.
  • I have used AI assistance for this PR.

Which LLM was used?

  • GitHub Copilot
  • ChatGPT (OpenAI)
  • Claude (Anthropic)
  • Cursor
  • Gemini (Google)
  • Other: ____________

Extent of AI Assistance:

  • Documentation and research only
  • Unit tests or E2E tests only
  • Code generation (parts of the code)
  • Full code generation (most of the PR)
  • PR description and comments
  • Commit message(s)

Important

If the majority of the code in this PR was generated by an AI, please add a Co-authored-by trailer to your commit message.
...

✅ Submitter Checklist

  • 📝 My commit messages are clear, informative, and follow the project's commit message guide.
  • ✨ I have ensured my commit message prefix matches the "Type of Change" selected above.
  • ♽ I have run make test and make lint locally.
  • 📖 I have added or updated documentation for any user-facing changes. (N/A — internal tooling)
  • 🧪 I have added sufficient unit tests for my code changes. (script is a release utility; unit tests not added)
  • 🎁 I have added end-to-end tests where feasible. (N/A — release pipeline tool)
  • 🔎 I have addressed any CI test flakiness or provided a clear reason to bypass it. (N/A)
  • If adding a provider feature, I have filled in the following: (N/A — not a provider feature)

Copilot AI review requested due to automatic review settings February 23, 2026 18:30
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @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

  • New Tekton Task for AI Release Notes: A new Tekton task named ai-release-notes has been introduced into the release pipeline. This task is designed to automate the generation of release notes.
  • AI-Powered Release Note Generation: The new task leverages a Python script (hack/generate-releasenotes.py) to interact with a Gemini AI model. This model processes commit and pull request data, including JIRA ticket identifiers, to categorize and summarize changes.
  • Automated Data Collection and Formatting: The Python script fetches commit data between release tags, maps commits to pull requests, extracts JIRA tickets, and formats the AI-generated content with static header, installation, and changelog sections, streamlining the release process.
Changelog
  • .tekton/release-pipeline.yaml
    • Added a new ai-release-notes task to the release pipeline, configured to run after the gorelease task.
    • Configured the ai-release-notes task to use the ubi9/python-312 image and execute the generate-releasenotes.py script.
    • Included environment variables for GitHub token, Gemini API key, repository owner, and repository name for the new task.
  • hack/generate-releasenotes.py
    • Added a new Python script responsible for generating AI-powered release notes.
    • Implemented functions to interact with the GitHub API for fetching commit comparisons, pull request details, and existing release notes.
    • Included logic to extract JIRA ticket identifiers from commit messages and pull request bodies.
    • Developed a prompt builder to prepare data for the Gemini AI model and a function to call the Gemini API for content generation.
    • Provided functionality to construct the final release notes by combining AI-generated content with static header, installation instructions, and a GitHub-generated changelog.
    • Added command-line arguments for overriding the current tag, printing to stdout, and specifying the Gemini model.
Activity
  • The pull request introduces a new feature to automate release note generation using AI.
  • A new Tekton task and a Python script have been added to implement this functionality.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@pipelines-as-code
Copy link
Copy Markdown

pipelines-as-code bot commented Feb 23, 2026

🔍 PR Lint Feedback

Note: This automated check helps ensure your PR follows our contribution guidelines.

⚠️ Items that need attention:

🎫 Jira reference

Add a Jira reference in the description using one of the following formats:

  • https://issues.redhat.com/browse/SRVKP-<number>

If no SRVKP ticket exists yet, link a GitHub issue instead (e.g., Fixes #123).
Minor housekeeping PRs without Jira coverage can skip this after confirming with reviewers.


🤖 AI attribution

The following commits lack an explicit AI attribution footer:

  • 11f2d19 feat: Add task to generate AI release notes

If no AI assistance was used for a commit, you can ignore this warning.
Otherwise add an Assisted-by: or Co-authored-by: footer referencing the AI used.


ℹ️ Next Steps

  • Review and address the items above
  • Push new commits to update this PR
  • This comment will be automatically updated when issues are resolved
🔧 Admin Tools (click to expand)

Automated Issue/Ticket Creation:

  • /issue-create - Generate a GitHub issue from this PR content using AI
  • /jira-create - Create a SRVKP Jira ticket from this PR content using AI

⚠️ Important: Always review and edit generated content before finalizing tickets/issues.
The AI-generated content should be used as a starting point and may need adjustments.

These commands are available to maintainers and will post the generated content as PR comments for review.

🤖 This feedback was generated automatically by the PR CI system

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.py script to generate AI-powered release notes using Gemini
  • Added new ai-release-notes task to .tekton/release-pipeline.yaml that 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.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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>
Copy link
Copy Markdown
Member

@theakshaypant theakshaypant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@chmouel
Copy link
Copy Markdown
Member Author

chmouel commented Feb 24, 2026

ah yeah that was a fix i pushed independently but that was part of the PR before merrging to main

@chmouel chmouel merged commit fc4ee2f into tektoncd:main Feb 24, 2026
2 checks passed
@chmouel chmouel deleted the ai-release-notes branch February 24, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci feature New feature or request llm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants