-
Notifications
You must be signed in to change notification settings - Fork 112
chore(changelog) : Replace Python script with git-cliff for Changelog generation #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
388b0c3
159c500
f7ca988
45d5d55
f58e03a
30158c1
0561182
713853f
6f4b178
30d0e7c
5735eb7
8edf8e0
0a778a7
35b9037
798a3e3
872e6ac
4ad764b
8cde610
b7af971
77ebef5
81fd3d6
b56e272
e6b61d7
e237e75
446092d
fcb90b4
2996f64
4cbc2fe
7875f01
94c415a
732a188
d07899f
e979d76
7529e77
701b38b
8ecc995
b3687e8
aecc06a
3aea40c
a39e24c
493ff7f
d94eb70
df2f130
60bdc7f
0077e21
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,6 @@ __pycache__/ | |
|
|
||
| .coverage | ||
| bin | ||
|
|
||
| .env | ||
| coverage.xml | ||
| htmlcov/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,7 +71,15 @@ 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) | ||
| @PREV_TAG=$$(git tag -l --sort=-creatordate | 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 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # git-cliff ~ configuration file | ||
| # https://git-cliff.org/docs/configuration | ||
|
|
||
| [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.github.username %} by @{{ commit.github.username }}{% endif %} | ||
| {% endfor -%} | ||
| {% endfor %} | ||
| """ | ||
| trim = true | ||
| render_always = true | ||
|
||
|
|
||
| [git] | ||
rohansaibuddhi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| conventional_commits = false | ||
| filter_unconventional = false | ||
| require_conventional = false | ||
| split_commits = false | ||
| commit_preprocessors = [] | ||
| protect_breaking_commits = false | ||
| commit_parsers = [ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we also skip commits for Kubeflow SDK releases, like this 46b42d0?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 = "^doc", group = "Documentation" }, | ||
| { message = "^perf", group = "Performance" }, | ||
| { message = "^refactor", group = "Refactor" }, | ||
| { message = "^style", group = "Styling" }, | ||
| { message = "^test", group = "Testing" }, | ||
rohansaibuddhi marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| { message = "^chore\\(release\\)", skip = true }, | ||
| { message = "^chore\\(deps\\)", skip = true }, | ||
| { message = "^chore", group = "Maintenance" }, | ||
| { message = "^ci", group = "Maintenance" }, | ||
| { body = ".*security", group = "Security" }, | ||
| { message = "^revert", group = "Reverts" }, | ||
| { 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 = "oldest" | ||
|
|
||
| [remote.github] | ||
| owner = "kubeflow" | ||
| repo = "sdk" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the last tag was 0.2.1rc1, the new release 0.2.1 will only show changes since the RC, not since 0.2.0, right? Could you update it so that for stable releases we compute the previous tag from the last stable tag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. This will lead to duplication of commits between the last stable tag and 0.2.1rc1, considering we do generate changelog for RCs, would that behavior be okay?
In case there is no last stable commit, it would take all commits since the first commit. Is that expected behavior? I know we do not have to deal with this edge case since we already have 0.1.0, but wanted to confirm.