feat(ci): add git cliff config and release ci action#3231
feat(ci): add git cliff config and release ci action#3231jaiakash wants to merge 6 commits intokubeflow:masterfrom
Conversation
Signed-off-by: Akash Jaiswal <akashjaiswal3846@gmail.com>
Signed-off-by: Akash Jaiswal <akashjaiswal3846@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
| commit_parsers = [ | ||
| { message = "^feat(\\(.*\\))?:", group = "🚀 Features" }, | ||
| { message = "^fix(\\(.*\\))?:", group = "🐛 Bug Fixes" }, | ||
| { message = "^chore\\(deps.*\\)", skip = true }, |
There was a problem hiding this comment.
All those PRs with deps would be ignored, as we have lot of PRs with dependbot.
|
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. |
There was a problem hiding this comment.
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.tomlto generate grouped changelog entries viagit-cliff. - Add a
releaseGitHub Actions workflow to create/update a release branch, generate changelog, tag, and publish a GitHub Release. - Add
make release VERSION=X.Y.Zto 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>
|
|
||
| # Only stable release tags | ||
| tag_pattern = "^v?[0-9]+\\.[0-9]+\\.[0-9]+$" | ||
| ignore_tags = ".*-(alpha|beta|rc).*" |
There was a problem hiding this comment.
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.
| - 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 |
There was a problem hiding this comment.
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.
| # 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
@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" |
There was a problem hiding this comment.
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.
| 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 |
There was a problem hiding this comment.
Umm not needed right? as only maintainers would be run this workflow.
|
I will address the copilot review tmr. |
|
@jaiakash: No presubmit jobs available for kubeflow/trainer@master DetailsIn response to this:
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. |
|
/retest |
Signed-off-by: Akash Jaiswal <akashjaiswal3846@gmail.com>
9f1ca73 to
f2dce62
Compare
Signed-off-by: Akash Jaiswal <akashjaiswal3846@gmail.com>
What this PR does / why we need it:
This PR adds
git-cliffconfigrelease.ymlci usinggit-cliffactionmake releasecommand for generating changelog locally.Which issue(s) this PR fixes
Fixes #2155
Checklist: