Details
-
Bug
-
Resolution: Fixed
-
Low
-
5.12.3.1
-
Severity 3 - Minor
-
Description
Problem
New plan branch is automatically deleted due to last commit date from the newly created branch. UI is not clear about the strategy Bamboo will use to expire the plan branch. The branch is new but its last commit is old.
Steps to reproduce:
- Make sure Bamboo is configured with application links to Bitbucket server
- Make sure Admin REST API is enabled with system property -Datlassian.darkfeature.bamboo.experimental.rest.admin.enabled=true
- Create a plan with a repository that has old commits
- Configure the branch management to create the plan branch automatically. Make sure the "Delete plan branches after a period of inactivity" is set for 7 days
- Navigate to your repository and create a checkout an old revision (let's say 2 weeks old - need to be older than a 7 days)
git checkout eeb81d64e94f44f399212d5d4fc2eb5f0622208f
- Create a new branch from it
git checkout -b newbranch git push origin newbranch
- Wait until the plan branch is created in Bamboo (usually 5min with application links configured)
- Run the branch expiry job
curl -u <admin_user> -p -H "Content-Type: application/json" -X POST -d '{"name":"branchExpiryJob", "groupName":"branchExpiryGroup"}' 'http://localhost:8085/rest/admin/latest/scheduler/jobs/trigger'
Expected results:
The branch was just created and from the UI perspective it is fairly new and should not be expired before the 7 days of inactivity
Actual results:
The plan branch newbranch is expired
Suggestions for resolution:
- Store the branch creation date (instead of last commit date) if this information is available and use this new date until a commit newer than this date is added to the branch OR
- Update the UI in such a way that the expiry strategy (considering commit date) is more clear to end users