Skip to content

feat(ci): automate release process#3536

Open
Krishna-kg732 wants to merge 8 commits into
kubeflow:masterfrom
Krishna-kg732:feat/automate-release
Open

feat(ci): automate release process#3536
Krishna-kg732 wants to merge 8 commits into
kubeflow:masterfrom
Krishna-kg732:feat/automate-release

Conversation

@Krishna-kg732
Copy link
Copy Markdown
Contributor

Summary

This PR continues the work started in #3148 by @milinddethe15.

Changes

  • Automated release process with changelog generation using git-cliff
  • Split monolithic CHANGELOG.md into per-release-line files:
    • CHANGELOG/CHANGELOG-1.x.md
    • CHANGELOG/CHANGELOG-2.0.md
    • CHANGELOG/CHANGELOG-2.1.md
    • CHANGELOG/CHANGELOG-2.2.md
  • Updated release workflows with manual trigger and image build steps
  • Refactored GitHub release job to integrate changelog generation
  • Fixed release branch naming to use major.minor version format

Testing

  • Tested PyPI publishing workflow on fork
  • Verified changelog generation and split across release lines

Copilot AI review requested due to automatic review settings May 20, 2026 17:33
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 introduces a more automated release process for Kubeflow Trainer, centered around git-cliff changelog generation, new CI workflows for release validation/release publishing, and a move from a single monolithic changelog to per-minor-series changelog files.

Changes:

  • Add make release + hack/release.sh to prepare release commits and generate per-minor changelog updates via git-cliff.
  • Add/refresh GitHub Actions workflows for release validation (check-release.yaml) and release automation (release.yaml), plus manual dispatch support for image/chart publishing.
  • Split CHANGELOG.md into per-release-line markdown files under CHANGELOG/.

Reviewed changes

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

Show a summary per file
File Description
README.md Updates changelog link to point at the new CHANGELOG/ structure.
Makefile Adds a release target that invokes hack/release.sh.
hack/release.sh New script to bump versions/tags in repo files and generate changelog content via git-cliff.
docs/release/README.md Updates release documentation to include the new make release workflow and changelog location.
docs/release/changelog.py Removes the old PyGithub-based changelog generator script.
cliff.toml Adds git-cliff configuration used by release tooling/workflows.
CHANGELOG/README.md Adds an index for per-minor changelog files.
CHANGELOG/CHANGELOG-*.md Adds split changelog files for 1.x, 2.0, 2.1, 2.2 lines.
api/python_api/pyproject.toml Ensures wheel build packages the kubeflow_trainer_api package.
.github/workflows/template-publish-image/action.yaml Adds a manual-dispatch tag metadata tag rule for image publishing.
.github/workflows/release.yaml New release automation workflow (build/publish Python, tag, GitHub release, trigger images/charts).
.github/workflows/check-release.yaml New PR-time validation for release PRs (VERSION/tag/manifests/chart/python version checks).
.github/workflows/publish-helm-charts.yaml Adds workflow_dispatch support + concurrency settings.
.github/workflows/build-and-push-images.yaml Adds workflow_dispatch and allows publishing on manual dispatch.
.github/workflows/check-pr-title.yaml Adds area/release label to PR-title check ignore list.
Comments suppressed due to low confidence (2)

hack/release.sh:139

  • This script prints guidance to open a PR against main, but the repo workflows and docs use master as the default branch; update the message to avoid sending releasers to the wrong base branch.
echo "  2. Open a PR:"
echo "     - For latest minor series: open a PR to 'main' and get it reviewed and merged"
echo "     - For older minor series patch (e.g. ${MAJOR_VERSION}.${MINOR_VERSION}.Z when main"
echo "       is at a newer minor): checkout the release-${MAJOR_VERSION}.${MINOR_VERSION} branch,"
echo "       commit changes, and open a PR to release-${MAJOR_VERSION}.${MINOR_VERSION}"

docs/release/README.md:20

  • The release guide still instructs installing PyGithub and later running python docs/release/changelog.py, but this PR deletes docs/release/changelog.py and switches to git-cliff; update the prerequisites/instructions to remove the PyGithub dependency and reference the new make release/git-cliff flow consistently.
- Create a [GitHub Token](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token).

- Install `PyGithub` to generate the [Changelog](./../../CHANGELOG/README.md):

pip install PyGithub>=1.55

Comment thread CHANGELOG/README.md Outdated
Comment thread hack/release.sh Outdated
Comment thread hack/release.sh Outdated
Comment thread docs/release/README.md Outdated
Comment thread .github/workflows/release.yaml Outdated
Comment thread .github/workflows/release.yaml Outdated
Comment thread .github/workflows/check-release.yaml Outdated
Comment thread hack/release.sh Outdated
Comment thread docs/release/README.md Outdated
Copy link
Copy Markdown
Member

