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.
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:
The selected rule is also applied when a changelist is submitted with #review
in the description. For more information about creating a review by including a keyword in the changelist description, see Create a review.
On commit with a review: This rule is applied when:
Select one of the following options:
The selected rule is also applied when a changelist is submitted with #review-nnnnn
, #replace-nnnnn
, or #append-nnnnn
in the description (nnnnn
= review ID). For more information about adding a changelist to a review by including a keyword in the changelist description, see Add a changelist to a review.
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
end_state
configurable:#review-nnnnn
, #replace-nnnnn
, or #append-nnnnn
in the description (nnnnn
= review ID).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:
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:
Moderators prevent the automatic approval of reviews. For more information about moderators, see Moderators.
After a review has been automatically approved it needs to be manually committed.
For information about creating a new workflow, see Add a workflow.
default
mode and that rule is modified, projects and branches that do not have an associated workflow will use the modified rule. policy
mode and the rule is modified, the entire Helix Core Server will use the modified rule.This section contains examples of typical workflows that can be configured in Swarm.
To enforce a pre-commit review workflow set the rules to:
To allow a post-commit review workflow set the rules to:
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:
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.
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.
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 |
The three workflows are combined and the most restrictive workflow rules are used for the changelist.
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 |
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.
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 |
default
mode, the rule is only used if the project/branch does not have an associated workflow. If the project/branch has an associated workflow, the global rule setting is ignored. This is why the result for the Changelist with a review rule is Allow, and the Automatically approve reviews is Based on vote count. policy
mode, the rule is merged with project/branch workflow and the most restrictive rule setting is used. This is why the result for the Changelist with a review rule is Reject, the result for the On Update of a review in an end state rule is Reject, and the result for Count votes up from is Members.