Skip to content
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

Merged
merged 19 commits into from
Nov 15, 2022
Merged

Conversation

chatton
Copy link
Contributor

@chatton chatton commented Nov 7, 2022

Description

closes: #2106

Going forward, we can adhere to the conventional commit structure and ensure that every commit that gets merged to main is a descriptive changelog entry.

Currently this only generates a changelog of unreleased changes. If we want to maintain a static changelog file we can decide how we want to do that and implement in a follow up PR.

Update about release branches:

  1. In order to generate the changelog for e.g. 5.1.0, we need to checkout release/v5.1.x and then run
make changelog tag=v5.1.0

(once this PR is backported)

With this example in particular, the output will also include changelog entries for 5.0.0 and 5.0.0-rc2. I suspect this has something to do with out v5.1.x branched from v5.0.x and are considered unreleased in some way. These are grouped into a separate category and can be safely ignored.

  1. All commits we wish to include must be conventional. Ie. chore: something i did, fix: fixed a bug. If this format is not met, they will not be included in the changelog.

  2. We should ensure that all PRs include the proposed commit message (changelog entry) for approval in the PR. As there would not necessarily be a file that is reviewable in the Github UI.

E.g.

chore: integrating git cliff into the code base to automate generation of changelogs

We can start using this with the next set of releases as the current commit history will not generate a clean changelog.

The following was generated by running

make changelog tag=v6.0.0

Changelog

All notable changes to this project will be documented in this file.

[6.0.0] - 2022-11-07

