The company I’m at is investigating whether we can migrate from classic Azure DevOps Builds and Releases towards YAML Pipelines. Using these pipelines we want to deploy to four four different environments (dev, test, acc, prod). On a regular basis we need to validate a feature that has not made it into the main branch, i.e. we deploy a feature branch to dev and/or test. Whenever the main branch is updated, the latest version of main is automatically deployed to dev and test, which is problematic when we’re in the process of testing the feature branch. Our solution with the classic pipelines is to temporary add a pre-deploy approval.
YAML pipelines do not have pre- and post-approvals, instead one has to add an approval to an environment. This has been asked and answered on SO. In our company, that has a major drawback: We have 10-20 pipelines that continuously deploy to dev and test, and by adding an approval to the dev environment for the sake of testing a single application, we halt ALL deployments to dev. Manually approving the the deployments of applications that do not interfere with the ongoing test activities is tedious at best.
Recently I discovered the task ManualValidation@0, which might present a solution to the aforementioned problem, but it too comes with some challenges. The manual validation should on default be skipped, only to be activated when some environmental variable or variable from a Library is set. Also, the step has to be added to each YAML pipeline making them bloated. Before continuing on that path, I wonder whether others have come up with a better solution.