Note: This tutorial is for rosserial maintainers. |
Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags. |
Rosserial Maintainer Procedures
Description: This tutorial documents procedures rosserial maintainers will use, such as merging rosserial pull requests and releasing rosserial and a way to merge one or more pull requests locally (on a branch), merge the result into top-of-tree, and release debians that will get installed by apt-get.Tutorial Level: ADVANCED
Contents
Introduction
Github offers the option to automatically merge pull requests. For small fixes, this works well. However, a responsible maintainer would normally test significant change(s) before accepting them and merging to top of tree. This involves downloading the change, and building and testing it.
It is normal to do development on a branch, if for no other reason than that you can easily switch back to the current top of tree and compare operation. After development and merging (possibly multiple) pull requests, they should be merged back to the top of tree for the current release family (e.g. hydro), and pushed back to github. Once the changes have been pulled into the rosserial repo, they need to be released as debs, so that users doing apt-get update will get the changes.
This tutorial documents the steps to do all the above. There are many ways to do a release, and this is not the only way, but it is the safest and most complicated, hence this tutorial.
As a pre-requisite, you should have forked the repo on github, so you have your own copy that you will push to. You should also have set up your name and email in git:
~/ws/src/rosserial$ git config --global user.name "Paul Bouchier" ~/ws/src/rosserial$ git config --global user.email paul.bouchier@gmail.com
Clone the repo and make a branch
First, clone your github repo into ws/src:
git clone https://github.com/PaulBouchier/rosserial.git
Add the rosserial repo as an upstream and get its latest, then make a working branch.
git remote add upstream https://github.com/ros-drivers/rosserial.git git merge upstream/hydro-devel git checkout -b Sept2013Merges
Merge the changes in one or more pull requests into your working branch. To do this, you need the URL of the repo to pull the change from. Next to the "Merge Pull Request" button on github there's a link to pulling changes using the command line. Click the link to see the URL of the pull-requestors repo, and instructions for pulling the change and merging it. Those instructions are fine and result in a simpler flow where you're working locally on the release branch. These instructions deviate a little from that recipe, by using a different branch name for development of merged changes. This may be more appropriate for merging multiple pull requests.
The following command pulls the changes in the clearpath hydro-devel branch into your Sept2013Merges branch.
git pull git://github.com/clearpathrobotics/rosserial.git hydro-devel
Build and test them. Make any necessary changes. Then repeat to merge the next pull request you intend to incorporate.
Merge your changes branch into the release branch
When you're happy that all your pull requests are merged and working, check them in then switch back to the release branch and merge to the release branch from your merge branch. Finally, push the changes to your github repo.
git commit -a git checkout hydro-devel git merge Sept2013Merges git commit -a git push origin
Send your web browser to your github rosserial page, which should show your recent update. Create a pull request, which will switch you to the rosserial github page, from where you can pull and merge your pull request. In this way, your updates made on your local machine on the release branch travel through your github repo and into the rosserial github repo.
Preparing to do a release
These instructions provide additional rosserial-specific guidance for releasing an incremental version of a package into an existing ROS release. These are based off this wiki page: bloom/Tutorials/ReleaseCatkinPackage, which should be your guide. More tutorials covering cases such as a new ROS release can be found at bloom
On your local system, update rosserial/README.md to show the version number of the new release and what's changed (at a high-level) compared to the previous release. (Detailed changes are in the CHANGELOG.rst in each package directory.)
Where the instructions say to run catkin_generate_changelog, it is to be run in the rosserial directory. Leave the "forthcoming" header there - it will be automatically replaced with the current version number in a later step.
Before you run catkin_prepare_release, you want to change your default upstream remote to the rosserial repo. If you don't, catkin_prepare_release will push to your github repo, and you'll be left with the problem of how to get new tags into the rosserial repo.
git branch --set-upstream hydro-devel upstream/hydro-devel
Don't forget to reset it to point to your repo after you've finished the release, otherwise your pushes will go straight into the repo.
Doing the release
Before you can run bloom, you must install it. You should also install git-buildpackage so that you can run the prerelease tests.
sudo apt-get install python-bloom sudo apt-get install git-buildpackage
Now the exciting part: pushing the release. You must have access to rosserial-gbp repo. Kick off the release:
bloom-release rosserial --track hydro --rosdistro hydro
Prerelease Testing
When bloom-release pauses and tells you Releasing is complete, and asks if you want to push, switch to the prerelease tests wiki page: bloom/Tutorials/PrereleaseTest. This documentation assumes you will perform the prerelease test locally.
Where the instructions tell you to checkout and create a branch, do something like:
git checkout -b debian/ros-hydro-rosserial_0.5.3_precise
Finishing the release
If you get through the lintian step and it seems to be working (some errors may be thrown), go back and follow the instructions on the release page.
Finally you will get to the end!