@andreyvelich andreyvelich left a comment

Choose a reason for hiding this comment

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

Thanks @Krishna-kg732 for picking up this work — automating the release flow is a meaningful improvement. This review was conducted with AI tooling assistance; inline comments highlight specific items to address.

Comment thread .github/workflows/check-release.yaml Outdated
Comment thread hack/release.sh Outdated
Comment thread hack/release.sh Outdated
Comment thread hack/release.sh Outdated
Comment thread hack/release.sh Outdated
Comment thread .github/workflows/release.yaml Outdated
Comment thread .github/workflows/release.yaml
Comment thread .github/workflows/release.yaml Outdated
Comment thread docs/release/README.md Outdated
Comment thread CHANGELOG/README.md Outdated
@google-oss-prow
Copy link
Copy Markdown

[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 ask for approval from andreyvelich. 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

@andreyvelich
Copy link
Copy Markdown
Member

@Krishna-kg732 Did you get a chance to fix the remaining comments ?

@Krishna-kg732
Copy link
Copy Markdown
Contributor Author

Hey @andreyvelich , yup , I will test with new the changes and then I think we will be ready to merge

Comment thread .github/workflows/template-publish-image/action.yaml Outdated
Comment thread .github/workflows/release.yaml Outdated
Comment thread docs/release/README.md Outdated
Comment thread docs/release/README.md Outdated
Comment thread docs/release/README.md Outdated
Comment thread docs/release/README.md Outdated
Comment thread hack/release.sh Outdated
Comment thread cmd/initializers/model/requirements-lock.txt Outdated
Comment thread CHANGELOG/README.md Outdated
Comment thread docs/release/README.md Outdated
milinddethe15 and others added 7 commits June 2, 2026 22:30
…n checks

Signed-off-by: milinddethe15 <milinddethe15@gmail.com>

feat(release): Implement automated release process with changelog generation

Signed-off-by: milinddethe15 <milinddethe15@gmail.com>

fix lint

Signed-off-by: milinddethe15 <milinddethe15@gmail.com>

enhance tag validation and branch creation

Signed-off-by: milinddethe15 <milinddethe15@gmail.com>

fix: Add 'area/release' to ignored labels in PR title check

Signed-off-by: milinddethe15 <milinddethe15@gmail.com>

feat(release): Enhance release workflows with manual trigger and image build steps

Signed-off-by: milinddethe15 <milinddethe15@gmail.com>

feat(release): Add PyPI API token for publishing packages

Signed-off-by: milinddethe15 <milinddethe15@gmail.com>

feat(release): Update concurrency settings in publish-helm-charts workflow and upgrade git-cliff-action version

Signed-off-by: milinddethe15 <milinddethe15@gmail.com>

feat(release): Update git-cliff-action args to include --unreleased option

Signed-off-by: milinddethe15 <milinddethe15@gmail.com>

refactor: reorganize release workflow to generate changelog before GitHub release

Signed-off-by: milinddethe15 <milinddethe15@gmail.com>

feat(release): Update GitHub release action to remove changelog prepending and simplify release name

Signed-off-by: milinddethe15 <milinddethe15@gmail.com>

feat(release): Refactor GitHub release job to integrate changelog generation and simplify workflow

Signed-off-by: milinddethe15 <milinddethe15@gmail.com>

feat(release): create_branch_and_tag job to create_branch and streamline tagging process

Signed-off-by: milinddethe15 <milinddethe15@gmail.com>

rebase commit

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

fix: update release branch naming to use major.minor version format

Signed-off-by: milinddethe15 <milinddethe15@gmail.com>

fix endline

Signed-off-by: milinddethe15 <milinddethe15@gmail.com>

feat(release): update README with upstream tag fetching instructions

Signed-off-by: milinddethe15 <milinddethe15@gmail.com>

Release v2.2.2

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

Revert "Release v2.2.2"

chore: configure TestPyPI publishing for fork testing

feat: split changelog by release line

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

chore:removed the monoloith CHANGELOG.md

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

chore: capitalize Changelog file name

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

chore: revert fork testing config

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

chore:latest minor release support updated

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

chore:resolve changelog casing conflict and restore correct file

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

chore: resolve git casing conflict

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

feat: split changelog by release line

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

chore: capitalize Changelog file name

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

chore:latest minor release support updated

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

chore: remove duplicate lowercase changelog file

Signed-off-by: krishna-kg732 <krishnagupta.kg2k6@gmail.com>
Signed-off-by: krishna-kg732 <krishnagupta.kg2k6@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Krishna Gupta <Krishnagupta.kg2k6@gmail.com>
Signed-off-by: Krishna Gupta <Krishnagupta.kg2k6@gmail.com>
Signed-off-by: Krishna Gupta <Krishnagupta.kg2k6@gmail.com>
Signed-off-by: Krishna Gupta <Krishnagupta.kg2k6@gmail.com>
Signed-off-by: Krishna Gupta <Krishnagupta.kg2k6@gmail.com>
@Krishna-kg732 Krishna-kg732 force-pushed the feat/automate-release branch 2 times, most recently from e59f436 to 0df9a5a Compare June 2, 2026 17:10
…sset updates to release workflow

Signed-off-by: Krishna Gupta <Krishnagupta.kg2k6@gmail.com>
@Krishna-kg732 Krishna-kg732 force-pushed the feat/automate-release branch from 0df9a5a to 6b71b68 Compare June 2, 2026 17:12
Comment on lines +248 to +257
- name: Generate changelog
id: changelog
uses: orhun/git-cliff-action@v4
with:
config: cliff.toml
args: >
--unreleased
--tag ${{ needs.prepare.outputs.tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Generation of changelog should be part of make release command since it might require some manual adjustment, similar to how we do in SDK, only extract changelog for publish:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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


env:
SHOULD_PUBLISH: ${{ github.event_name == 'push' }}
SHOULD_PUBLISH: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do you need this?

Comment on lines +270 to +326
- name: Publish release artifacts
uses: actions/github-script@v7
with:
script: |
const tag = '${{ needs.prepare.outputs.tag }}';
const workflows = [
'build-and-push-images.yaml',
'publish-helm-charts.yaml',
];
const timeoutMs = 90 * 60 * 1000;
const intervalMs = 60 * 1000;
const deadline = Date.now() + timeoutMs;

const dispatchedRuns = await Promise.all(workflows.map(async (workflow_id) => {
const response = await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id,
ref: tag,
return_run_details: true,
});
const runId = response.data.workflow_run_id;
if (!runId) {
throw new Error(`GitHub did not return a run ID for ${workflow_id}`);
}
core.info(`Dispatched ${workflow_id}: ${response.data.html_url}`);
return { workflow_id, runId };
}));

for (const { workflow_id, runId } of dispatchedRuns) {
core.info(`Waiting for ${workflow_id} to complete for ${tag}`);
let run;

while (Date.now() < deadline) {
const response = await github.rest.actions.getWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: runId,
});
run = response.data;

if (run?.status === 'completed') {
if (run.conclusion === 'success') {
core.info(`${workflow_id} completed successfully: ${run.html_url}`);
break;
}
core.setFailed(`${workflow_id} concluded with ${run.conclusion}: ${run.html_url}`);
return;
}

await new Promise((resolve) => setTimeout(resolve, intervalMs));
}

if (run?.status !== 'completed') {
core.setFailed(`Timed out waiting for ${workflow_id} to complete for ${tag}`);
return;
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do you need all of these?
We don't do this in SDK: https://github.com/kubeflow/sdk/blob/main/.github/workflows/release.yml#L177

Comment thread cliff.toml
Comment on lines +31 to +62
{%- for group_name in group_order %}
{%- set group_commits = commits | filter(attribute="group", value=group_name) -%}
{%- if group_commits | length > 0 %}
### {{ group_name }}

{% for commit in group_commits | reverse -%}
{%- set message = commit.message | split(pat="\n") | first | trim -%}
{%- set parts = message | split(pat=" (#") -%}
{%- set author = commit.remote.username | default(value=commit.author.name) -%}
{% if parts | length > 1 and parts | last | trim | split(pat=")") | length > 1 -%}
{%- set pr_part = parts | last | trim -%}
{%- set pr_number = pr_part | replace(from=")", to="") -%}
- {{ parts | slice(end=-1) | join(sep=" (#") }} ([#{{ pr_number }}](https://github.com/kubeflow/trainer/pull/{{ pr_number }}) by @{{ author }})
{% else -%}
- {{ message }} (@{{ author }})
{% endif -%}
{% endfor %}

{%- endif %}
{%- endfor %}

{%- if github -%}
{%- set new_contributors = github.contributors | filter(attribute="is_first_time", value=true) -%}
{%- if new_contributors | length != 0 %}

### New Contributors
{%- for contributor in new_contributors %}
* @{{ contributor.username }} made their first contribution in \
[#{{ contributor.pr_number }}](https://github.com/kubeflow/trainer/pull/{{ contributor.pr_number }})
{%- endfor %}
{%- endif %}
{%- endif -%}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you follow the format like in Kubeflow SDK ?

https://github.com/kubeflow/sdk/blob/main/cliff.toml#L24C1-L48

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.

4 participants