Workflow overview

Warning

Workflow is a technology preview feature and is disabled by default.

A workflow can be applied to a projectIn Helix Swarm, a group of Helix Server users who are working together on a specific codebase, defined by one or more branches of code, along with options for a job filter, automated test integration, and automated deployment. or project branch to ensure that changelists and code reviews in the project/branch follow the rules specified in that workflow. The Workflow basics section gives an overview of global workflow rules, workflow rules and how they interact with each other. There are also examples of different workflows and examples of what happens when a changelist spans multiple projects or project branches that have different workflows.

Workflow rules

A workflow is made up of the following workflow rules:

On commit without a review:

This rule is applied when a changelist without an associated review is submitted from outside of Swarm.

Select one of the following options:

On commit with a review: This rule is applied when:

Select one of the following options:

On update of a review in an end state:

Used to stop review content being changed for reviews that are in specific states. By default, the protected end states are Archived, Rejected, and Approve:Commit. The end states are set by the Swarm administrator, see end_states.

This rule is applied when a changelist is added to a review.

Select one of the following options

Count votes up from:

By default, all of the up votes on a review are counted for the Minimum up votes value set on the project/branch the review is associated with. Limit the up votes that are counted to just the members of the project the review is associated with by using this rule.

This rule is applied when a user votes on a review.

Select one of the following options:

Tip

For instructions on how to set Minimum up votes for projects and branches, see Project minimum up votes and Branch minimum up votes.

Automatically approve reviews:

By default, reviews must be manually approved. Enable automatic approval of reviews with this rule.

This rule is applied when a user votes on a review, a required reviewer is added to a review, or a required reviewer is made an optional reviewer on a review.

Select one of the following options:

For information about creating a new workflow, see Add a workflow.

Workflow basics

Example workflows

This section contains examples of typical workflows that can be configured in Swarm.

Enforce a pre-commit review workflow

To enforce a pre-commit review workflow set the rules to:

Allow a post-commit review workflow

To allow a post-commit review workflow set the rules to:

Restrictive project workflow with a less restrictive development branch workflow

The release and main branches need a restrictive workflow to protect the codelines. All submissions must have an associated approved review and the content of the changelist must be identical to the content of the approved review.

The development branch can be less restrictive because you want to get features in quickly and review them after they have been committed. In this scenario you would probably want to ensure that all submitted changelists have an associated review.

Project workflow:

Development branch workflow:

Project workflow with a more restrictive release branch workflow

The project is set up with workflow that allows post commit reviews, this allows you to get features in quickly and review them after they have been committed. In this scenario it is a good idea make all submitted changelists have an associated review.

The release branch needs a more restrictive workflow to protect the codeline. All submissions must have an associated approved review and the content of the changelist must be identical to the content of the approved review.

Project workflow: defines the workflow for the project and its branches.

Release branch workflow: defines the workflow for the release branch. The workflow of the parent project is ignored and the development branch workflow is used.

Merging multiple workflows

If a changelist spans multiple projects that have different workflows, the workflows are merged and the most restrictive workflow rules are used for the changelist.

Example 1: Changelist 1234 spans Project A, Project B, and Project C

The files span all three locations so the changelist is subject to the combined workflow rules for the three locations. The most restrictive workflow is used for the changelist:

  Changelist without a review Changelist with a review On update of a review in an end state Count votes up from Automatically approve reviews
Project A workflow Allow Reject unless approved Allow Anyone Based on vote count
Project B workflow Allow Reject unless approved Reject Members Never
Project C workflow Create a review Allow Allow Anyone Based on vote count
Changelist 1234 workflow Create a review Reject unless approved Reject Members Never
Tip

The three workflows are combined and the most restrictive workflow rules are used for the changelist.

Example 2: Changelist 6789 spans Project M, Project N, and Project branch N-1

The changelist files span all three locations so the changelist is subject to the combined workflow rules for the three locations. The most restrictive workflow is used for the changelist:

  Changelist without a review Changelist with a review On update of a review in an end state Count votes up from Automatically approve reviews
Project M workflow Create a review Reject unless approved Allow Anyone Never
Project N workflow Reject Reject unless approved Reject Members Never
Project branch N-1 workflow Create a review Allow Allow Anyone Based on vote count
Changelist 6789 workflow Create a review Reject unless approved Allow Anyone Never
Tip

It is important to understand that the rules for Project N are ignored because Project branch N-1 is a branch of Project N and it has its own workflow rules. This is why the result for Changelist without a review is Create review, the result for On update of a review in an end state is Allow, and the result for Count votes up from is Anyone.

Example 3: Changelist 3456 spans Project X, and Project Y

The changelist files span both locations so the changelist is subject to the combined workflow rules for the two locations, and the global workflow rules set by the administrator. The most restrictive workflow is used for the changelist:

  Changelist without a review Changelist with a review On update of a review in an end state Count votes up from Automatically approve reviews
Project X workflow Create a review Allow Allow Anyone Based on vote count
Project Y workflow Reject Allow Reject Anyone Based on vote count
Global workflow rules Create a review (policy mode) Reject unless approved (default mode) Allow (policy mode) Members (policy mode) Never (default mode)
Changelist 3456 workflow Reject Allow Reject Members Based on vote count
Tip