Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ __pycache__/

.coverage
bin

.env
coverage.xml
htmlcov/
15 changes: 14 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,20 @@ release: install-dev
@V_NO_V=$(VERSION); \
sed -i.bak "s/^__version__ = \".*\"/__version__ = \"$$V_NO_V\"/" kubeflow/__init__.py && \
rm -f kubeflow/__init__.py.bak
@uv run python scripts/gen-changelog.py --token=$${GITHUB_TOKEN} --version=$(VERSION)

@# Determine previous tag based on release type.
@# RC release: use most recent tag (any type)
@# Stable release: use most recent stable tag (excluding RCs)
@PREV_TAG=$$(echo $(VERSION) | grep -qE 'rc[0-9]+$$' && git tag -l --sort=-creatordate | head -1 || \
git tag -l --sort=-creatordate | grep -vE 'rc[0-9]+$$' | head -1); \
CHANGELOG_FILE=CHANGELOG/CHANGELOG-$$(echo $(VERSION) | cut -d. -f1-2).md; \
if [ -z "$$PREV_TAG" ]; then \
GITHUB_TOKEN=$${GITHUB_TOKEN} git-cliff --tag $(VERSION) -o $$CHANGELOG_FILE; \
elif [ -f "$$CHANGELOG_FILE" ]; then \
GITHUB_TOKEN=$${GITHUB_TOKEN} git-cliff $$PREV_TAG..HEAD --tag $(VERSION) --prepend $$CHANGELOG_FILE; \
else \
GITHUB_TOKEN=$${GITHUB_TOKEN} git-cliff $$PREV_TAG..HEAD --tag $(VERSION) -o $$CHANGELOG_FILE; \
fi

# make test-python will produce html coverage by default. Run with `make test-python report=xml` to produce xml report.
.PHONY: test-python
Expand Down
20 changes: 18 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,30 @@ The Kubeflow SDK uses an automated release process with GitHub Actions:

#### 1. Update Version and Changelog

1. Generate version and changelog locally (this will sync dependencies automatically):
1. Ensure prerequisites:

- Install `git-cliff`.

```sh
pip install git-cliff
```

- Export a `GITHUB_TOKEN` with repo read access (used for PR links/contributors).

2. Make sure you’re on the correct base branch and up to date:

- If working against upstream: `git fetch upstream main --tags`.
- Avoid running from a feature branch to prevent including unmerged commits.

3. Generate version and changelog locally (this will sync dependencies automatically):

```sh
export GITHUB_TOKEN=<your_github_token>
make release VERSION=X.Y.Z
```

This updates:

- `kubeflow/__init__.py` with `__version__ = "X.Y.Z"`
- `CHANGELOG/CHANGELOG-X.Y.md` with a new top entry `# [X.Y.Z] (YYYY-MM-DD)`

Expand Down Expand Up @@ -97,9 +113,9 @@ The `Release` GitHub Action automatically:
2. Verify the release on [GitHub Releases](https://github.com/kubeflow/sdk/releases)
3. Test installation: `pip install kubeflow==X.Y.Z`


## Announcement

**Announce**: Post the announcement for the new Kubeflow SDK release in:

- [#kubeflow-ml-experience](https://www.kubeflow.org/docs/about/community/#slack-channels) Slack channel
- [kubeflow-discuss](https://www.kubeflow.org/docs/about/community/#kubeflow-mailing-list) mailing list
59 changes: 59 additions & 0 deletions cliff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# git-cliff ~ configuration file
# https://git-cliff.org/docs/configuration

[remote.github]
owner = "kubeflow"
repo = "sdk"

[changelog]
# Template for the changelog body
body = """
{% if version %}\
# [{{ version | trim_start_matches(pat="v") }}](https://github.com/kubeflow/sdk/releases/tag/{{ version | trim_start_matches(pat="v") }}) ({{ timestamp | date(format="%Y-%m-%d") }})
{% else %}\
# [unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
## {{ group | striptags | trim | upper_first }}

{% for commit in commits -%}
- {{ commit.message | split(pat="(#") | first | trim }}{% if commit.breaking %} [**breaking**]{% endif %}{% for link in commit.links %} ([{{ link.text }}]({{ link.href }})){% endfor %}{% if commit.remote.username %} by @{{ commit.remote.username }}{% endif %}
{% endfor -%}
{% endfor %}

{%- if github -%}
{% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
## New Contributors ❤️
{% endif -%}
{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
* @{{ contributor.username }} made their first contribution
{%- if contributor.pr_number %} in \
[#{{ contributor.pr_number }}](https://github.com/kubeflow/sdk/pull/{{ contributor.pr_number }}) \
{%- endif %}
{%- endfor -%}
{%- endif %}
"""
trim = true

[git]
conventional_commits = false
filter_unconventional = false
require_conventional = false
split_commits = false
commit_preprocessors = []
protect_breaking_commits = false
commit_parsers = [
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we also skip commits for Kubeflow SDK releases, like this 46b42d0?

Copy link
Author

Choose a reason for hiding this comment

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

would we want this to be an exact match like '^Kubeflow SDK Official Release' or something more flexible like ".*Release [0-9]". If it is the former, we should probably add the convention to RELEASE.md as well, let me know what you think.

{ message = "^feat", group = "New Features" },
{ message = "^fix", group = "Bug Fixes" },
{ message = "^chore", group = "Maintenance" },
{ message = "^revert", group = "Reverts" },
{ message = "^Kubeflow SDK Official Release", skip = true },
{ message = ".*", group = "Other Changes" },
]
filter_commits = false
link_parsers = [
{ pattern = '\(#(\d+)\)', href = "https://github.com/kubeflow/sdk/pull/$1", text = "#$1" },
]
use_branch_tags = false
topo_order = false
sort_commits = "newest"
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ dev = [
"ruff>=0.12.2",
"pre-commit>=4.2.0",
"PyGithub>=2.7.0",
"git-cliff>=2.0.0",
]

[project.urls]
Expand Down
Loading
Loading