Using default mutable parameter is bad.
Default parameters are evaluated only once
if you mutate it you will get unexpected results.
Since we don't mutate here the default paramter, make
sure it is unmutable.
Change-Id: Ib5c451a8c8cad7b6c9a009369c1c039563023368
The OnClauseSpec required Task names to be \w+ or [a-zA-Z0-9_]
which is not enforced by the DSL, so it was possible to have
valid task names that could not be referenced in an on-clause.
YAML enforces some restrictions on characters in task names (#, !, |)
but other than that any JSON-schema valid string should be a valid Task
name
Change-Id: I3f1056cad7c67e160a082c2a0de2e3bfd476bc63
Closes-Bug: 1797439
Currently when we get a specification using the instantiate_spec function,
we always validate their schema and semantics over and over again.
To prevent it we add new validate parameter to a Spec class.
The validate parameter must be True when we create a workflow, workbook
or action using a mistral-api. In all other cases, it must be False.
Change-Id: Ia450ea9635bc75c204fe031cfeeab154f1d03862
Closes-Bug: #1738769
Signed-off-by: Vitalii Solodilov <mcdkr@yandex.ru>
This patch places restrictions on the content of the on-success,
on-complete, on-error, retry, concurrency, timeout, wait-before,
wait-after and pause-before statements.
test_direct_transition was refactored to exclude repeated test cases
for on clause keys.
Co-Authored-By: Vitalii Solodilov <mcdkr@yandex.ru>
Closes-Bug: #1714341
Change-Id: I8b314c8759a46111a81cf4a9400aa1cab2ea5201
Signed-off-by: Vitalii Solodilov <mcdkr@yandex.ru>
* Before this patch some language specification schemas were
validated twice (or even more) because some parent specs had
references to specific schemas of child specs in their schemas.
And due to our recursive parsing algorithm the same schemas were
checked many times. It reduces performance and complicates
the entire lang specification framework because there's too many
relationships between different specs. The better approach is to
reduce a number of relationships. One way is to not check schemas
child specs when checking parent spec schema. This patch removes
such references replacing them just common schemas like
"non-empty" or "any" which don't lead to validating sub-schemas
when validating parent schemas.
* Minor style changes
Change-Id: I6b695c1870bf8b70112332d4052115543382cdc7
* 'on-success', 'on-error' and 'on-complete' can now look like
described in "Advanced Publishing" specification [1]
* Refactored all places related to the spec changes
* Added unit tests for advanced schema of 'on-xxx' clauses
[1] https://github.com/openstack/mistral-specs/blob/master/specs/pike/approved/advanced_publishing.rst
Change-Id: I190fcec0a40ca6f97d712168f4be7a418bd1f0e8
Partially implements: blueprint mistral-advanced-publishing-global-vars