-
Suggestion
-
Resolution: Unresolved
-
None
-
None
-
5
-
11
-
Problem Definition
Plan Branch creation via Pull Request can result in Plan Branches with duplicate names which can create confusion.
The problem can be reproduced as such: Navigate to the Plan Configuration page >> Create Plan Branch strategy set to Pull Request (PR) by checking feature "When pull request is created". This creates a new Plan Branch each time a new PR is issued by an autorized Bamboo user.
For example (gitflow): A first PR creates Plan Branch "develop" in a Git repository. If this PR is not yet closed and another Bamboo user issues a new PR, a new Plan Branch is created, now with name "develop1". If none of the previous PRs gets closed and a new PR is issue, a third Plan Branch gets created with name "develop2". And so on. All of these refere to the same Git repos branch "develop".
None of these PRs will ever be cleaned / expired, as develop is a long lived branch with frequent activity and is never closed once the PR is merged. Gradually they build up and use disk space on an agent too.
Suggested Solution
- PR creates a new Plan Branch if none with that name is existing in the repository (so it's first on this branch). Thefrefore checking for an existing Plan Branch name is basic.
- If a PR on a repository branch is issued and a Plan Branch with the same name already exists, Bamboo should not create a new Plan Branch, but queue the new PR, wait till the original PR is closed and once closed, proceed by re-use of the existing Plan Branch (name)
- For the expiry/cleanup aspect, it might be helpful to have a separate criteria for PR removal (e.g. if the PR itself was merged/closed 5 days ago).
Workaround
None.