Dependencies

  • Bump cosmossdk.io/math from 1.0.0-beta.2 to 1.0.0-beta.3 (#1842)
  • Bump docker/build-push-action from 3.1.0 to 3.1.1 (#1910)
  • Bump google.golang.org/grpc from 1.48.0 to 1.49.0 (#2107)
  • Bump github.com/spf13/viper from 1.12.0 to 1.13.0 (#2199)
  • Bump github.com/armon/go-metrics from 0.4.0 to 0.4.1 (#2227)
  • Bump github.com/cosmos/cosmos-sdk from 0.46.1 to 0.46.2 (#2458)
  • Bump google.golang.org/grpc from 1.49.0 to 1.50.0 (#2499)
  • Bump docker/build-push-action from 3.1.1 to 3.2.0 (#2530)
  • Bump docker/login-action from 2.0.0 to 2.1.0 (#2531)
  • Bump docker/metadata-action from 4.0.1 to 4.1.0 (#2532)
  • Bump JamesIves/github-pages-deploy-action (#2543)
  • Bump github.com/spf13/cobra from 1.5.0 to 1.6.0 (#2533)
  • Bump technote-space/get-diff-action from 6.1.0 to 6.1.1 (#2556)
  • Bump google.golang.org/grpc from 1.50.0 to 1.50.1 (#2557)
  • Bump docker/metadata-action from 4.1.0 to 4.1.1 (#2558)
  • Bump golangci/golangci-lint-action from 3.2.0 to 3.3.0 (#2564)
  • Bump github.com/stretchr/testify from 1.8.0 to 1.8.1 (#2571)
  • Bump github.com/spf13/cobra from 1.6.0 to 1.6.1 (#2584)

Features

  • Adding support for backwards compatibility testing (#1912)
  • Add channel query client to e2e test suite (#1985)
  • Adding test to verify invalid recipient address over incentivized channel (#1970)
  • Add successful e2e transfer test (#1973)
  • Add gov proposal execution for e2e testsuite (#2114)
  • Add genesis modification function to e2e (#2112)
  • Add decoder store to ics27 simulations (#2158)
  • Add genesis simulation generation for ics27 (#2154)
  • Implementing SubmitTx gRPC endpoint (#2147)
  • Add params for ics27 simulation (#2160)
  • Adding interchain account address query to controller submodule (#2193)
  • Add semantic version utilities for e2e tests (#2502)
  • Adding git cliff toml

Bug Fixes

  • Proto-update-deps target on macOS (#1838)
  • Ics27 check packet data length explicitly over nil check (#1882)
  • Make format and golangci-lint errors (#1894)
  • Prevent blocked addresses from sending ICS 20 transfers (#1907)
  • Adding check for blocked addresses before escrowing fees (#1890)
  • "acknowledgement written" logs unsupported type (#1919)
  • Update simd gen accounts cmd to perform same functionality as SDK (#2065)
  • Partial revert of add mock module acc balance and refactor test case #1942 (#2148)
  • Missing tx flags for update and misbehaviour commands in client (#2171)
  • Add nil checks for controller and host keeper services (#2308)
  • Ica handshake reopening channel - use GetAppVersion in favour of channel.Version (#2302)
  • Forbid negative values for trusting period, unbonding period and max clock drift (#2555)
  • Rm bech32 check from owner address on ICA controller msgs RegisterInterchainAccount and SendTx (#2601)
  • Skip emission of unpopulated memo field in ics20 (#2651)
  • Fix block proposer and allow Default gas to be modified (#2657)

Documentation

  • Add godoc to VerifyMembership regarding path (#1742)
  • Readme revamp - support (#2002)
  • Readme revamp - registry (#2000)
  • Update default value for allow_messages after change DefaultParams on the host to allow all messages ("*") #2290 (#2367)
  • Include ics4Wrapper in hostkeeper.NewKeeper ics27 integration docs (#2351)
  • Migration docs v4 to v5 (#1826)
  • Updating v3->v4 migration docs with fee middleware (#2127)
  • Add ics29 integration for sdk module (#2394)
  • Fix deploy docs workflow (#2404)
  • Renaming migration doc for 02-client refactor ibc-go/v7 (#2418)
  • Update roadmap (#2460)
  • Adding migration doc for ibc-go v6 (#2417)
  • Add request for maintainership md file (#2453)
  • Updating docs for memo field in ics20 transfer (#2602)
  • Ics27 v6 documentation updates (#2561)

Testing

  • Fee middleware counterparty payee not set (#1746)
  • Add timeout height helper function (#1982)
  • Add 02-client query client (#2005)
  • Failed token transfer receiver address is not valid (#1996)
  • E2e test for timeout of ics20 packet (#1992)
  • Add ICA MsgSubmitTx tests (success + failure) (#2021)
  • Adding incentivized interchain accounts bank send test (#2023)
  • Adding interchain accounts test which sends a failed bank transfer (#2049)
  • Fee middleware with multiple incentivisers (#2073)
  • Transfer receive enabled param test (#2071)
  • Add base upgrade handler (#2144)
  • Add client recovery proposal test (#2130)
  • ICS27 interchain accounts x/group integration (#2195)
  • Adding simd controller msg server tests (#2572)
  • Transfer memo tests (#2306)
  • 03-connection e2e test param change (#2139)
  • Adding e2e upgrade test for ibc-go/v6 (#2490)
  • Add transfer with memo compatibility tests (#2640)

Miscellaneous Tasks

  • Add backport task for v5.0.x (#1840)
  • Delete gitpod.yml (#1841)
  • Add task for backport to v6.0.x (#1869)
  • Add latest releases and entry for bump of SDK 0.46 (#1872)
  • Don't use ioutil (#1920)
  • Remove references to AllowUpdateAfterExpiry, AllowUpdateAfterMisbehaviour (#1843)
  • Remove AllowUpdateAfterProposal (#1940)
  • Adding import for clienttypes (#1990)
  • Adding build requirement for e2e (#1993)
  • Update fee middleware docs to be more explicit about reasoning for removing invariant checks (#1705)
  • Update releases.md and docs website (#1998)
  • Moving fee queries to E2ETestSuite (#2030)
  • Explicitly set channel version for non-incentivized ica tests (#2036)
  • Adding stop relayer func to e2e suite (#2046)
  • Set up IBCTestStakingKeeper interface (#2028)
  • Adding basic Msg service and RegisterAccount rpc boilerplate (#2068)
  • Skip running e2e tests on markdown changes (#2050)
  • Adding sdk.Msg impl for ics27 MsgRegisterAccount (#2081)
  • Bump ibctest version (#2076)
  • Refactor genesis types to separate directory, mv controller interfaces registration to module.go (#2133)
  • Adding basic Msg service and SubmitTx rpc boilerplate (#2086)
  • Adding sdk.Msg impl for ics27 MsgSubmitTx (#2135)
  • Adapt ics27 controller claiming of channel capability (#2146)
  • Ics27 channel capability migrations (#2134)
  • Ics27 middleware callback routing (#2157)
  • Fixing import aliases (#2185)
  • Update docs package-lock.json (#2194)
  • Fix broken link to bank module spec (#2201)
  • Adding assertion of channel capabilities migration (#2140)
  • Adding IsMiddlewareEnabled to ActiveChannel genesis type (#2177)
  • Adding x/group to simapp (#2190)
  • Adding msgServer struct to ics27 controller (#2251)
  • Adding call to underlying app to OnChanCloseConfirm (#2248)
  • Rename RegisterAccount rpc and msgs to RegisterInterchainAccount (#2253)
  • Rename SubmitTx to SendTx (#2255)
  • Add IsMiddlewareEnabled key to simulation store decoder (#2215)
  • Addressing small nits for channel capability migrations (#2258)
  • Adding paths ignore to pull request as well as on push (#2186)
  • Increment go mod to v6 (#2318)
  • Removing push as trigger for markdown link check (#2353)
  • Revert changing error code (#2352)
  • Renaming ica migrations handler pkg version (#2355)
  • Add minor releases to test matrix (#2365)
  • Remove unnecessary code (#2395)
  • Updating 09-localhost migration code to v7 (#2392)
  • Add v4 to v5 migration docs to site (#2426)
  • Add private send transfer function (#2425)
  • Add v6 upgrade handler to simapp (#2383)
  • Update migration template (#2423)
  • Bump ibctest version and ibc-go version to v6 for e2e module (#2479)
  • Update godocs for legacy apis on controller module (#2363)
  • Update tests to use new SendPacket API
  • Update logo (#2563)
  • Update tests to use new SendPacket API (#2567)
  • Makefile cleanup/fixes (#2549)
  • Add potential use cases documentation for ica (#2594)
  • Small README nits for readability and usability (#2669)

Refactor

  • Panic on ZeroCustomFields for solo machine implementation (#1972)
  • Remove unnecessary authentication (#1986)
  • Remove unused GetHeight fn (#1966)
  • Use 4 val nodes for e2e tests (#2016)
  • Remove SendTransfer, require IBC transfers to be initiated with MsgTransfer (#2446)
  • Adapting transfer metadata bytes field to memo string (#2595)
  • Allow for serialization of proto message without fulfillment of sdk.Msg interface (#2607)

Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

cliff.toml Outdated
Comment on lines 14 to 19
* feat, feature
* imp
* bug, fix
* deprecated
* api-breaking
* state-machine-breaking, smb
Copy link
Contributor Author

@chatton chatton Nov 7, 2022

Choose a reason for hiding this comment

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

these are arbitrary and can be decided by us. Note: these strings will not appear in the changelog entry, they are used to group the commits in the changelog.

Copy link
Member

@damiannolan damiannolan Nov 11, 2022

Choose a reason for hiding this comment

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

I recall some usage of a ! prefix which would indicate an API breaking change.
I'd like to suggest maybe adopting a ! prefix for api breaking changes and !! or something else for state machine breaking.

I feel like its common for us to use squash commits / PR titles similar to:

refactor: some refactor of a module or chore: cleaning up unused to code

But it might be nice to be able to prefix these like:

!refactor: some refactor that breaks an api or !!feat: this feat introduces a state machine breaking change.

Any thoughts on this?

@chatton
Copy link
Contributor Author

chatton commented Nov 8, 2022

I need to look a bit more into how this behaves when running from a release/vx.y.z branch to the next tag.

@chatton chatton marked this pull request as draft November 8, 2022 09:11
@chatton chatton marked this pull request as ready for review November 8, 2022 12:29
cliff.toml Outdated
Comment on lines 65 to 71
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}))" },
]
Copy link
Contributor Author

@chatton chatton Nov 8, 2022

Choose a reason for hiding this comment

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

this effectively means I can write a commit message like

fix: fixed the problem in issue #1234 and also addressed concerns raised in pr-5678

And the issue and pr will be expanded into links in the changelog entry.

e.g.

Bug Fixes

  • fixed the problem in issue #1234 and also addressed concerns raised in #5678

Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome!

Copy link
Contributor

Choose a reason for hiding this comment

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

Will the commit merged automatically be linked?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.

Copy link
Member

@damiannolan damiannolan left a comment

Choose a reason for hiding this comment

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

Looks awesome! I left a possible suggestion/proposal for adopting a convention for api breaking and state machine breaking commits.

I'd be curious to hear what others think and maybe discuss this before getting it merged.

cliff.toml Outdated
Comment on lines 14 to 19
* feat, feature
* imp
* bug, fix
* deprecated
* api-breaking
* state-machine-breaking, smb
Copy link
Member

@damiannolan damiannolan Nov 11, 2022

Choose a reason for hiding this comment

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

I recall some usage of a ! prefix which would indicate an API breaking change.
I'd like to suggest maybe adopting a ! prefix for api breaking changes and !! or something else for state machine breaking.

I feel like its common for us to use squash commits / PR titles similar to:

refactor: some refactor of a module or chore: cleaning up unused to code

But it might be nice to be able to prefix these like:

!refactor: some refactor that breaks an api or !!feat: this feat introduces a state machine breaking change.

Any thoughts on this?

Copy link
Contributor

@crodriguezvega crodriguezvega left a comment

Choose a reason for hiding this comment

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

Thank you, @chatton. Looking forward to using this!

CONTRIBUTING.md Outdated Show resolved Hide resolved
@@ -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/).
Copy link
Contributor

Choose a reason for hiding this comment

The 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.

cliff.toml Outdated
Comment on lines 65 to 71
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}))" },
]
Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome!

@@ -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
Copy link
Contributor

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.

chatton and others added 2 commits November 14, 2022 09:34
Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
@chatton chatton self-assigned this Nov 14, 2022
Copy link
Contributor

@colin-axner colin-axner left a comment

Choose a reason for hiding this comment

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

LGTM! Can we update the pr template as well to explain changelog entry usage? I'm still a little unclear about the usage with regards to auto merge. Would it be possible to just use the last line on a pr description for the changelog entry?

My main concern about entering the changelog entry when merging is typos/improper wording. It isn't uncommon to have requested changes to the changelog formatting, so it'd be nice if we could review the entry before merge

CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Show resolved Hide resolved
CONTRIBUTING.md Show resolved Hide resolved
cliff.toml Outdated Show resolved Hide resolved
cliff.toml Outdated
Comment on lines 65 to 71
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}))" },
]
Copy link
Contributor

Choose a reason for hiding this comment

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

Will the commit merged automatically be linked?

@@ -12,18 +12,41 @@ are the most critical to review.

closes: #XXXX


### Commit Message / Changelog entry
Copy link
Contributor Author

Choose a reason for hiding this comment

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

cc @colin-axner @charleenfei @damiannolan @crodriguezvega

I updated the PR template to include a new section where contributors will include the proposed commit message / changelog entry. (can thumbs up if you're happy, and leave a comment if you have any suggestions / concerns! )

@chatton
Copy link
Contributor Author

chatton commented Nov 14, 2022

Would it be possible to just use the last line on a pr description for the changelog entry?

It is possible to either look at the first line of the commit for parsing, or to treat every line as a different commit, this type of behaviour isn't possible with this tool as far as I can tell.

It does mean that as long as the first line is in a nice format, the rest can be in any format we like.

cc @colin-axner

type: commit message
```

see the [guidelines](../CONTRIBUTING.md#commit-messages) for commit messages. (view raw markdown for examples)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe move this into the comment section?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was intended to be short version with a prompt to look at the raw markdown (it might not be obvious if you don't know where to look).

Do you think it's not necessary to indicate that there is more details in comments?

Copy link
Contributor

Choose a reason for hiding this comment

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

I was just thinking this would show on every pr description, but it is only relevant to the pr opener and thus it might make sense to make it a comment in the description so it isn't viewable by the reviewers. But I have no preference, we can always change it later

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it might provide some value, but like you said we can always remove it in the future if it just ends up being perceived as bloat!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done 🥳
Development

Successfully merging this pull request may close these issues.

Consider using git-cliff to generate CHANGELOG.md
5 participants