Create a RubyGem 99: Backport Changes to Other Stable Branches and Update the CHANGELOG

Published: 08 March 2023
on channel: Stateless Code
26
1

This one is a doozy!

So we have all of our changes in the master branch. Now we need to document those changes in the CHANGELOG and figure out which change goes in which patch release.

We start with the 0.4.x branch, which is closest to master and cherry-pick nearly all of the changes, leaving out only the ones related to dropping support for Ruby 2.7. Then we iterate through similar processes in the branches for the other versions.

In some cases, we can just cherry-pick a commit without modification. In the commits where we updated the bundle, we need to check out only the Gemfile.lock and gemspec from the master branch. Then we need to re-run `bundle update` so the gem version is correct and re-do the corrections for the RuboCop violations. The branches are all different and are targeting a different Ruby version in the RuboCop config than master.

We pasted our CHANGELOG into a GitHub Markdown editor on the issue to make our changes. This nearly leads to disaster, because we navigate away from the issue on that tab. You get to watch Mike panic for a minute before he realizes that the in-progress changes were still in a draft comment on the issue. (Thanks GitHub for an excellent user experience!) In the future, we should probably place our in-progress changes in another editor.

When we inspect our legacy branches, it turns out that we neglected to properly sign some of the commits while cherry-picking. We solve this by doing an interactive rebase, choosing edit, amending the commit to sign it, and force pushing to the branch.

Finally we commit our updated CHANGELOG and merge it into master. We are ready to release!

This video covers:
00:00:12 Introduction
00:01:22 Look at the CHANGELOG and create template sections for each release
00:05:15 Create the consolidated set of all the changes in the 0.5.0 section
00:11:13 Get the master CHANGELOG into the GitHub markdown editor so we can switch to the other branches to cherry-pick the changes
00:12:09 Use git stash save to save the master changes
00:12:35 Check out the 0.4.x branch, cherry pick changes, and update section of CHANGELOG
00:24:45 Check out the 0.3.x branch, cherry pick a smaller subset of changes, and update section of CHANGELOG
00:37:24 Fix intermediate commit on 0.3.x branch to include forgotten changes and amend commit
00:40:21 Check out the 0.2.x branch, cherry pick subset of changes, and update section of CHANGELOG
00:52:00 Check out the 0.1.x branch, cherry pick changes, and update section of CHANGELOG
01:00:38 Add in missing cert commit to version 0.4.x branch
01:02:00 Correct unsigned commits on each of the patch version branches with interactive rebase
01:10:00 Switch back to master, check out a new branch, and update with the finished CHANGELOG (Watch Mike panic thinking he lost the CHANGELOG edits)
01:13:31 Pull request into master, close issue, update backlog

#ruby #rubygems #codecast #screencast #NerdDice #DnD #roleplaying #softwaredevelopment #github #opensource #dice #changelog #cherrypick #interactiverebase #conflicts

See other related StatelessCode videos:
Create a RubyGem 05: Prepare for the Initial Release    • Codecast: Create a RubyGem 05: Prepar...  
Create a RubyGem 19: End of an Epic - Finish the configurable generator story    • Codecast: Create a RubyGem 19: End of...  
Create a RubyGem 34: Evaluate whether to release, backport changes    • Codecast: Create a RubyGem 34: Evalua...  
Create a RubyGem 49: Open Pull Request and Update Documentation    • Codecast: Create a RubyGem 49: Open P...  
Create a RubyGem 60: Add Ability Scores Documentation and Merge    • Codecast: Create a RubyGem 60: Add Ab...  
Create a RubyGem 63: Create 0.3.x Stable Branch and Prune Old Branches    • Codecast: Create a RubyGem 63: Create...  
Create a RubyGem 84: Update Docs and Extend ConvenienceMethods into NerdDice, Merge    • Codecast: Create a RubyGem 84: Update...  

This video is CC0 - No rights reserved. (YouTube doesn't allow this option when publishing.) All code is released under the UNLICENSE. Stateless Code denies the concept of "intellectual property". Copying is not stealing.


Watch video Create a RubyGem 99: Backport Changes to Other Stable Branches and Update the CHANGELOG online without registration, duration hours minute second in high quality. This video was added by user Stateless Code 08 March 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 2 once and liked it people.