Skip to content

Add an ignored 'references' top-level key to allow for yaml placeholder usage #101

Description

@PeterJCLaw

Routemaster configs can get quite verbose and repetitive. It would be great to be able to convert something like this:

states:
- gate: first
  triggers:
    - time: 17h30m
      timezone: metadata.timezone
    - event: entry # for debug
  exit_condition: 12h has passed since history.entered_state or metadata.debug
  next: second

- gate: second
  triggers:
    - time: 17h30m
      timezone: metadata.timezone
    - event: entry # for debug
  exit_condition: 12h has passed since history.entered_state or metadata.debug
  next: third

into this

references:
  wait-one-day: &wait-one-day
    triggers:
      - time: 17h30m
        timezone: metadata.timezone
      - event: entry # for debug
    exit_condition: 12h has passed since history.entered_state or metadata.debug

states:
- gate: first
  <<: *wait-one-day
  next: second

- gate: second
  <<: *wait-one-day
  next: third

However I believe at the moment the config schema validation would reject this.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions