We currently have the following branch strategy:
Develop > Release > Master
Devs create a local branch from Develop, make changes merge to develop. Our dev environment builds off that branch. When they want their changes tested they push to QA environment, which also uses the Develop branch. This cycle goes on until functional testing for the iteration is done. At that point the code is merged into the Release branch and is deployed through staging and then to prod. After deploying to prod the code should be merged to Master, but it's often forgotten about. This causes problems in niche scenarios.
Is there a way to use perhaps devops pipelines to conditionally raise a PR automatically? So I'm thinking this would need 2 PRs:
- PR raised for Master branch after successful release to prod. Idea here would be once sign off has been granted someone from the team can just approve.
- PR raised for Develop branch if the first PR is approved and the code in Master now differs from Develop. In a lot of cases it won't as therefore wouldn't need a PR.
I've been googling for this and found the api methods like this but I can't see how you could put this in a pipeline and make it conditional.
Additional Info:
My understanding is that the build definition needs to know what branch to build as per the image below. So, creating a new release branch every sprint would either result in having to update the build definition every time or creating a new build definition, that essentially would be a complete replica in most cases except for the branch name. Unless I'm misunderstanding, which I think I am.
release
back tomaster
after that release is done? – Ian Kemprelease
branch? That defeats the entire purpose. Make a newrelease-<version>
branch offmaster
at the beginning of each new sprint (i.e. it will contain the previous sprint's work), put whatever hotfixes in there that need to go for that release as they come along during the sprint, and merge it back tomaster
at the end of that sprint - then wash, rinse, repeat. You can easily write astart-new-sprint
to automate this. – Ian Kempresources
to specify which branch the pipeline will run on without updating the pipeline. – Jane Ma-MSFT