It seems that the Software Factory doesn't handle deleted objects well in branches that are kept open after merging (tested in SF 2023.1). This is demonstrated with the following scenario:
- Create branch DEVELOP (from MAIN)
- Add column X in branch DEVELOP
- Merge DEVELOP back to MAIN and keep the branch open
- Delete column X in branch DEVELOP
- Merge DEVELOP back to MAIN
The result in the MAIN with this scenario is that column X still exists in the MAIN after step 5. We assume at step 5 the SF makes a delta from the starting point of the branch with the current state of the MAIN and the current state of the branch and determines that column X was added in the MAIN after creating the branch. However, this is not the result that we want/expect (Column X should not exist in the MAIN after step 5).
When the scenario is changed to:
- Create branch DEVELOP (from MAIN)
- Add column X in branch DEVELOP
- Merge DEVELOP back to MAIN (make the branch inactive)
- Create branch DEVELOP_2 from MAIN
- Delete column X in branch DEVELOP_2
- Merge DEVELOP_2 back to MAIN
The result is that column X doesn't exists in the MAIN after step 6 (as expected).
So based on these scenario's one could say that it is always better to create a new branch after merging over keeping the branch open and continue working with it. However this is not possible when there are existing sub-branches of the DEVELOP branch (for example FEATURE branches). These FEATURE branches would require the original branch of which they origin to keep existing in order to be merged back. This approach was suggested in:
So to cope with this, we executed the following scenario:
- Create branch DEVELOP (from MAIN)
- Add column X in branch DEVELOP
- Merge DEVELOP back to MAIN and keep the branch open
- Merge MAIN back to DEVELOP
- Delete column X in branch DEVELOP
- Merge DEVELOP back to MAIN
The result is that column X doesn't exists in the MAIN after step 6 (as expected). The result is different than the first scenario because the SF updated the origin model version to the point in time of step 4.
So our conclusion is that when you leave a branch open to continue after a merge, one should always merge back into it to update the point in time of the origin model version.
This is not something that every developer will probably think of when executing a merge session. Therefor we suggest that the execute merge session task starts a new merge session back into the branch when ‘Deactivate branch’ is not selected. Of course there should be a tooltip explaining why this is happening (or another checkbox could be added to start the merge session so the user still has a choice). If there are no open conflicts in the new merge session it could even execute that merge session directly.
Of course we hope that Thinkwise will be able to come up with an even better solution, because always having to merge back makes the process quite tedious.