-
Notifications
You must be signed in to change notification settings - Fork 672
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
Add git cliff toml to support generation of changelog #2697
Changes from 12 commits
670d534
d8cafd4
4b53323
16ee689
6706aed
3b6c79d
87c12dd
a875571
1813f59
4569ff0
aabaed7
8490b30
2353229
140d251
d90488e
13403c9
0c028ac
3ba101c
0a30c21
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 |
---|---|---|
|
@@ -85,6 +85,25 @@ All PRs require an approval from at least one CODEOWNER before merge. PRs which | |
- If you sat down with the PR submitter and did a pairing review please note that in the `Approval`, or your PR comments. | ||
- If you are only making "surface level" reviews, submit any notes as `Comments` without adding a review. | ||
|
||
### Commit Messages | ||
|
||
Commit messages should be [conventional](https://www.conventionalcommits.org/en/v1.0.0/). | ||
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. Do all the commits in the PR need to follow this convention or the one that matters is the commit message that is entered when squashing the PR? Because in that case, we can have more relaxed rules for the commits while you're working on the PR, and then be careful when squashing the PR, which is something that we have control of. 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. yes you're right it's only the final squashed commit that matters. |
||
|
||
The commit message type should be one of: | ||
|
||
* `feat` / `feature` for feature work. | ||
* `bug` / `fix` for bug fixes. | ||
* `imp` / `improvements` for improvements. | ||
* `doc` / `docs` / `documentation` for any documentation changes. | ||
* `test` / `e2e` for any tests added. | ||
chatton marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* `deprecated` for deprecation changes. | ||
* `deps` / `build` for changes to dependencies. | ||
* `chore` / `misc` / `nit` for any miscellaneous changes that don't fit into another category. | ||
|
||
**Note**: If any change breaking, the following format must be used: | ||
colin-axner marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* `type` + `(api)!` for api breaking changes, e.g. `fix(api)!: api breaking fix` | ||
colin-axner marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* `type` + `(statemachine)!` for state machine breaking changes, e.g. `fix(statemachine)!: state machine breaking fix` | ||
colin-axner marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### Updating Documentation | ||
|
||
If you open a PR on ibc-go, it is mandatory to update the relevant documentation in /docs. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# configuration file for git-cliff (0.1.0) | ||
|
||
[changelog] | ||
# changelog header | ||
header = """ | ||
<!-- | ||
Usage: | ||
|
||
Change log entries are generated by git cliff ref: https://github.com/orhun/git-cliff | ||
This can be run using "make changelog tag=vx.y.z" | ||
|
||
Each commit should be conventional, the following message groups are supported. | ||
|
||
* feat, feature | ||
* imp | ||
* bug, fix | ||
* deprecated | ||
* (api)! | ||
* (statemachine)! | ||
|
||
Types of changes (Stanzas): | ||
|
||
"Features" for new features. (feat, feature) | ||
"Improvements" for changes in existing functionality. (imp) | ||
"Deprecated" for soon-to-be removed features. | ||
"Bug Fixes" for any bug fixes. (bug, fix) | ||
"API Breaking" for breaking exported APIs used by developers building on SDK. Add (api)! e.g. fix(api)!: api breaking fix | ||
"State Machine Breaking" for any changes that result in a different AppState given same genesisState and txList. Add (statemachine)! e.g. fix(statemachine)!: state machine breaking fix | ||
colin-axner marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Ref: https://keepachangelog.com/en/1.0.0/ | ||
--> | ||
|
||
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
""" | ||
# template for the changelog body | ||
# https://tera.netlify.app/docs/#introduction | ||
body = """ | ||
{% if version %}\ | ||
## [{{ 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 | upper_first }}\ | ||
{% endfor %} | ||
{% endfor %}\n | ||
""" | ||
# remove the leading and trailing whitespace from the template | ||
trim = true | ||
# changelog footer | ||
footer = """ | ||
<!-- generated by git-cliff --> | ||
""" | ||
|
||
[git] | ||
# parse the commits based on https://www.conventionalcommits.org | ||
conventional_commits = true | ||
# filter out the commits that are not conventional | ||
filter_unconventional = true | ||
# process each line of a commit as an individual commit | ||
split_commits = false | ||
# regex for preprocessing the commit messages | ||
commit_preprocessors = [ | ||
# A reference to an issue is appened to commits that looks like "(#1234)", this will be replaced | ||
# with a link to that issue, e.g. "[#$1234](https://github.com/cosmos/ibc-go/issues/1234)". | ||
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/cosmos/ibc-go/issues/${2}))" }, | ||
# any reference to a pr like "pr-1234" will be replaced with a link to the PR. | ||
{ pattern = '\(pr-([0-9]+)\)', replace = "([#${1}](https://github.com/cosmos/ibc-go/pulls/${1}))" }, | ||
] | ||
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. this effectively means I can write a commit message like
And the issue and pr will be expanded into links in the changelog entry. e.g. Bug FixesThere 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. Awesome! 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. Will the commit merged automatically be linked? 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. @colin-axner yep the commit being merged will be linked. This is the issue number in parens at the end of the commit in the generated output. |
||
# regex for parsing and grouping commits | ||
commit_parsers = [ | ||
# specifying the number in a comment is a workaround to enable ordering of groups. | ||
# these comments are stripped out of the markdown with the filter "{{ group | striptags | trim | upper_first }}" | ||
# above in the body template. | ||
{ message = "^((?i)deps|(?i)dep|(?i)build)", group = "<!-- 0 -->Dependencies" }, | ||
{ message = '^.*\(api\)!', group = "<!-- 1 -->API Breaking" }, | ||
{ message = '^.*\(statemachine\)!', group = "<!-- 2 -->State Machine Breaking" }, | ||
{ message = "^((?i)improvements|(?i)imp)", group = "<!-- 3 -->Improvements" }, | ||
{ message = "^((?i)feature|(?i)feat)", group = "<!-- 4 -->Features" }, | ||
{ message = "^((?i)fix|(?i)bug)", group = "<!-- 5 -->Bug Fixes" }, | ||
{ message = "^((?i)doc|(?i)docs|(?i)documentation)", group = "<!-- 6 -->Documentation" }, | ||
{ message = "^((?i)test|(?i)e2e)", group = "<!-- 7 -->Testing" }, | ||
{ message = "^((?i)deprecated)", group = "<!-- 8 -->Deprecated" }, | ||
{ message = "^((?i)chore|(?i)misc|(?i)nit)", group = "<!-- 9 -->Miscellaneous Tasks" }, | ||
] | ||
# filter out the commits that are not matched by commit parsers | ||
filter_commits = false | ||
# glob pattern for matching git tags | ||
tag_pattern = "v[0-9]*" | ||
# regex for skipping tags | ||
skip_tags = "" | ||
# regex for ignoring tags | ||
ignore_tags = "" | ||
# sort the tags chronologically | ||
date_order = false | ||
# sort the commits inside sections by oldest/newest order | ||
sort_commits = "oldest" |
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.
Note to myself: add this to the PRs refactoring contributing.md.