bdk
bdk copied to clipboard
Update DEVELOPMENT_CYCLE.md to work with [patch.crates-io]
Description
Update DEVELOPMENT_CYCLE and release instructions to make overriding dependencies possible for downstream projects with unreleased bdk versions for development and testing. Also simplifies the release process by capturing changelog information in the pull_request_template and recording release changelog information in the release tag message instead of in a CHANGELOG.md file which causes too many merge conflicts and complicates the release process.
Fixes #536 Fixes #496
Notes to the reviewers
The primary changes to our current release process are:
- Don't add
-devor-rc.xto unreleasedbdkcargo versions because those extensions do not work with overriding dependencies. - Increment the
masterbranch version as soon as arelease/MAJOR.MINORbranch is created, the next releaserelease/MAJOR.MINORbranch version with be MAJOR.MINOR.PATCH, and themasterbranch development version will be MAJOR.MINOR+1.0; either version can be used with overriding dependencies. - Remove the
bdkversion from thesrc/lib.rsfile so that it doesn't need to be changed on every release, because it isn't needed in the rust docs for most developers and removing it will help simplify the release process. - The new release process is now documented as a checklist in a new
release.mdgithub issue template. - Putting changelog information in the release tag message is how the tokio project does it. ~~After this PR is merged I will replace old tags with new ones containing changelog information and then do a new PR to remove the CHANGELOG.md file.~~ After this PR is merged I don't think we need to update old tags, only rename the CHANGELOG.md file to CHANGELOG-OLD.md with a note to check tags for future change log info.
Checklists
All Submissions:
- [x] I've signed all my commits
- [x] I followed the contribution guidelines
- [x] I ran
cargo fmtandcargo clippybefore committing
Concept ACK for this, at this point we all hate CHANGELOG.md 😄
Shouldn't we add a "## Changelog" subtitle in the PR template? Not all PRs make it into the changelog (we usually ignore doc fixes, ci fixes, minor bug fixes, refactors, etc...).
Also, this needs a rebase :)
I don't know if all the following is covered by Auto-generate release notes button,
I've never been in the role of a maintainer, but it may help anyways.
I've been doing some research regarding #543. GitLab's final solution diverted from the initial approach using files. You can read more about it in this issue (TLDR: the last comment) and the documentation of the tool mentioned in the original document. As per the comment in Gitlab Issue #1339, they decided to use commit titles as input, and changelog files as output. That approach seems to be shared by other projects, using different tools (there is a great variety of them). All those projects and tools principally work through the use of special conventions in their commit messages. Conventional commits is one of them, in the same spirit as SemVer.
It seems that tokio is using some variation of the kind.
I would like to have more details about how tokio collects all the CHANGELOG
entries in each release. Is it done automatically? Is it done manually by
maintainers?
I prefer a semiautomatic approach rather than just the maintainers editing the
CHANGELOG themselves.
The workflow that I have in mind could be roughly like this:
- Make changes.
- Add to the staging area.
- Commit using
type,contextand trailers like changelog, fix orBREAKING CHANGEin the message. The changelog trailer allows you to opt out ofCHANGELOGentries. - Push changes.
- Review code and commit message description and format.
- Accept changes.
- Start the Merging process and trigger CI workflow with a tool to introduce
the new lines in
CHANGELOG.
Maintainers will take part in this process during the review. When they approve
a PR, they also approve the commit messages. This doesn't require the extra
effort of the edition of files with new CHANGELOG entries, which would be in
the hands of the CI process.
Also, the enforcement of the commit message format improves the quality of the
information provided by each commit. It may be a burden for new contributors,
but it ensures quality and is a step towards a self-contained project (detached
from the current remote host, Github).
@csralvall thanks for the info on how other projects are automating, or at least semi-automating the generation of their changelog info. I'd prefer to start with manually creating the changelog info provided by PR creators, and then later we can look into setting up some automation to help us compile this info.
Even if we go with some sort of changelog generation I'd still rather put the release summary and changelog info in the tag commits rather than a text file so that we don't ever have to merge our release branches back to the master branch. I think as long as we also keep a copy of the info in the GitHub release page it will be easy for new folks to find it. And experienced people won't have a problem finding the info in the the tag annotations.
Wait a second, are you sure this fixes #496? If we immediately bump the version in master, then all the projects depending on a currently relased version of bdk can't switch to master, because the version has already been bumped.
For example, the current latest release is 0.21. If we merge this PR we immediately bump our master to 0.22, which makes it impossible to patch bdk from the current latest release to master
For example, the current latest release is
0.21. If we merge this PR we immediately bump ourmasterto0.22, which makes it impossible to patch bdk from the current latest release tomaster
Is the scenario you're thinking of for using an unreleased patch to 0.21 (scenario 3 below)? My scenarios for patching a project to use an unreleased bdk version:
- next MINOR (0.MINOR+1.0), untagged:
[patch.crates-io]
bdk = { git = 'https://github.com/bitcoindevkit/bdk', branch = 'master' }
[dependencies]
bdk = "0.MINOR+1.0"
- next MINOR (0.MINOR+1.0), tagged RC.1:
[patch.crates-io]
bdk = { git = 'https://github.com/bitcoindevkit/bdk', tag = 'v0.MINOR+1.0-RC.1' }
[dependencies]
bdk = "0.MINOR+1.0"
- current MINOR, next PATCH fix (0.MINOR.PATCH+1), untagged:
[patch.crates-io]
bdk = { git = 'https://github.com/bitcoindevkit/bdk', branch = 'release/0.MINOR' }
[dependencies]
bdk = "0.MINOR.PATCH+1"
- current MINOR, next PATCH fix (0.MINOR.PATCH+1), tagged RC.1:
[patch.crates-io]
bdk = { git = 'https://github.com/bitcoindevkit/bdk', tag = 'v0.MINOR.PATCH+1-RC.1' }
[dependencies]
bdk = "0.MINOR.PATCH+1"
I think the problem is:
- We release bdk
0.21 - We merge fantastic things on master
- Someone wants to patch bdk
0.21with our master, to have the fantastic things - The
Cargo.tomlversion in master should be exactly0.21, otherwise you can't patch
I think the problem is:
1. We release bdk `0.21` 2. We merge fantastic things on master 3. Someone wants to patch bdk `0.21` with our master, to have the fantastic things 4. The `Cargo.toml` version in master should be exactly `0.21`, otherwise you can't patch
My thinking was in this case, they want some cool stuff from master then they'll need to patch to master and change the version to the one that will eventually have these things which is 0.22. If they only want some bug fix that will be in 0.21.x then they'd need to patch to the release/0.21 branch and they'll get it there.
As discussed on the call today, I updated the checklist for making a MINOR release to bump the master branch version just before making the release branch. This should let users [patch] to the master branch to get pre-released (and possibly breaking) changes for the current latest release.
I also decided to separated the steps for making a PATCH release into it's own issue template. And I added an extra master branch version bump when doing PATCH releases so that if someone wants to patch a dependency to master that is using a latest released patch version, it should still work.
I merged another PR before this one, and now the CHANGELOG is conflicting :/ Sorry!
I merged another PR before this one, and now the CHANGELOG is conflicting
How ironic
I merged another PR before this one, and now the CHANGELOG is conflicting :/ Sorry!
Rebased :-D