I'm trying to design a new workflow that follows these principles:
We are using git, Stash and TeamCity. This is what I have come up with, but none of them are perfect. I'm looking for tweaks to my suggestions, or new ideas.
WORKFLOW 1
When the pull request is approved by another developer, it is automatically merged into the mainline by Stash (mainline is covered by normal CI in TeamCity)
Problem: Stash will not perform the merge if there are merge conflicts, but the merged state is not tested at all until after the merge to mainline. We don't know if the mainline will break until it does.
WORKFLOW 2
When the pull request is approved by another developer, it is automatically merged into the mainline by Stash (mainline is covered by normal CI in TeamCity)
Problem: The time (20 min - 1 day?) between the merged state is tested and the integration happens allows changes in the integration branch which could mean the merged state no longer works. Chance that integration branch breaks.
WORKFLOW 3
When another developer approves and merges the pull request, feature/VHPC-1/review will be automatically built and tested in the merged state, and automerged to mainline on success
Problem: Twice the number of branches means some extra complexity and work.
WORKFLOW 4
If the automatic verification passes, TeamCity will approve the pull request. A human may then review, approve and merge it into the mainline.
Problem: TeamCity monitors refs/pull-requests/merge which changes when the integration branch changes, meaning a build would be triggered on all open pull requests when the integration branch gets one new change.
ex-Stash developer here. Just some general thoughts.
The Stash team (and most teams I've worked with and observed) do "optimistic" branch builds. That is they build the source branch under the assumption/hope that if it merges cleanly it probably won't break the mainline build. And in my experience this is almost always the case.
Some options:
I agree that in general building from Stash's hidden 'merge' ref, depending on how long your pull requests are open, is probably going to result in too many builds (as you pointed out).
Not sure if that helps?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With