skip to Main Content

I’m a bit at a loss currently with pipeline triggers in azure piplines:

My pipelines keep triggering for individual CI whenever I commit to my pipeline experimentation branch my_pipeline_experiment_branch.

Screenshot from Run-History of Main

(Ignore that they’re all failing – that’s expected…)

This issue has started when I have introduced pipeline resource into another completely unrelated pipeline yaml.

This is part of the MAIN Pipeline YAML as example. I have specified trigger: none and pr: none for all pipelines where this occurs.
I’ve also tried the different combinations with the commented out triggers on the resources.

My expectation is that, this should disable all CI triggers for that pipeline.

Any idea what is going on here?
I’m starting to think I am going mad…

trigger: none
#  branches:
#    exclude: 
#      - '*'

pr: none ## added because i found that on a random stackoverflow answer, that this is by default enabled?!

pool:
  vmImage: ubuntu-latest

resources:
  repositories:
    - repository: my_repo
      type: git
      name: project/repo
      ref: feature/my_pipeline_exeperiment_branch # just for dev purposes... 
     # trigger: none
    - repository: central_repo
      type: git
      name: project2/central_repo
      ref: main
     # trigger: none

I have also tried pausing the pipelines via their settings… this is also ignored.

Edit:
added Screenshot of pipeline trigger configuration:
MAIN Triggers config

2

Answers


  1. Chosen as BEST ANSWER

    I appear to have solved it myself - and it's incredibly stupid:

    The issue at hand was that the main pipeline yaml had not been completely validated with the changed trigger setup (hence all the failed runs in screenshot). Once I had resolved these issues, the trigger configuration appears to have finally been accepted.

    So to note for someone with a similar issue: Make sure you had a version validated by Devops / without errors, that included the correct triggers. If you change the triggers and the validation fails, the triggers are not set correctly.

    Edit: I've been thinking about this and honestly, i find this a bit counter-intuitive: If something fails the YAML validation, it'll be executed as a CI-Trigger but eventually fail due to the validation issues. Somewhat strange.


  2. I believe the issue is your main branch still listens on the trigger on commit. Though you are committing your code to the experimental branch, unless you manually run the pipeline and select the source pipeline definition:

    enter image description here

    The pipeline definition will evaluate the main YAML definition of the pipeline for any trigger and/or include/exclude. You may want to leverage exclude on the main to preserve existing CI/CD workflows if the repo is being worked on through other branches.

     trigger:
      branches:
        include:
        - releases/*
        - main
        exclude:
        - topic/*
    

    I believe this is the closest for Microsoft documentation on this.
    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search