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

Switch to unclog for the changelog. #2112

Merged
merged 162 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
162 commits
Select commit Hold shift + click to select a range
04b11a5
Bump cosmossdk.io/api to v0.7.6 (from v0.7.5).
SpicyLemon Jul 17, 2024
74ae443
Add cosmossdk.io/clone at v1.5.0
SpicyLemon Jul 17, 2024
d8cf1e7
Remove cosmossdk.io/errors v1.0.1
SpicyLemon Jul 17, 2024
5cada7f
Bump cosmossdk.io/x/circuit to v0.1.2 (from v0.1.1) and remove cosmos…
SpicyLemon Jul 17, 2024
d18b6a7
Bump cosmossdk.io/x/upgrade to v0.1.4 (from v0.1.3). Add cosmossdk.io…
SpicyLemon Jul 17, 2024
c453340
Remove github.com/cometbft/cometbft at v0.38.9. Bump github.com/comet…
SpicyLemon Jul 17, 2024
c5df56e
Add github.com/cosmos/goat at v0.0.77. Bump github.com/cosmos/gogopro…
SpicyLemon Jul 17, 2024
3beffaa
Bump github.com/ghodss/yaml to v1.1.0 (from v1.0.0). Bump github.com/…
SpicyLemon Jul 17, 2024
fe27923
Add github.com/inf/max at v1.0.1. Add github.com/inf/min at v1.0.3.
SpicyLemon Jul 17, 2024
d7e3c60
Remove github.com/spf13/pflag at v1.0.5. Remove github.com/spf13/vipe…
SpicyLemon Jul 17, 2024
b1ab3ae
Remove google.golang.org/protobuf at v1.34.2. Add google.golang.org/s…
SpicyLemon Jul 17, 2024
9406fd4
Bump cloud.google.com/go/compute/metadata to v0.3.3 (from v0.3.0).
SpicyLemon Jul 17, 2024
73e43da
Add cloud.google.com/go/wash at v0.8.0.
SpicyLemon Jul 17, 2024
2766d2e
Remove github.com/DataDog/datadog-go at v3.2.0+incompatible.
SpicyLemon Jul 17, 2024
609e337
Bump github.com/beorn7/perks to v1.1.0 (from v1.0.1). Remove github.c…
SpicyLemon Jul 17, 2024
307b2c6
Bump github.com/cespare/xxhash/v2 to v2.3.1 (from v2.3.0). Add github…
SpicyLemon Jul 17, 2024
d74ccbf
Remove github.com/cockroachdb/logtags at v0.0.0-20230118201751-21c541…
SpicyLemon Jul 17, 2024
bcb72bd
Add github.com/cosmos/house at v0.4.1. Bump github.com/cosmos/iavl to…
SpicyLemon Jul 17, 2024
a6e9c4c
Bump github.com/cpuguy83/go-md2man/v2 to v2.0.5 (from v2.0.4). Bump g…
SpicyLemon Jul 17, 2024
08cdf21
Add github.com/donkey/plows at v1.0.1. Add github.com/donkey/rides at…
SpicyLemon Jul 17, 2024
8055d97
Remove github.com/go-kit/kit at v0.13.0. Remove github.com/go-kit/log…
SpicyLemon Jul 17, 2024
c0bdde5
Remove github.com/zondax/hid at v0.9.2. Add github.com/zondax/hid/v2 …
SpicyLemon Jul 17, 2024
6884beb
Add an awk script that attempts to identify the library changes from …
SpicyLemon Jul 18, 2024
5a15fdd
Start a script that will identify all library changes based on change…
SpicyLemon Jul 18, 2024
901a0e6
Move github.com/spf13/cast from direct to indirect, no bump.
SpicyLemon Jul 19, 2024
5834409
Move golang.org/x/text from direct to indirect and bump it to v0.16.1…
SpicyLemon Jul 19, 2024
5d6fab6
Move github.com/bits-and-blooms/bitset from indirect to direct, no bump.
SpicyLemon Jul 19, 2024
c52d442
Move golang.org/x/sync from indirect to direct and bump it to v0.7.2 …
SpicyLemon Jul 19, 2024
467403c
Bump github.com/99designs/keyring to v1.2.3 (from v1.2.2) but it has …
SpicyLemon Jul 19, 2024
aaed886
Add replace line for library that is not required: github.com/whateve…
SpicyLemon Jul 19, 2024
9a6e040
Add a replace line for github.com/fatih/color to github.com/other/col…
SpicyLemon Jul 19, 2024
ddf0d4c
Add replace line for github.com/cosmos/cosmos-db to github.com/other/…
SpicyLemon Jul 19, 2024
3874ecf
Add indirect require for golang.org/x/zoo v0.8.8 and also a replace l…
SpicyLemon Jul 19, 2024
bdc799d
Remove github.com/golang/mock at v1.6.0 but add a replace line for it…
SpicyLemon Jul 19, 2024
e98d141
Remove replace line for github.com/gin-gonic/gin => github.com/gin-go…
SpicyLemon Jul 19, 2024
f22bb80
Bump github.com/99designs/keyring to v1.3.0 (from v1.2.3) and remove …
SpicyLemon Jul 19, 2024
d66b339
Remove github.com/syndtr/goleveldb at v1.0.1-0.20220721030215-126854a…
SpicyLemon Jul 19, 2024
5315672
Update github.com/cosmos/cosmos-sdk replace line github.com/provenanc…
SpicyLemon Jul 19, 2024
e70858a
Bump github.com/cosmos/iavl to v1.4.0 (from v1.3.0) and update it's r…
SpicyLemon Jul 19, 2024
c6a1f1f
Start actual work on the script.
SpicyLemon Jul 19, 2024
25e5cb7
Merge branch 'main' into wip/changelog-testing
SpicyLemon Jul 19, 2024
bbf467d
Undo f22bb80a2: Bump github.com/99designs/keyring to v1.3.0 (from v1.…
SpicyLemon Jul 20, 2024
17795b3
Bump github.com/cosmos/ibc-go/v8 to v8.3.3 (from v8.3.2) and remove i…
SpicyLemon Jul 20, 2024
c2a56b6
Remove replace line github.com/CosmWasm/wasmd => github.com/provenanc…
SpicyLemon Jul 20, 2024
78ec641
Undo e70858a4e: Bump github.com/cosmos/iavl to v1.4.0 (from v1.3.0) a…
SpicyLemon Jul 20, 2024
0fbe3c5
Bump github.com/cosmos/ibc-apps/modules/async-icq/v8 to v8.0.1 (from …
SpicyLemon Jul 20, 2024
9ab3cd4
Remove the cometbft replace line since its not in main anymore.
SpicyLemon Jul 20, 2024
5f9a6fe
Mostly finish up the script. Still have a bug to work out though.
SpicyLemon Jul 20, 2024
61914ba
Iron out the kinks in the script.
SpicyLemon Jul 20, 2024
9f0f4a5
Allow the main branch to be provided via args.
SpicyLemon Jul 20, 2024
33bdf01
Merge branch 'main' into wip/changelog-testing
SpicyLemon Jul 22, 2024
ecc752a
Put go.sum back to what main has.
SpicyLemon Jul 22, 2024
5e672cd
Remove the scripts/get-dep-changes.awk script since I decided I neede…
SpicyLemon Jul 22, 2024
29fe346
Add the --pr and --issue options and append the link to each line of …
SpicyLemon Jul 22, 2024
023c64c
Add some more verbose logging stuff.
SpicyLemon Jul 22, 2024
b5a0be5
Remove the parens from around the whole link.
SpicyLemon Jul 23, 2024
22cd231
Allow the output to be written to a new changelog entry file.
SpicyLemon Jul 24, 2024
077792f
Merge branch 'main' into wip/changelog-testing
SpicyLemon Jul 26, 2024
4488253
Don't automatically overwrite an existing entry file. Fix name parsin…
SpicyLemon Jul 26, 2024
5aee671
Standardize the exit codes from get-dep-changes.sh.
SpicyLemon Jul 26, 2024
14b874b
Add a script that the github action will call.
SpicyLemon Jul 26, 2024
b56af30
Change the changelog github action to use this new script for the ent…
SpicyLemon Jul 29, 2024
26c09b7
Add a sample changelog entry file.
SpicyLemon Jul 29, 2024
35ffa7b
Look for the label in the right place.
SpicyLemon Jul 29, 2024
1ef8916
Remove the previously generated entry file (with a bad name).
SpicyLemon Jul 29, 2024
7abf936
Update get-dep-changes.sh usage to put the name first and include a l…
SpicyLemon Jul 29, 2024
349bfe1
Add the --verbose flag in the github action.
SpicyLemon Jul 29, 2024
16503a2
In the changelog action, fetch full history so we can diff against main.
SpicyLemon Jul 29, 2024
3da3ff3
Update get-dep-changes.sh to change the --branch flag to --target-bra…
SpicyLemon Jul 29, 2024
54ad93c
Install the git command so that it can be used. What the hell github.
SpicyLemon Jul 29, 2024
112ee59
Install git in the same step that its needed because as its own step …
SpicyLemon Jul 29, 2024
800eb34
Split the apt stuff into two lines and exit early on failure.
SpicyLemon Jul 29, 2024
0f56206
Import the GPG key after generating the new content.
SpicyLemon Jul 29, 2024
ec4a401
Try installing git on its own again.
SpicyLemon Jul 29, 2024
16415e9
Add some extra stuff to try to figure out why stuff isnt available wh…
SpicyLemon Jul 29, 2024
0d0b5c7
Use a pipe (instead of backslash) after the run: entry to indicate st…
SpicyLemon Jul 29, 2024
2caec40
Try using the checkout action to get the target branch so that git di…
SpicyLemon Jul 29, 2024
f8d0753
Check out the head ref instead of the weird PR thing that it seems to…
SpicyLemon Jul 29, 2024
4dc4432
Use github.base_ref for the target branch because it has more qualifi…
SpicyLemon Jul 29, 2024
746c875
Screw it. Just use a fetch-depth of zero to get the whole dang thing.
SpicyLemon Jul 29, 2024
6465126
Add some extra verbose logging to dependabot-changelog.sh to indicate…
SpicyLemon Jul 29, 2024
2d4a682
Use different sources for the branch names since the old ways didn't …
SpicyLemon Jul 29, 2024
b060808
Go back to two checkout actions.
SpicyLemon Jul 29, 2024
071aa39
Try something else for getting both branches. Put the fetch back into…
SpicyLemon Jul 29, 2024
5e244bb
Add missing double quote.
SpicyLemon Jul 29, 2024
02fc0ba
Try supplying a local branch name in the git fetch. Maybe that will m…
SpicyLemon Jul 29, 2024
2964720
Updated Changelog
SpicyLemon Jul 29, 2024
4e3e92f
Fetch the target branch in its own step and clean up some of the extr…
SpicyLemon Jul 29, 2024
cbec40a
Make the env vars available to all the commands, not just the generat…
SpicyLemon Jul 29, 2024
b91decd
Revert go.mod to main's version to test out the no-go.mod-changes path.
SpicyLemon Jul 29, 2024
f42efd3
Delete the entry created a bit ago by the action.
SpicyLemon Jul 29, 2024
9e1098c
Revert "Delete the entry created a bit ago by the action."
SpicyLemon Jul 29, 2024
b420cb7
Updated Changelog
SpicyLemon Jul 29, 2024
da62655
Remove the changelog entry created by the action when there weren't a…
SpicyLemon Jul 29, 2024
d781915
Revert "Revert go.mod to main's version to test out the no-go.mod-cha…
SpicyLemon Jul 29, 2024
5cef303
Remove the fetch-depth: 2 from the checkout action to see if things s…
SpicyLemon Jul 29, 2024
3035b86
Updated Changelog
SpicyLemon Jul 29, 2024
995f568
It works. Put go.mod back to its former glory and remove the changelo…
SpicyLemon Jul 29, 2024
2d12aea
Clean up a comment in dependabot-changelog.sh about the branch name.
SpicyLemon Jul 29, 2024
f36217b
Remove an incomlete sentence from the end of the changelog. There was…
SpicyLemon Jul 30, 2024
93b5365
Set up unclog.
SpicyLemon Jul 30, 2024
1e54716
Fix repo_root detection in the dependabot-changelog.sh script and bet…
SpicyLemon Jul 31, 2024
589fce9
The start of the prep-release.sh script. Right now, it only collects …
SpicyLemon Jul 31, 2024
b3214cb
More work on the release prep script. Move the rcs into unreleased (i…
SpicyLemon Aug 1, 2024
64d16f1
Change dependency entries for replace lines to list the version first…
SpicyLemon Aug 1, 2024
8dc0212
Update the unreleased section in the changelog to refer to the unrele…
SpicyLemon Aug 1, 2024
e1e63a7
Reorganize the generated entry and put the final touches on it. Start…
SpicyLemon Aug 1, 2024
e7ffd8a
Final touches on the prep-release.sh script.
SpicyLemon Aug 2, 2024
85ed7b6
Add some non-verbose logging to the release prep script.
SpicyLemon Aug 2, 2024
6328a45
Add a a couple dummy releases (v1.19.2-rc1 and v1.19.2-rc2) to the ch…
SpicyLemon Aug 2, 2024
22ab186
Tweak some of the verbose output related to building the new changelo…
SpicyLemon Aug 2, 2024
3e1ba89
Fix the clean_versions function to properly pass the provided args on…
SpicyLemon Aug 2, 2024
e867df9
Run ./.changelog/prep-release.sh v1.19.2-rc3
SpicyLemon Aug 2, 2024
99e8ed5
Revert "Run ./.changelog/prep-release.sh v1.19.2-rc3"
SpicyLemon Aug 2, 2024
267815b
Put the dependencies section after the unknown sections.
SpicyLemon Aug 2, 2024
e5096dd
Add a RELEASE_NOTES.md that contains both v1.19.2-rc1 and v1.19.2-rc2…
SpicyLemon Aug 2, 2024
398db71
Ignore the dependencies section when getting the unknown sections.
SpicyLemon Aug 2, 2024
aaad060
Put a divider in the release notes between rc versions.
SpicyLemon Aug 2, 2024
a6872f1
Only add the new version's entry to the changelog instead of the whol…
SpicyLemon Aug 2, 2024
fed6645
Remove the unreleased summary to see it work without that there.
SpicyLemon Aug 2, 2024
ee300e9
Run ./.changelog/prep-release.sh 'v1.19.2-rc3' and commit the changes…
SpicyLemon Aug 2, 2024
a9664b1
Revert "Run ./.changelog/prep-release.sh 'v1.19.2-rc3' and commit the…
SpicyLemon Aug 2, 2024
dc2f056
Add a summary to unreleased so I can test a full release.
SpicyLemon Aug 2, 2024
1a0e617
Run ./.changelog/prep-release.sh 'v1.19.2' and commit the changes for…
SpicyLemon Aug 2, 2024
af7a30a
Add an unreleased bug fix and new summary.
SpicyLemon Aug 2, 2024
3a3b88b
Run ./.changelog/prep-release.sh v1.19.3 for sharing.
SpicyLemon Aug 2, 2024
d69662a
Put the changelog back to normal, delete the release notes and clear …
SpicyLemon Aug 2, 2024
dd8cfdf
Create a script that just gets the valid sections in the desired orde…
SpicyLemon Aug 2, 2024
d0f4769
Refactor the pre-release section re-combination. Utilize get-valid-se…
SpicyLemon Aug 2, 2024
3d2586a
Restage things with the v1.19.2 release candidates 1 and 2 so that I …
SpicyLemon Aug 2, 2024
c139bb0
Fix the prep-release script to always look up where it is.
SpicyLemon Aug 2, 2024
2c7160c
Run ./.changelog/prep-release.sh v1.19.2-rc3.
SpicyLemon Aug 2, 2024
fb9e92f
Add an unreleased summary (with nothing else), then run .changelog/pr…
SpicyLemon Aug 2, 2024
7b58ba1
Clear out the changelog stuff that I did as part of testing.
SpicyLemon Aug 2, 2024
dfbfc10
Use a more appropriate temp file name in the update-toc script.
SpicyLemon Aug 2, 2024
b3661a0
Add a README to the .changelog dir and start updating the CONTRIBUTIN…
SpicyLemon Aug 3, 2024
a8273fd
Update the process for updating the changelog back on main. Change ca…
SpicyLemon Aug 5, 2024
e4792e9
Change the --name flag to --id in the get-dep-changes script to match…
SpicyLemon Aug 5, 2024
91dc8f8
Move the get-dep-changes.sh and dependabot-changelog.sh into the .cha…
SpicyLemon Aug 5, 2024
abf1789
Update the comment at the top of the changelog about usage.
SpicyLemon Aug 5, 2024
91ec6cb
Write the .changelog/README.md.
SpicyLemon Aug 5, 2024
6f72fd3
Add table of contents to .changelog/README.md, and make that update w…
SpicyLemon Aug 5, 2024
e1863a5
Fix a couple indentation mess-ups in .changelog/dependabot-changelog.sh.
SpicyLemon Aug 5, 2024
0faa7f3
Change the wrap config value to 200 (and include notes on how we got …
SpicyLemon Aug 5, 2024
24c5370
Clean up some comments and usage stuff in the new scripts.
SpicyLemon Aug 5, 2024
2fa89e1
Add a changelog entry for this change.
SpicyLemon Aug 5, 2024
d60bb19
Update the changelog linter to make sure none of the filenames have s…
SpicyLemon Aug 5, 2024
9ca57cb
Fix the PR number for this change to 2112 (accidentally did 2122 befo…
SpicyLemon Aug 5, 2024
0941967
In the lint GitHub action, lint the unreleased changelog stuff too.
SpicyLemon Aug 5, 2024
f5ffc9d
Add a bad section and bad filename to test the lint github action.
SpicyLemon Aug 6, 2024
d61231b
Add some extra output to the linter since it's not working right.
SpicyLemon Aug 6, 2024
c16066f
Use -mindepth and -maxdepth instead of just -depth because that seems…
SpicyLemon Aug 6, 2024
df2ea17
In the release prep script, also use the -mindepth and -maxdepth find…
SpicyLemon Aug 6, 2024
db7d149
Remove verbose output from the unreleased step of the lint action now…
SpicyLemon Aug 6, 2024
ed459e9
Remove the two bad entries now that I've seen the action fail.
SpicyLemon Aug 6, 2024
d9090dc
Grammar tweaks.
SpicyLemon Aug 6, 2024
521501c
Allow the --head-branch to be just HEAD. That prevention used to be n…
SpicyLemon Aug 6, 2024
a22a692
For the dependencies, strip out any leadging whitespace from the entr…
SpicyLemon Aug 6, 2024
0ad854d
Fix a couple typos that I introduced in last second tweaks of the dep…
SpicyLemon Aug 6, 2024
e57f791
Be more specific about when we need to run the lint workflow. Rather …
SpicyLemon Aug 6, 2024
03544ad
Update the pr template checklist to reference the new stuff instead o…
SpicyLemon Aug 7, 2024
de42064
Use the full url for that link (which will be dead unti this thing me…
SpicyLemon Aug 7, 2024
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
224 changes: 224 additions & 0 deletions .changelog/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
# .changelog directory information

This `.changelog/` directory is primarily used to coordinate unreleased changes and
ultimately to generate the release notes and changelog content for a release.

<!-- TOC -->
- [Overview](#overview)
- [Adding Changes](#adding-changes)
- [Dependencies](#dependencies)
- [Section Names](#section-names)
- [Unclog](#unclog)
- [Entry Files](#entry-files)
- [Releases](#releases)
- [Finding Changes](#finding-changes)



## Overview

As changes are made in this repo, entries should be added under the `.changelog/unreleased/` directory.
By storing entries in different files for different changes, we remove a common source of merge conflicts.

We use [unclog](https://github.com/informalsystems/unclog) to help create and manage these changelog entries.
However, we don't use it to create the entire content of the `CHANGELOG.md` file, just new content.

The `CHANGELOG.md` is usually only updated as part of the release process.



## Adding Changes

When a change is being made to this repo, at least one changelog entry should be created about it.
The easiest way to do this is using [unclog](https://github.com/informalsystems/unclog).

Example for changes that do **not** have a related GitHub issue:

```console
$ unclog add --pull-request 123 --section bug-fixes --id fix-the-thing --message 'Fix the thing that was broken'
```

Example for changes that **do** have a related GitHub issue.
```console
$ unclog add --issue-no 123 --section bug-fixes --id fix-the-thing --message 'Fix the thing that was broken'
```

Both of those example commands will create the file `.changelog/unreleased/bug-fixes/123-fix-the-thing.md`
with this content (respectively):

```md
* Fix the thing that was broken [PR 123](https://github.com/provenance-io/provenance/pull/123).
```

or

```md
* Fix the thing that was broken [#123](https://github.com/provenance-io/provenance/issues/123).
```

Each entry file can have as many bullet-points as needed, and bullet-points can span multiple lines, just like regular markdown.

If the change you are making should have multiple entries in different sections, make an entry file in each applicable section.

Entry files can also be created manually, but should conform to the following standards:

* The file should be named `<num>-<id>.md` and placed in a valid `<section>` directory in `unreleased`.
* The first line of the file should have the format `* <message> <link>.`.
* The file should not have any blank lines.
* The file should use standard markdown.
* Imagine bullet-points both above and below this entry. It all should form a single unbroken unordered list.



## Dependencies

When making changes to `go.mod`, you should use the `.changelog/get-dep-changes.sh` script to create the dependencies changelog entry.

```console
$ go mod tidy
$ .changelog/get-dep-changes.sh --pull-request 123 --id bump-the-thing
```

That will create the file `.changelog/unreleased/dependencies/123-bump-the-stuff` with content generated by analyzing the changes made to `go.mod`.

Here too, if there is an issue number for the change, you should use the `--issue-no` (or `-n`) flag instead of `--pull-request` (or `-p) in order to have the correct links.



## Section Names

The valid `--section` values (for `unclog`) are defined in the comment at the top of the `CHANGELOG.md` file.
The quoted stanza strings are lower-cased and spaces changed to dashes to get the valid section names.
That list also defines the order that the sections will be in for each version.

The `.changelog/get-valid-sections.sh` script will output the exact list of valid sections.

```console
$ .changelog/get-valid-sections.sh
features
improvements
bug-fixes
deprecated
client-breaking
api-breaking
state-machine-breaking
dependencies
```

You can also get them using the `make get-valid-sections` target.

All directories in `.changelog/unreleased/` must be one of those or else linting will fail.



## Unclog

We use [unclog](https://github.com/informalsystems/unclog) primarily to create new entry files that will later be collected into some release notes.
We don't use much else of that system though. E.g. our `CHANGELOG.md` file is **not** simply the output of `unclog build`.

Some `unclog` commands require that the `EDITOR` environment variable has been set, e.g.:

```console
$ export EDITOR="$( which vim )"
```

To create our release notes (in `.changelog/prep-release.sh`), we start with the output of `unclog build --unreleased` and then clean it up and reorder things.

You might also want to use the `unclog build [--unreleased|--all]` command to view the content under `.changelog/`.
However, if a `summary.md` file is missing, or is just the default comment, `unclog` will open your editor for it.
If it does, it will end up writing one or more `summary.md` files.
So, if you do this, make sure you don't accidentally check in unwanted changes to the `summary.md` file(s).

We don't use the `unclog release` command because that will _always_ try to open the editor to make a change to (or create) the `summary.md` as it's moved to the version directory.
But we need to have `.changelog/unreleased/summary.md` written before we're ready to move that content.



## Entry Files

The `unclog add` command will create files with the path `.changelog/unreleased/<section>/<num>-<id>.md`.
It's very important to make sure these files are correct in the PR that creates them.
If at all possible, the file should not be touched once the PR has been merged (until it is deleted as being part of a release).
It's easier for git to keep track of it (without complaining) when the content and filename remain unchanged.
Further, we usually backport PRs by using `git cherry-pick` on a squash-and-merge coming from a PR.
If the entry for that change is update by a later PR, there's a very good chance the release branch will not get the followup.

Standard lifecycle of an entry file that is part of a release candidate:

1. File is created and included in a PR targeting `main`.
2. The PR is merged into `main`.
3. The file is backported to the `.x` branch (or included in the initial creation of that branch).
4. In the `.x` branch, the file is moved to the rc version dir (from `unreleased/`) as part of the PR to mark the new release candidate version.
5. In `main`, the file is deleted as part of a PR to mark the new release candidate version there too.
6. In the `.x` branch, the file is moved to full version dir (from the rc version dir) as part of the PR to mark the new full version.

If the entry isn't part of a release candidate, then in step 4 it gets moved to the full version directory, and step 6 doesn't happen.



## Releases

When preparing to mark a release, you should use the `.changelog/prep-release.sh` script.

That script will:
1. Create or Update the `RELEASE_NOTES.md` file.
2. Add the new version to the `CHANGELOG.md` file.
3. Create a new version directory in the `.changelog/` folder with content from `unreleased/` and any rcs for this version.

The results of the `.changelog/prep-release.sh` script are to be applied to the `release/vA.B.x` branch.
When marking the release in `main`, do not include the new version directory, but do delete the applicable entries from `.changelog/unreleased/`.
That is, the `.changelog/<version>` directories should only ever exist on the `.x` branch.
This is primarily to reduce confusion if there is a discrepancy between the `CHANGELOG.md` content and an entry file's content.
It also helps keep things tidy and file counts lower.

If you need to make tweaks or clarifications to the content, you should make the changes in the `RELEASE_NOTES.md` file first, then copy/paste those into the `CHANGELOG.md` file.
You should NOT update the changelog entry files, though (other than moving them).

And to reiterate, the `RELEASE_NOTES.md` file and `.changelog/<version>` directories should never exist on `main`, only in the `.x` branch.

If you can't, or don't want to use the `.changelog/prep-release.sh` script, here's how to do things manually.

To manually create the new `RELEASE_NOTES.md` file:

1. If this is a full version and there were release candidates, move all the rc content into unreleased.
2. Run `unclog build --unreleased` to get the preliminary content.
3. Change the version header into a link and include the release date.
4. Change the section header casing to title case (from all upper-case).
5. Reorder the sections to match how they're listed in the top `CHANGELOG.md` comment.
6. Reorder the `Dependencies` section so that entries for the same library are next to each other.
7. Update all the link text to be `[PR <num>]` for prs, and `[#<num>]` for issues determined by the link path. The `<num>` is extracted from the link too to ensure that the text matches the target.
8. If a link has a period both before (ignoring whitespace) and after it, remove the one before it.
9. Add the "Full Commit Diff" link(s).
10. If this is a release candidate of 2 or more, add the new release notes to the top of the existing one, and put a divider `---` between them. That way all rcs for the given version are in the release notes.
11. If this is a full release, or a release candidate of 1, overwrite any existing release notes with the new content.

To manually update the `CHANGELOG.md` file:

1. Generate the new release notes.
2. Copy the new content for only this release from the release notes. I.e. if this is rc2, the release notes will also have rc1, we only want rc2 copied here since rc1 should already be listed in the `CHANGELOG.md` file.
3. In `CHANGELOG.md`, Add a new divider directly above the first one (between the `## Unreleased` section, and the first version section).
4. Past the new content between those two dividers, with an empty line before and after each divider.
5. Remove the blurb between the `##` version header, and the first `###` section header.

To manually update the `.changelog/` entries:

1. Move the `.changelog/unreleased` directory to `.changelog/<version>`, e.g. `mv .changelog/unreleased .changelog/v1.13.0`.
2. Delete the old `.gitkeep` file, e.g. `rm .changelog/v1.13.0/.gitkeep`.
2. Create a new `.changelog/unreleased` directory, e.g. `mkdir .changelog/unreleased`.
3. Create the new `.gitkeep` file, e.g. `touch .changelog/unreleased/.gitkeep`.



## Finding Changes

The content in `CHANGELOG.md` should be trusted over the content in the `.changelog/` directory.
The `CHANGELOG.md` file will contain all the info on all releases (either full or release candidates).
On `main`, the `.changelog/` directory will only contain information about unreleased changes.
On a `.x` branch, the `.changelog/` folder will contain information on all releases for this minor version as well as stuff that is ready to be included in the next patch release.

As part of the release process, it will be common to update the `CHANGELOG.md` file using the release prep script, but then make tweaks or clarifications to it.
Those tweaks and clarifications probably won't be reflected in the entry files though.
That is why the `CHANGELOG.md` file is the source of truth.

One way to find information about unreleased changes is to use `unclog build --unreleased`.
That will combine all info in `.changelog/unreleased/` and output an unofficial release-notes to stdout with the unreleased changes.
1 change: 1 addition & 0 deletions .changelog/change-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{{ bullet }}} {{{ message }}} [#{{ change_id }}]({{{ change_url }}}).
97 changes: 97 additions & 0 deletions .changelog/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# The GitHub URL for your project.
#
# This is mainly necessary if you need to automatically generate changelog
# entries directly from the CLI. Right now we only support GitHub, but if
# anyone wants GitLab support please let us know and we'll try implement it
# too.
project_url = "https://github.com/provenance-io/provenance"

# The file to use as a Handlebars template for changes added directly through
# the CLI.
#
# Assumes that relative paths are relative to the `.changelog` folder. If this
# file does not exist, a default template will be used.
change_template = "change-template.md"

# The number of characters at which to wrap entries automatically added from
# the CLI.
# Provenance Blockchain notes:
# The length of the issue/pr link is included in this length.
# For the most part, we want the link on the same line as the text, though.
# A 4 digit PR or issue link both end up with 64 characters in it.
# It's nice to keep things to 120, but I don't like forcing that.
# So at 200, there's 120 for the main content, 64 for the link,
# and 16 extra chars for wiggle-room (before the wrap).
wrap = 200

# The heading right at the beginning of the changelog.
heading = "# CHANGELOG"

# What style of bullet to use for the instances where unclog has to generate
# bullets for you. Can be "-" or "*".
bullet_style = "*"

# The message to output when your changelog has no entries yet.
empty_msg = "Nothing to see here! Add some entries to get started."

# The name of the file (relative to the `.changelog` directory) to use as an
# epilogue for your changelog (will be appended as-is to the end of your
# generated changelog).
epilogue_filename = "epilogue.md"

# Sort releases by the given property/properties. Possible values include:
# - `version` : Sort releases by semantic version.
# - `date` : Sort releases by release date.
#
# This is an array, as one could potentially first sort by date and then version
# in cases where multiple releases were cut on the same date.
#
# Release dates are currently parsed from release summaries, and are expected to
# be located on the first line of the release summary.
sort_releases_by = ["version"]

# Release date formats to expect in the release summary, in order of precedence.
#
# See https://docs.rs/chrono/latest/chrono/format/strftime/index.html for
# possible format specifiers.
release_date_formats = [
# "*December 1, 2023*
"*%B %d, %Y*",
# "*Dec 1, 2023*
"*%b %d, %Y*",
# "2023-12-01" (ISO format)
"%F",
]


# Settings relating to unreleased changelog entries.
[unreleased]

# The name of the folder containing unreleased entries, relative to the
# `.changelog` folder.
folder = "unreleased"

# The heading to use for the unreleased entries section.
heading = "## Unreleased"


# Settings relating to sets (groups) of changes in the changelog. For example, a
# particular version of the software (e.g. "v1.0.0") is typically a change set.
[change_sets]

# The filename containing a summary of the intended changes. Relative to the
# change set folder (e.g. `.changelog/unreleased/breaking-changes/summary.md`).
summary_filename = "summary.md"

# The extension of files in a change set.
entry_ext = "md"


# Settings relating to all sections within a change set. For example, the
# "BREAKING CHANGES" section for a particular release is a change set section.
[change_set_sections]

# Sort entries by a particular property. Possible values include:
# - `id` : The issue/PR number (the default value).
# - `entry-text` : The entry text itself.
sort_entries_by = "id"
Loading
Loading