Skip to content

Document that jobs can have on_failure / on_success too #2020

Closed

Description

@JohannesRudolph

A Modest Proposal

I'd appreciate if there was more documentation around the behavior of on_failure. Add the fact that inconsistent indents are a source of confusion, I can for example write these two jobs:

name: unit-2.4-postgres
plan:
  - get: bosh-src
    trigger: true
  - aggregate:
    - task: test-postgres-9.3
      timeout: 2h
    on_failure:
      <<: *slack-alert

vs.

name: unit-2.4-postgres
plan:
  - get: bosh-src
    trigger: true
  - aggregate:
    - task: test-postgres-9.3
      timeout: 2h
on_failure:
    <<: *slack-alert

Do they do the same thing? The on_failure step in the first example is attached to the aggregate step, while in the second example it's attached to the job itself. Both appear to work and behave in the same way. So what's missing from the docs (up for discussion, hence this issue):

  • how does on_failure behave if a task above the immediate parent fails? i.e. how do failures cascade throughout a plan?
  • it's not documented anywhere that attaching on_failure to a job works (but it's desirable, as it makes it clear, to trigger the on_failure if any task in the job fails).

Activity

  1. JohannesRudolph commented on Feb 9, 2018

    @JohannesRudolph
    ContributorAuthor
  2. wagdav commented on Feb 20, 2019

    @wagdav
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions