Hi,
We're developing a VCS plugin for bamboo for Plastic SCM with plan branches + automatic merge support (Gatekeeper), but apparently we've been hit by a similar issue that Git already has. This issue prevents from implementing a Trunk Based Dev cycle with Bamboo and Gatekeeper workflow.
The scenario to reproduce my case is the following:
1- When bamboo starts, there are two plan branches ready, so bamboo queues both of them.
(Another equivalent and more realistic scenario is the following: plan branches are queued while another plan branch is running).
2- Once they are queued, bamboo creates two different workspaces (one per newly queued plan branch) to perform the source code checkout + merge from plan branch:
The checkout is performed using the last commit (vcsRevision in bamboo jargon) in the GateKeeper branch defined at this specific point in time, and the merges from the corresponding plan branch.
3- Let's suppose both merges are valid. Both workspaces remain stalled.
4- Then, bamboo picks the first plan branch and runs the build plan. The build plan creates ANOTHER workspace and re-runs the merge.
5- The build plan is successful, and bamboo commits the merged code created in step 2, the one where the merge was checked for this first plan branch.
6- Bamboo picks the second branch and runs the plan, creating ANOTHER workspace and re-running the merge.
7- The build is also succesful, and bamboo tries to commit the workspace created in step 2, the one where the merge was tested for this second plan branch.
8- But in this case, as there is another commit in the Gatekeeper branch coming from the first merged plan branch, the commit fails because we're not in HEAD anymore, ruining the build of the second branch.
(With the inconvenience also that the code built from this second plan branch is not the one merged from the latest HEAD available).
I saw there are still open tickets to workaround this issue and serialize the gatekeeper builds, but they are still opened... :
https://jira.atlassian.com/browse/BAM-12071\\ https://jira.atlassian.com/browse/BAM-14577\\
Any help about fixing/workarounding this issue would be appreciated.
Thanks,
- Jesús M.
PS: attached screenshot with a diagram of the faulty scenario for the second plan branch: