backporting workflow
https://blogs.oracle.com/linux/post/backporting-patches-using-git
Regarding backports, my suggestion is to first make commits on the main branch and then apply them to every release branch as needed.
fixes should land on master first, be tested there, and only then be back-ported to older releases. https://stackoverflow.com/a/13275789
There are some actions that would help this approach:
- https://github.com/marketplace/actions/backporting
- https://github.com/marketplace/actions/backport-action
might be an example:
- https://github.com/kata-containers/community/blob/main/Backport-Guide.md
ok, what you suggest this seems better:
- make a fix commit to the main branch
- cherry-pick the commit to the release branch (forked of at the time of making the 1st tag)
This solves the issue with the CHANGELOG.md. The issue that remains is the CI. We need CI to run on every PR to release branch. I'm not sure how to do that best. Maybe we can have CI workflows that target all branches starting with a prefix, like 2.0.0 (currently we have a branch 2.0.0-pre-rc.21). Or we should remain with stable branch for the latest public release
What do you think about having stable/2.0.0 etc. and filtering by stable/ ? However, in that case, the current stable would not coexist with them due to branch name restrictions
This is the description of Iroha's workflow:
- We have
mainbranch which everyone works on and merges their PRs to - We create new branch from main when we publish a new major version
- We create git tag and publish to
crates.iofrom this new branch
Example
New major release
Let's say we are releasing 2.0.0-rc.2.0 (previous release was ):
- Create a new entry in
CHANGELOG.md(cut it from theUnreleasedsection if possible) - Create a branch called
2.0.0-rc.2(notice the absence of the minor version) from themainbranch - In the version branch create a tag
v2.0.0-rc.2.0(tags are prefixed withvto make our life in CI easier) - Publish new
2.0.0-rc.2.0release of all Iroha crates tocrates.iofrom the version branch - In the
mainbranch update version of Iroha inCargo.tomlfiles to2.0.0-rc.3.0(next release)
New patch release
Making a bug fix for 2.0.0-rc.1 (notice the version is 1 behind latest release):
- Commit the fix to the
mainbranch first - Update
CHANGELOGin a separate commit (we must have an entry for patch versions in themainbranch as well) - Cherry-pick commits (all bugfix and
CHANGELOG) frommaininto the version branch (in this case2.0.0-rc.1) - In the version branch update version of Iroha in
Cargo.tomlfiles to2.0.0-rc.1.1 - In the version branch create a new tag
v2.0.0-rc.1.1 - Publish new release of all Iroha crates to
crates.iofrom the version branch
About the patch release section, I'd like to disambiguate whether the separate commits should be on my fork or on the target branches. I guess a single commit on the target branches that are squashed from the separate commits on my fork would be enough:
- Commit the fix to the
mainbranch first- Update
CHANGELOGin a separate commit (we must have an entry for patch versions in themainbranch as well)- Cherry-pick commits (all bugfix and
CHANGELOG) frommaininto the version branch (in this case2.0.0-rc.1)- In the version branch update version of Iroha in
Cargo.tomlfiles to2.0.0-rc.1.1
In this case, for example,
- The
mainbranch should have a commit from a PRfix: my patch (#0000)that consists offix: my patchandchore: update CHANGELOG.md - The
2.0.0-rc.1branch should have a commit from a PRfix(BACKPORT): my patch (#0001)that consists offix: my patchandchore: update CHANGELOG.md, where the latter should be amended to increment the minor version to2.0.0-rc.1.1
Am I correctly understanding @mversic ?
yes except:
where the latter should be amended to increment the minor version to 2.0.0-rc.1.1
shouldn't be amended but added as a new commit
- In the version branch create a new tag
v2.0.0-rc.1.1
git checkout 2.0.0-rc.1, git tag v2.0.0-rc.1.1, and directly git push upstream v2.0.0-rc.1.1 ?
EDIT: added git tag v2.0.0-rc.1.1
you must push a tag:
git push upstream tag v2.0.0-rc.1.x