Welcome!

Java IoT Authors: Pat Romanski, Elizabeth White, Liz McMillan, Yeshim Deniz, Mehdi Daoudi

Related Topics: Java IoT, Microservices Expo, Microsoft Cloud, Open Source Cloud, Machine Learning , Agile Computing

Java IoT: Blog Post

Efficiency in Development Workflows: Pull Requests and Code Review

We talk about the steps necessary to get your feature shipped: Pull Request, Code Review and Merging

This is a republished blog post. You can find the original source here: http://blog.codeship.io/2013/08/22/the-codeship-workflow-part-2-pull-requests-and-code-review.html

Using Pull Requests
As I mentioned last week we use GitHub Flow on GitHub. But the whole workflow we describe is also possible when working with BitBucket. We do not have a policy when a pull request should be opened. Some of our developers open them when they start a feature, some wait until the feature is implemented. Then we push regularly to that branch as explained in the last post.

Open pull requests are helpful as everyone can see what we are working on. One really important part of feature branches and pull requests are proper commit messages.

The Codeship Workflow - Pull Requests

Writing good commit messages
As a distributed version control system, git makes it easy to take large changes and split them into small commits. Then these commits have a descriptive message with a short explanation in the first line and, if necessary, a longer description after a separation line. The git documentation project has some nice guidelines on it. Giving every commit a proper message and splitting large changes into a number of small commits makes your code history easier to read. It will be easier for your teammates to understand the history of your code.

I personally prefer git-gui for commiting and splitting up commits. It does only this job, but it does it very well. Take a look at some of the other git tools we like at the end of the post.

Using GitHub Issues and Labels
Once the feature is ready to be reviewed we assign its pull request to somebody else on the team. you have to read through the changes on GitHub at least once before handing the pull request . Making sure no obvious errors are in the code reduces the time and cycles necessary for a good code review. It is very helpful to inspect the changes outside of your own editor and with the excellent GitHub comparison view.

The Codeship Workflow - Comparison View

Now that we assigned the pull request, somebody on our team has a GitHub issue with his name attached. This way anybody can easily filter out the pull requests they need to look through. Now the last step is labeling the pull request with needs review. This way the reviewer knows this pull request is finally ready to reviewed.

The Codeship Workflow - GitHub Issues

When starting a pull request, the developer and reviewer can decide on looking through the pull request together or not. Especially for large changes reviewing the code as a pair is great.

Then we review the structure and syntax of the code, but we currently do not review the functionality itself. Before implementing a feature we discuss it in detail, so there is a common understanding. Once the feature is implemented, we trust our engineers that it does what it should. We are not working with a staging system.

One improvement we are starting with now is functional reviews for large and public facing features. Just so a second pair of eyes looks at changes that possibly impact a lot of our users. But this is still not a strict part of our workflow. A developer may request it after the implementation or we plan it before we start working on it.

When the review is done it either gets merged or, if the reviewer leaves comments, the GitHub issue is labeled as reviewed. This way developers can take a look at their open issues and see which have been reviewed and which need more attention.

The feature is ready to be merged as soon as the developer either updates the pull request or explains why she did it differently.

There's one challenge with every release workflow that involves code reviews: Getting the team to review as fast as possible without interrupting their work. We try to do it asynchronously for smaller features and sitting down for shared code review on larger features. This is no silver bullet, but in our experience it works well.

GitHub Merge Button
To make sure nobody introduces changes into our production system without review, we have a strict rule that you can never merge your own code. This rule is not enforced through technology, but a strict team policy.

The only exceptions are scheduled releases, for example a maintenance Deployment. Then we let somebody review the changes and leave a ready to be merged comment. The build can then be merged whenever the developer wants.

By releasing through the GitHub merge button everyone on the team can push to production. Making this possible for every developer or designer in our team is very valuable. It allows everyone to take part in the process and it speeds up our daily work.

The Codeship Workflow - GitHub Merge Button

As soon as we hit the merge button our tests are kicked off on the Codeship again and the deployment starts. Next time we will go into more detail about this part of our infrastructure, how we deploy to our staging app, test our migrations, build our deployment pipelines and then push to production several times a day.

