Skip to content

feat(ci): add git cliff config and release ci action#3231

Open
jaiakash wants to merge 6 commits intokubeflow:masterfrom
jaiakash:trainer-release
Open

feat(ci): add git cliff config and release ci action#3231
jaiakash wants to merge 6 commits intokubeflow:masterfrom
jaiakash:trainer-release

Conversation

@jaiakash
Copy link
Member

What this PR does / why we need it:
This PR adds

  • git-cliff config
  • release.yml ci using git-cliff action
  • make release command for generating changelog locally.

Which issue(s) this PR fixes
Fixes #2155

Checklist:

  • Docs included if any changes are user facing

Signed-off-by: Akash Jaiswal <akashjaiswal3846@gmail.com>
Signed-off-by: Akash Jaiswal <akashjaiswal3846@gmail.com>
Copilot AI review requested due to automatic review settings February 20, 2026 16:37
@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign terrytangyuan for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

commit_parsers = [
{ message = "^feat(\\(.*\\))?:", group = "🚀 Features" },
{ message = "^fix(\\(.*\\))?:", group = "🐛 Bug Fixes" },
{ message = "^chore\\(deps.*\\)", skip = true },
Copy link
Member Author

@jaiakash jaiakash Feb 20, 2026

Choose a reason for hiding this comment

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

All those PRs with deps would be ignored, as we have lot of PRs with dependbot.

@jaiakash
Copy link
Member Author

jaiakash commented Feb 20, 2026

Example Release: https://github.com/jaiakash/trainer/releases/tag/v2.2.0

PTAL @andreyvelich @astefanutti

Also @milinddethe15 @Krishna-kg732 since you both worked on similar feature.

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

Adds initial release automation for Kubeflow Trainer by introducing a git-cliff changelog configuration, a manual GitHub Actions release workflow, and a local make release helper to generate changelog entries.

Changes:

  • Add cliff.toml to generate grouped changelog entries via git-cliff.
  • Add a release GitHub Actions workflow to create/update a release branch, generate changelog, tag, and publish a GitHub Release.
  • Add make release VERSION=X.Y.Z to generate changelog updates locally.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
cliff.toml Defines git-cliff changelog format, grouping, and tag filtering for stable releases.
Makefile Adds a release target to generate/update CHANGELOG.md using git-cliff.
.github/workflows/release.yaml Adds a manual release workflow to manage release branches, update changelog, tag, and publish a GitHub Release.

Signed-off-by: Akash Jaiswal <akashjaiswal3846@gmail.com>
* fix: add missing cliff step id and fix release body output

Signed-off-by: krishna-kg732 <krishnagupta.kg2k6@gmail.com>

* Disable upstream fetch in release workflow

Signed-off-by: Krishna Gupta <Krishnagupta.kg2k6@gmail.com>

---------

Signed-off-by: krishna-kg732 <krishnagupta.kg2k6@gmail.com>
Signed-off-by: Krishna Gupta <Krishnagupta.kg2k6@gmail.com>
Copy link
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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 9 comments.


# Only stable release tags
tag_pattern = "^v?[0-9]+\\.[0-9]+\\.[0-9]+$"
ignore_tags = ".*-(alpha|beta|rc).*"
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

The ignore_tags pattern excludes RC (release candidate) tags from changelog generation, but the project uses RC releases (e.g., v2.1.0-rc.1 in CHANGELOG.md). This configuration means RC releases won't be included in automatically generated changelogs, which may not align with the project's release process documented in docs/release/README.md. Consider whether RC releases should be included in changelogs or if this exclusion is intentional.

Copilot uses AI. Check for mistakes.
Comment on lines +30 to +50
- name: Prepare release branch
id: prep
run: |
VERSION="${{ github.event.inputs.version }}"
MAJOR_MINOR=$(echo "$VERSION" | cut -d. -f1,2)
PATCH=$(echo "$VERSION" | cut -d. -f3)
BRANCH_NAME="release-${MAJOR_MINOR}"

echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
echo "PATCH=$PATCH" >> $GITHUB_ENV

if [ "$PATCH" = "0" ]; then
echo "Minor release detected"
git checkout -B $BRANCH_NAME
git push -u origin $BRANCH_NAME --force-with-lease

else
echo "Patch release detected"
git checkout $BRANCH_NAME
git pull origin $BRANCH_NAME
fi
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

The workflow lacks input validation for the version format. If a user provides an invalid version (e.g., "v2.2.0" with 'v' prefix, "2.2", or "2.2.0.1"), the workflow will proceed with undefined behavior. The cut command will produce unexpected MAJOR_MINOR and PATCH values, potentially creating incorrectly named branches or failing silently. Add validation at the start of this step to ensure the version matches the expected X.Y.Z format.

Copilot uses AI. Check for mistakes.
Comment on lines +23 to +28
# Activate this when trying for fork repo
#- name: Add upstream and fetch everything
#run: |
#git remote add upstream https://github.com/kubeflow/trainer.git
#git fetch upstream --tags
#git fetch origin --tags
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

The commented-out code for fork repositories introduces maintenance burden and can confuse developers about when to use it. If this code is intended for testing from forks, consider either documenting this clearly in comments or moving this logic to a separate documented workflow variant. If it's temporary, add a TODO with context about when it should be removed.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

Agree with this, we should not keep it. But for testing in fork this is needed. Let me know if we should keep in final PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

@jaiakash yes , can we keep this in the final PR for testing

echo "PATCH=$PATCH" >> $GITHUB_ENV

if [ "$PATCH" = "0" ]; then
echo "Minor release detected"
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

For minor releases (PATCH=0), the workflow creates a new release branch from the current HEAD without verifying that it's running from the master branch. If a user accidentally triggers this workflow from a different branch (e.g., an old release branch or feature branch), it will create a release branch from the wrong starting point. Add a check to ensure the workflow is running from master when creating a minor release.

Suggested change
echo "Minor release detected"
echo "Minor release detected"
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [ "$CURRENT_BRANCH" != "master" ]; then
echo "Error: Minor releases (PATCH=0) must be created from the master branch. Current branch: $CURRENT_BRANCH"
exit 1
fi

Copilot uses AI. Check for mistakes.
Copy link
Member Author

@jaiakash jaiakash Feb 23, 2026

Choose a reason for hiding this comment

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

Umm not needed right? as only maintainers would be run this workflow.

@jaiakash
Copy link
Member Author

I will address the copilot review tmr.

@google-oss-prow
Copy link

@jaiakash: No presubmit jobs available for kubeflow/trainer@master

Details

In response to this:

/retest to check for the new hotfix changes for CI failure.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jaiakash
Copy link
Member Author

/retest
to check for the new hotfix changes for CI failure.

Signed-off-by: Akash Jaiswal <akashjaiswal3846@gmail.com>
Signed-off-by: Akash Jaiswal <akashjaiswal3846@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Kubeflow Trainer release process

3 participants