问题
During pull request my requirement is to set a branch policy so that I can pop up a custom dialog box which will ask the user if all systems tests were run on the incoming feature branch being merged. This will possibly be a free text or a radio button kind of interaction. Is it possible to do some such custom workflows during pull requests in Azure DevOps?
Thanks
回答1:
Is it possible to do some such custom workflows during pull requests in Azure DevOps?
Of course yes! We provide a custom method that you can apply your idea by using Azure Function
+ Azure Devops service hook
.
It's basic logic is write custom function scripts to achieve pop up a custom dialog box and this dialog box will ask the user some confirmation info. For Azure Function, we provide one feature which you can get its listen URL, and integrate it with any third party service, including Azure devops.
And get the listen URL of azure function, just go Azure devops project setting
-> Service Hooks
, create a service hook with this function URL.
The most important thing is choose a suitable trigger event based on your scenario conditions for azure function execution.
For detailed steps and description, check this doc: Use Azure Functions to create custom branch policies.
回答2:
I'm not sure this is doable at the moment but what you can do is run the tests immediately when the PR is created.
To do this create a CI Build pipeling for your master branch and add a Test task.
Then on the branch, set the Build Validation to your CI Pipeline
来源:https://stackoverflow.com/questions/59679053/pull-request-pop-up-a-confirmation-box