0
votes

So while this is completely do-able (albeit using some fairly fancy scripting) in Jenkins, I'm just wondering if it's do-able in VSTS.

I'm not too familiar with capabilities of VSTS (have read https://docs.microsoft.com/en-us/vsts/build-release/actions/ci-build-git).

I want all changes pushed from a feature branch to master to be automatically merged into all other active feature branches. So basically, I want (what I call) true CI. Is this possible in VSTS, and if so, how would I do it?

EDIT 1:

Read this: https://docs.microsoft.com/en-us/vsts/build-release/actions/scripts/git-commands#merge-a-feature-branch-to-master

This would work for me by simply switching the merge direction; instead of merging from feature branch to master, merge from master to feature branch.

So the question now becomes:

How to get a list of all active child branches?

Given that I'll be using work items mapped to branches, would this suffice?

https://docs.microsoft.com/en-us/vsts/report/extend-analytics/work-item-links

1
I wouldn't call this CI, I'd call this a well-intentioned, but ill-fated plan. The big problem with this is dealing with merge-conflicts, and the fact you can't automatically resolve these without stomping on someone's changes. Merge Conflicts are meant to be resolved by the developers creating the conflicts. - raterus
I'm sure this is not supported out of the box in VSTS. - Yan Sklyarenko
@raterus It's most definitely Continuous Integration and in-fact addresses one of the primary objectives of CI; which is the 'I' (Integration) part, by the very definition of the word Integration. It's just short-sightedness that most people only look at CI from the 'C' part and think that they are doing CI as long as they are making many commits; sure, that helps, but pointless if your changes won't actually integrate, because someone else has already changed what you think you are changing. - Ash
@raterus And merge conflicts, are well-intentioned avoidables but an ill-fated reality. No more than one dev in a large team making changes to the same file? Good luck! What this process I've described does is allow devs to address conflicts sooner rather than later. Any dev (at least among ones that have been to battle) will agree that the time taken to fix conflicts are more of an exponential function of the number of conflicts, rather a linear one. - Ash
@raterus Furthermore, I should mention that I don't intend on doing any 'auto' resolution if that's what you are picturing. If a merge from a parent to child would cause conflicts, it's not performed and the relevant dev(s) notified to take action (sooner rather than later). - Ash

1 Answers

0
votes

No, it is not supported in VSTS, with Pull Request it just can merge source branch to a target branch.

The workaround is that you can create the Pull Requests for related branches during the build/release, refer to this thread for detail steps:

How can I create a Pull Request when a release completes in VSTS?

Update:

The other way is calling git command to merge branches: Merge a feature branch to master

Regarding active branch, as we discussed, you can link them to a work item, the work item has the TO DO, In Progress etc... states that can identify different "state" of branches, and you can retrieve the work item through Work Item REST API.