[WB] Invalid wb scheme

Bug #1428768 reported by Anastasia Kuznetsova on 2015-03-05
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Timur Sufiev

Bug Description

Current wb scheme generated by form is invalid, because name of some parameters or type is incorrect.
Here are example:

    name: Action 1
    base: std.echo
      "?": ""
      - name
      - type: string
        value: "Hello, <% $.name %>"

1) name: Action 1 - is redundant parameter, action name should be presented only once
2) baseInput:
      "?": ""
    Actual name of this parameter is "base-input" and should be possibility to change key name (now it is "?")
3) in output section it is not needed not write - type: string

Here can be found example of wb with usage of most of parameters: https://github.com/stackforge/mistral/blob/master/mistral/tests/unit/workbook/v2/test_dsl_specs_v2.py

Also below I will provide actual scheme for Mistral entities:

_schema = {
        "type": "object",
        "properties": {
            "version": {"type": "string"},
            "name": {"type": "string"},
            "description": {"type": "string"},
            "tags": {"type": "array"},
            "base": {"type": "string"},
            "base-input": {"type": "object"},
            "input": {"type": "array"},
            "output": {"type": ["string", "object", "array", "null"]},
        "required": ["version", "name", "base"],

_schema = {
        "type": "object",
        "properties": {
            "version": {"type": "string"},
            "name": {"type": "string"},
            "description": {"type": "string"},
            "tags": {"type": "array"},
            "type": {"enum": ["reverse", "direct"]},
            "task-defaults": {"type": "object"},
            "input": {"type": ["array", "null"]},
            "output": {"type": ["string", "object", "array", "null"]},
            "tasks": {"type": "object"},
        "required": ["version", "name", "tasks"],

_schema = {
        "type": "object",
        "properties": {
            "version": {"value": "2.0"},
            "name": {"type": "string"},
            "description": {"type": "string"},
            "tags": {"type": "array"},
            "actions": {"type": "object"},
            "workflows": {"type": "object"},
            "triggers": {"type": "object"}
        "required": ["name"],

All other specs for appropriate items can be found here: https://github.com/stackforge/mistral/tree/master/mistral/workbook/v2

Nikolay Makhotkin (nmakhotkin) wrote :

Yes, probably there camelCase is used but in Mistral - dash-case.

Also all generated YAML can be validated if you have mistral-server and python-mistralclient installed.
Simple wb-create command:

  mistral workbook-create <path-to-yaml.yaml>

Timur Sufiev (tsufiev-x) wrote :
Changed in merlin:
importance: Undecided → High
assignee: nobody → Timur Sufiev (tsufiev-x)
status: New → In Progress

Reviewed: https://review.openstack.org/167169
Committed: https://git.openstack.org/cgit/stackforge/merlin/commit/?id=c00a281adb4033385c42c2a100b2829f754bdc4f
Submitter: Jenkins
Branch: master

commit c00a281adb4033385c42c2a100b2829f754bdc4f
Author: Timur Sufiev <email address hidden>
Date: Tue Mar 24 14:08:34 2015 +0300

    Fix the Workbook schema to conform the one expected by Mistral

    Override toJSON() method for some classes inside Workbook since it
    makes things simpler.

    Change-Id: Ia92597b3739e2e58e2e7d15c01bd143336c49e72
    Closes-Bug: #1428768

Changed in merlin:
status: In Progress → Fix Committed
Timur Sufiev (tsufiev-x) on 2015-04-20
summary: - [Workbook builder] Invalid wb scheme
+ [WB] Invalid wb scheme
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers