StackStorm / StackStorm/st2

Support YAML anchors

Open
#5,370 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stale
Dominant language
Python
Stars
6.5k
Forks
787
PR merge metrics
No merged PRs in 30d

Description

---
version: 1.0
description: Deploy staging application
.definitions:
  action_succeeded: &action_succeeded
    - task_message: "<% ctx('environment') %> deploy <% task().task_name %> :white_check_mark:"
 
  someaction:
    action: core.noop
    retry:
      count: 3
      delay: 60
    next:
      - when: <% succeeded() %>
        publish: *action_succeeded
        do:
          - notify_slack
      - when: <% failed() %>
        publish:
          - task_message: "<% ctx('environment') %> deploy <% task().task_name %> :boom:"
          - stderr: <% result().stderr %>
        do:
          - notify_slack
          - fail
...

However when I run the workflow I get:

{
  "errors": [
    {
      "message": "Additional properties are not allowed ('.definitions' was unexpected)",
      "spec_path": null,
      "schema_path": "additionalProperties",
      "type": "syntax"
    }
  ],
  "output": null
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the example workflow and the reported validation error, then trace the workflow YAML validation path that rejects the .definitions key and YAML anchor reference. Done means the shown workflow is accepted and the anchored action_succeeded values are usable when the workflow runs, without the unexpected-property error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.