Your Development Workflow
How are you working? We would love to hear about it in the comments. Let us know if you have any questions or suggestions to our workflow. Your feedback is always appreciated!

Ship long and prosper.

Further info

More Stories By Manuel Weiss

I am the cofounder of Codeship – a hosted Continuous Integration and Deployment platform for web applications. On the Codeship blog we love to write about Software Testing, Continuos Integration and Deployment. Also check out our weekly screencast series 'Testing Tuesday'!

IoT & Smart Cities Stories
The platform combines the strengths of Singtel's extensive, intelligent network capabilities with Microsoft's cloud expertise to create a unique solution that sets new standards for IoT applications," said Mr Diomedes Kastanis, Head of IoT at Singtel. "Our solution provides speed, transparency and flexibility, paving the way for a more pervasive use of IoT to accelerate enterprises' digitalisation efforts. AI-powered intelligent connectivity over Microsoft Azure will be the fastest connected pat...
There are many examples of disruption in consumer space – Uber disrupting the cab industry, Airbnb disrupting the hospitality industry and so on; but have you wondered who is disrupting support and operations? AISERA helps make businesses and customers successful by offering consumer-like user experience for support and operations. We have built the world’s first AI-driven IT / HR / Cloud / Customer Support and Operations solution.
Codete accelerates their clients growth through technological expertise and experience. Codite team works with organizations to meet the challenges that digitalization presents. Their clients include digital start-ups as well as established enterprises in the IT industry. To stay competitive in a highly innovative IT industry, strong R&D departments and bold spin-off initiatives is a must. Codete Data Science and Software Architects teams help corporate clients to stay up to date with the mod...
At CloudEXPO Silicon Valley, June 24-26, 2019, Digital Transformation (DX) is a major focus with expanded DevOpsSUMMIT and FinTechEXPO programs within the DXWorldEXPO agenda. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive over the long term. A total of 88% of Fortune 500 companies from a generation ago are now out of business. Only 12% still survive. Similar percentages are found throug...
Druva is the global leader in Cloud Data Protection and Management, delivering the industry's first data management-as-a-service solution that aggregates data from endpoints, servers and cloud applications and leverages the public cloud to offer a single pane of glass to enable data protection, governance and intelligence-dramatically increasing the availability and visibility of business critical information, while reducing the risk, cost and complexity of managing and protecting it. Druva's...
BMC has unmatched experience in IT management, supporting 92 of the Forbes Global 100, and earning recognition as an ITSM Gartner Magic Quadrant Leader for five years running. Our solutions offer speed, agility, and efficiency to tackle business challenges in the areas of service management, automation, operations, and the mainframe.
The Jevons Paradox suggests that when technological advances increase efficiency of a resource, it results in an overall increase in consumption. Writing on the increased use of coal as a result of technological improvements, 19th-century economist William Stanley Jevons found that these improvements led to the development of new ways to utilize coal. In his session at 19th Cloud Expo, Mark Thiele, Chief Strategy Officer for Apcera, compared the Jevons Paradox to modern-day enterprise IT, examin...
With 10 simultaneous tracks, keynotes, general sessions and targeted breakout classes, @CloudEXPO and DXWorldEXPO are two of the most important technology events of the year. Since its launch over eight years ago, @CloudEXPO and DXWorldEXPO have presented a rock star faculty as well as showcased hundreds of sponsors and exhibitors! In this blog post, we provide 7 tips on how, as part of our world-class faculty, you can deliver one of the most popular sessions at our events. But before reading...
DSR is a supplier of project management, consultancy services and IT solutions that increase effectiveness of a company's operations in the production sector. The company combines in-depth knowledge of international companies with expert knowledge utilising IT tools that support manufacturing and distribution processes. DSR ensures optimization and integration of internal processes which is necessary for companies to grow rapidly. The rapid growth is possible thanks, to specialized services an...
At CloudEXPO Silicon Valley, June 24-26, 2019, Digital Transformation (DX) is a major focus with expanded DevOpsSUMMIT and FinTechEXPO programs within the DXWorldEXPO agenda. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive over the long term. A total of 88% of Fortune 500 companies from a generation ago are now out of business. Only 12% still survive. Similar percentages are found throug...