1
votes

Azure DevOps Release pipeline artifact settings has 2 options:

  1. Continuous deployment trigger - Enabling the trigger will create a new release every time a new build is available.
  2. Pull request trigger - Enabling this will create a release every time a selected artifact is available as part of a pull request workflow

I am trying to understand what is the difference between these options with respect to the highlighted parts and whether the build validation policy causes release to trigger with both options, if so then why do we have pull request trigger?

3

3 Answers

2
votes

In my opinion, these two triggers have different working scope.

Assuming we set one CI build as release artifact, according to my test:

1.Continuous deployment trigger:

Whenever we have a new version of the Build, it triggers the release. It means that no matter the build pipeline is triggered by manual run, CI trigger or build validation in branch policy, the release is triggered when there's one newer build.

2.Pull request trigger:

It has a smaller scope, it will be trigger by the build pipeline which is trigger by build validation in branch policy.

(Which is triggered by PR, so if we create new PR=>It triggers PR build=>It triggers PR release)

Feel free to correct me if I misunderstand anything.

Update1:

Here's one pic about my two tests:

enter image description here

Release-8 is triggered by my manual running Build pipeline with only CD triggered enabled. And Release-7 is triggered by PR build with only PR triggered enabled. (I only enable the Pull Request for deployment in Stage 1)

Apart from working scope, these two triggers also have a little difference here. The Pull Request Deployment in stage for now is only for PR trigger in Artifact.

1
votes

This explains that very well (taken from documentation):

Pull requests (PRs) provide an effective way to have code reviewed before it is merged to the codebase. However, certain issues can be tricky to find until the code is built and deployed to an environment. Before the introduction of pull request release triggers, when a PR was raised, you could trigger a build, but not a deployment. Pull request triggers enable you to create pull request releases that deploy your PR code or PR builds to detect deployment issues before the code changes are merged. You can use pull request triggers with code hosted on Azure Repos or GitHub.

New build basically means that your pipeline was executed.

Creating pull request trigger you need to define an artifact which will be later deployed. For this kind of trigger Azure Devops runs your pipeline and produce artifact according to your pipeline/build definition and later use this artifact for deployment.

Both trigger are similar, the difference is when your code will be deployed before or after being merged into main branch.

0
votes

PR trigger is part of CI - applies when your merge your branch to master

CD trigger - applies only to the master branch