0

We have our release pipelines configured with multiple stages. For each pull request that gets merged into master, a new release is created automatically. We have DEV => TST => REL => PRD.

Now, we also use those stages to execute automated tests. So there is a stage after DEV to do some basic automated testing (AT). So we end up with DEV => AT => TST => REL => PRD. AT has a dependency on DEV to run without failure.

Screenshot of our release pipeline

Our problem is the following. When a Release X is executing AT and in the meantime a pull request gets merged resulting in a deployment to DEV for Release X+1, this causes the AT for Release X to fail. Is there a way to make Release X+1 wait in the queue until AT is done for Release X?

We can maybe also solve this by avoiding downtime on DEV during deployment, or isolate the tests on an environment that is not affected by automated deployments etc. But based on what we have, and the time we have available to improve this we would like to know if there is a way to make instances of a pipeline a bit more aware of each other...

BenSav
  • 3
  • 1
  • How about the issue? Does the answer below resolved your question, If yes, you could [Accept it as an Answer](https://meta.stackexchange.com/a/5235/515442) , so it could help other community members who get the same issues and we could archive this thread, thanks. – LoLance Aug 11 '20 at 09:02

1 Answers1

0

But based on what we have, and the time we have available to improve this we would like to know if there is a way to make instances of a pipeline a bit more aware of each other...

Sorry but I'm afraid we don't have such out-of-box feature for now.

Here's one discussion about similar topic, you can track it and comment there to share your feedback. (Since that one is for build pipeline instead of for release, you can post a new feature request for release pipeline)

enter image description here

And as a temporary workaround:

You can move the steps in your AT stage into DEV stage. Create agent job AT and move the content of AT stage into AT job in DEV stage, and make sure you disable the parallel stage-deployment in the Deployment queue settings under Pre-deployment conditions:

enter image description here

This setting can work for stage-level but not release-level. So it only works when you move the content in stage AT into DEV stage. (You may also get hints from this similar issue)

To call azure devops rest api in Gates:

1.Create a Generic service connection:

Url: https://vsrm.dev.azure.com/OrgName/ProjectName/_apis/release/releases/3?api-version=5.1

Leave username and password blank.

2.Change the default "AuthToken": "$(system.AccessToken)" to "Authorization": "Bearer $(System.AccessToken)".

enter image description here

Then the rest api will be executed with the token from current context.

LoLance
  • 25,666
  • 1
  • 39
  • 73
  • In the meantime I was trying to have a gate on the trigger to `DEV` to invoke the azure devops api to check whether there is an instance of the `AT` in progress. The api provides this ability, and I can call it using a personal access token, but I don't seem to be able to do that with a service connection... Would it be possible to get this to work? – BenSav Aug 07 '20 at 11:14
  • @BenSav Can my update helps to resolve how to call rest api? If my answer helps, please [accept it as answer](https://meta.stackexchange.com/a/5235/515442). So it could help other community members who get the same issues and we could archive this thread, thanks. – LoLance Aug 10 '20 at 10:37