buildkite / feedback

Got feedback? Please let us know!
https://buildkite.com
25 stars 24 forks source link

Strange behaviour when combining depends_on with allow_dependency_failure #521

Open grahamegee opened 4 years ago

grahamegee commented 4 years ago

I have produced the following, cut down, example pipline.yml, to reproduce the strange behavior.

steps:                                                                          
  - name: 'Faily dependency'                                                    
    key: dep-0                                                                  
    command: 'exit 1'                                                           

  - name: "Doesn't run"                                                         
    key: dep-1                                                                  
    command: echo "I don't run because the step I depend on Failed"             
    depends_on: dep-0                                                           

  - name: "I Don't run because the step I depend on's dependency failed"        
    key: dep-2                                                                  
    command: echo 'I don't run because my dependencies, dependency failed'                                           
    depends_on: dep-1                                                           

  - name: "I should not run, because the step I depend on didn't run"           
    command: echo 'Why am I running?'                                           
    depends_on: dep-2                                                           
    allow_dependency_failure: true

Expected behaviour

only the first step should run, because:

Actual behaviour

The first step and the final step both run.

From the docs:

You can add the allow_dependency_failure attribute to any step that has dependencies. The step will then run when the depended-on jobs complete, even if those jobs have failed

In my case the depended-on job never ran. I wonder if my dep-2 is getting treated as excluded, so my final step ends up ignoring it's dependency?

Screen shot of run pipeline

buildkite_bug