Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trigger should handle skipped dependencies #2634

Closed
xoxys opened this issue Mar 24, 2019 · 4 comments
Closed

trigger should handle skipped dependencies #2634

xoxys opened this issue Mar 24, 2019 · 4 comments
Milestone

Comments

@xoxys
Copy link

xoxys commented Mar 24, 2019

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

@bradrydzewski bradrydzewski added this to the v1.1.0 milestone Apr 11, 2019
@bradrydzewski
Copy link
Contributor

bradrydzewski commented Apr 20, 2019

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.

bradrydzewski added a commit that referenced this issue Apr 21, 2019
@bradrydzewski
Copy link
Contributor

bradrydzewski commented Apr 21, 2019

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 ]

@bradrydzewski
Copy link
Contributor

created separate issue for edge case described above. #2683

@xoxys
Copy link
Author

xoxys commented Apr 23, 2019

Will test it after v1.1.0 was tagged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants