Features

Custom Workflows for semi-automated code review

At JetBrains, we make a lot of effort to help reduce the amount of boilerplate work that our users have to deal with. Even though code review is a process requiring human’s attention, there’s still room for automation. A brand new feature in the latest major release is aimed to take responsibility for routine tasks, which a code review process involves, and it’s called “Custom Workflows”.

Basically, a custom workflow is a list of triggers related to a specific action. Each trigger consists of criteria and properties. When the criteria are met, the action with the corresponding properties is performed automatically.

Since version 3.0, Upsource supports two different types of workflow – creation of reviews and assignment of review participants. Let’s see what each one is useful for.

custom-workflows-1

Let’s say, we have a team where Ronald Whibley Jr. is a junior developer. He doesn’t have much experience, and the project lead Terrence Silverman wants to personally review all of his changes being made in the release branch. This is easy to set up by adding the first trigger of “create reviews automatically” workflow shown in the picture.

Also, there is a practice in this team to store release notes right in the repository, and a dedicated specialist Sofia Ivanova needs to proofread them when any changes are made to these notes. The second trigger of “create reviews automatically” workflow in the picture shows a way to automate such task.

custom-workflows-0

Imagine a codebase having a module called “service-daemon”, where files are modified frequently. There’s no need to review every commit containing these files, and the team members tend to create reviews manually, on important revisions only. However, there are certain people in the project responsible for this specific module, so when a review is created it’s always a couple of them that are assigned. To eliminate the need to manually collect reviewers each time, the trigger of “assign review participants automatically” workflow shown in the picture may be added.

Triggers of both types also work well when combined. Thus, if you want to achieve a complex assignment scenario along with auto-creation of reviews, you are welcome to set it up.

There are plenty of use cases where custom workflows may help – it always depends on a team which ones are to be encountered. We continue working on this feature to provide you even more abilities of automating common things, as well as to make existing ones more flexible.