Bamboo CI Plugin: Enable plan branch filtering based on Plastic attributes.
The goal is to support testing and merging task branches to main when a given attribute is set. This way trunk-based development can be easily implemented.
The recommended configuration for a Bamboo plan is as follows:
* Branch to track in the Bamboo plan when configuring Plastic repo is "/main".
* Enable automatic plan branch creation ("when new branch in repository is created" option is OK).
* Enable automatic plan branch merging. Select the Gatekeeper strategy (with "push on successful" enabled, which means the resultant merge will be checked-in to /main on successful build).
* Do not enable the "After branch was deleted from repository" checkbox when configuring the plan branch.
* Enable the plan branch deletion for just a couple of days of branch inactivity ("After branch inactivity in repository" option). Once the branch is merged to /main, you shouldn't be working on it anymore (this way you will save disk space and Bamboo plan branches available, if limited).
* Enable repository polling to track new changes once the plan branch is created.
When configuring the Plastic repository for a Bamboo plan, a new checkbox named "Enable Plan Branch filtering" will appear.
Once it is enabled, a textbox allows filtering the candidate branches to create a new plan branch in Bamboo in two ways:
* Specifying an attribute name and value pair as follows: attribute_name=attribute_value. Example: status=resolved which means that only the branches with an attribute named "status" with the value "resolved" will be sent to Bamboo to create a plan branch.
* Specifying a complex query valid for "cm find branch" command (which is the underlying plastic command executed to retrieve the candidate branches). It is not mandatory to specify a plastic attribute in this mode. Two examples below:
where owner!='john_snow' and date > '3/2/2018'
where attribute='stage' and attrvalue='done' and name like 'JIRA-%'
* Remember to create the Plastic attribute and apply the desired value (manually or through an external trigger) to the branches that you want to be built and merged by Bamboo.
* Find more info about Plastic attributes here