-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
ci: add changelog reminder #15459
Merged
Merged
ci: add changelog reminder #15459
Changes from 7 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
8106732
ci: add changelog reminder
julienrbrt c6794ed
clean-up
julienrbrt 645dd30
updates
julienrbrt cfc49b8
Merge branch 'main' into julien/changelog-reminder
julienrbrt 2ea3e4b
updates
julienrbrt 76cdd93
precision
julienrbrt 66df3bb
clean-up
julienrbrt 5cfb3d4
Merge branch 'main' into julien/changelog-reminder
julienrbrt 4bef971
Merge branch 'main' into julien/changelog-reminder
julienrbrt f03afe7
feedback
julienrbrt a206cfa
Merge branch 'main' into julien/changelog-reminder
julienrbrt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Checks if a changelog is missing in the PR diff | ||
name: Changelog Reminder | ||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened, ready_for_review] | ||
paths: ["**/*.go"] | ||
permissions: | ||
pull-requests: write | ||
jobs: | ||
remind: | ||
name: Changelog Reminder | ||
runs-on: ubuntu-latest | ||
# Skip draft PRs and PRs starting with: revert, test, chore, ci, docs, style, build, refactor | ||
if: ${{ !github.event.pull_request.draft }} && !contains(github.event.pull_request.title, 'revert') && !contains(github.event.pull_request.title, 'test') && !contains(github.event.pull_request.title, 'chore') && !contains(github.event.pull_request.title, 'ci') && !contains(github.event.pull_request.title, 'docs') && !contains(github.event.pull_request.title, 'style') && !contains(github.event.pull_request.title, 'build') && !contains(github.event.pull_request.title, 'refactor') | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: mskelton/changelog-reminder-action@v3 | ||
with: | ||
message: "@${{ github.actor }} your pull request is missing a changelog!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
# configuration file for git-cliff (0.1.0) | ||
|
||
[changelog] | ||
# changelog header | ||
header = """ | ||
<!-- | ||
Guiding Principles: | ||
|
||
Changelogs are for humans, not machines. | ||
There should be an entry for every single version. | ||
The same types of changes should be grouped. | ||
Versions and sections should be linkable. | ||
The latest version comes first. | ||
The release date of each version is displayed. | ||
Mention whether you follow Semantic Versioning. | ||
|
||
Usage: | ||
|
||
Changelog entries are generated by git cliff ref: https://github.com/orhun/git-cliff | ||
|
||
Each commit should be conventional, the following message groups are supported. | ||
|
||
* feat: A new feature | ||
* fix: A bug fix | ||
* docs: Documentation only changes | ||
* style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc) | ||
* refactor: A code change that neither fixes a bug nor adds a feature | ||
* perf: A code change that improves performance | ||
* test: Adding missing tests or correcting existing tests | ||
* build: Changes that affect the build system or external dependencies (example scopes: go, npm) | ||
* ci: Changes to our CI configuration files and scripts (example scopes: GH Actions) | ||
* chore: Other changes that don't modify src or test files | ||
* revert: Reverts a previous commit | ||
|
||
When a change is made that affects the API or state machine, the commit message prefix should be suffixed with `!`. | ||
|
||
Ref: https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json | ||
--> | ||
|
||
# Changelog | ||
|
||
""" | ||
# template for the changelog body | ||
body = """ | ||
{% if version %}\ | ||
## [{{ version }}](https://github.com/cosmos/cosmos-sdk/releases/tag/{{version}}) - {{ 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 = true | ||
# 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/cosmos-sdk/issues/1234)". | ||
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/cosmos/cosmos-sdk/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/cosmos-sdk/pulls/${1}))" }, | ||
|
||
# the following patterns only exist because "split_commits" is set to true, and we are processesing | ||
# each line of the commit as a separate message. | ||
# these exist to filter out common messages that appear in commit messages that are technically | ||
# conventional, but we do not way to include in the changelog. | ||
{ pattern = '^Signed-off-by:.*', replace='' }, | ||
{ pattern = '^Co-authored-by:.*', replace='' }, | ||
# don't include references to issues as changelog entries. | ||
{ pattern = '^ref:.*', replace='' }, | ||
# exclude CVSS format, CVE can still be included in regular conventinal commits. | ||
{ pattern = 'CVSS:.*', replace='' }, | ||
# don't include dependabot auto merge entries. | ||
{ pattern = '.*dependabot-automerge-.*', replace='' }, | ||
# don't include statements saying which issue is closed. | ||
{ pattern = '^closes:.*|Closes:.*', replace='' }, | ||
# remove standalone links in the commit messages. | ||
{ pattern = '^https://.*', replace='' }, | ||
# remove lines with html. | ||
{ pattern = '^<.*', replace='' }, | ||
] | ||
|
||
# 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)feature|(?i)feat)", group = "<!-- 0 -->Features" }, | ||
{ message = "^((?i)improvements|(?i)imp|(?i)impr|(?i)perf)", group = "<!-- 1 -->Improvements" }, | ||
{ message = "^((?i)fix|(?i)bug)", group = "<!-- 2 -->Bug Fixes" }, | ||
{ message = '^.*\(api\)!', group = "<!-- 3 -->API Breaking" }, | ||
{ message = '^.*\(statemachine\)!', group = "<!-- 4 -->State Machine Breaking" }, | ||
{ message = "^((?i)test)", group = "<!-- 5 -->Testing" }, | ||
{ message = "^((?i)doc|(?i)docs|(?i)documentation)", group = "<!-- 6 -->Documentation" }, | ||
{ message = "^((?i)deprecated)", group = "<!-- 7 -->Deprecated" }, | ||
{ message = "^((?i)deps|(?i)dep|(?i)build)", group = "<!-- 8 -->Dependencies" }, | ||
{ message = "^revert|^ci|^chore|^refactor", skip = true} # explicitly skips changelog for reverts, CI, chore and refactor commits | ||
] | ||
# filter out the commits that are not matched by commit parsers | ||
filter_commits = true | ||
# glob pattern for matching git tags | ||
# note SDK tags are purposely ignored, only submodules are included. | ||
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 = "newest" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
this is inverting the format, if we go with this we should update the docs.
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.
As this is a generated changelog, it is not supposed to be manually edited, so I think it's fine.
There are a few improvements to be made as discussed with @chatton, I've only added the git cliff to help us when tagging, to quickly verify whether the changelog is ok or not.
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.
its confusing that we have one way here and another elsewhere. Any chance we can decide on one or the other and go with it?
trying to make it consistent
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.
This make sense, lmc how I can update the template!
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.
Updated