Drone: trigger should handle skipped dependencies

Created on 24 Mar 2019  路  4Comments  路  Source: drone/drone

Scenario:
Multiple pipelines with dependencies:

kind: pipeline
name: testing

steps:
- name: test

---
kind: pipeline
name: build

steps:
- name: build

depends_on: testing

---
kind: pipeline
name: notification

steps:
- name: notify

depends_on: build
trigger:
  status:
  - success
  - failure

This pipeline will run forever (till manual killing) if testing pipeline failed. As result, of failing testing pipeline build pipeline will be skipped and notifications will stay in waiting on dependencies.

I try to add - skipped or - skip to the pipeline trigger, but this seems not to work. Sometimes e.g. for notification tasks it would be nice to have an option to always run a pipeline/task maybe something like

trigger:
  status: always

Here is a currently running demo: https://cloud.drone.io/xoxys/drone-webhook/5

Most helpful comment

work in progress in branch issue/2634. I have this partially solved. Drone correctly handles when the first stage in the dependency chain is skipped. It does not yet handle the situation where a dependency in the middle of the dependency chain is skipped.

All 4 comments

work in progress in branch issue/2634. I have this partially solved. Drone correctly handles when the first stage in the dependency chain is skipped. It does not yet handle the situation where a dependency in the middle of the dependency chain is skipped.

This seems to be fixed based on unit testing and local testing, but we can leave this open for a few days so that we have time to verify.

There is still an edge case that is not accounted for, and will require a subsequent fix. In the below example, if we skip the first pipeline, the second pipeline will be executed immediately even though the state is on failure and the pipeline status is success. This edge case is not something I would expect anyone to encounter, however, it should still be fixed. Because few people will encounter this edge case, it will be relatively low priority as I focus on other items. I will create a dedicated issue for the edge case prior to closing this issue.

kind: pipeline
name: foo
steps:
- name: foo
  image: alpine:3.8
trigger:
  branch: [ some-fake-branch ]
---
kind: pipeline
name: bar
steps:
- name: bar
  image: alpine:3.8
trigger:
  status: [ failure ]
depends_on: [ foo ]

created separate issue for edge case described above. https://github.com/drone/drone/issues/2683

Will test it after v1.1.0 was tagged

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bradrydzewski picture bradrydzewski  路  4Comments

bradrydzewski picture bradrydzewski  路  6Comments

jpillora picture jpillora  路  6Comments

sheerun picture sheerun  路  5Comments

bradrydzewski picture bradrydzewski  路  5Comments