Dashboard: Modal window layout breaks if error message is too large for create/update worbook/workflow

Bug #1648392 reported by Renat Akhmerov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mistral
Fix Released
Medium
Gal Margalit

Bug Description

In case if we are creating the WF:

---
version: '2.0'

my_wf:
  tasks:
    task1:
      action: std.echo output="Hi Mistral!"
      on-success: task3

    task2:
      action: std.noop

the error message is "task3 is not found" which looks very good and precise.

But if, for example, we specify a wrong workflow type like:

---
version: '2.0'

my_wf:
  type: blablabla

  tasks:
    task1:
      action: std.echo output="Hi Mistral!"

the error message is too large and the modal window layout breaks. The message in this case is like:

Invalid DSL: 'blabla' is not of type 'object' Failed validating 'type' in schema['properties']['tasks']['patternProperties']['^\\w+$']: {'additionalProperties': False, 'anyOf': [{'not': {'required': ['action', 'workflow'], 'type': 'object'}}, {'oneOf': [{'required': ['action'], 'type': 'object'}, {'required': ['workflow'], 'type': 'object'}]}], 'properties': {'action': {'minLength': 1, 'type': 'string'}, 'concurrency': {'oneOf': [{'oneOf': [{'pattern': '^({{(.*)?}})\\s*$', 'type': 'string'}, {'pattern': '^<%.*?%>\\s*$', 'type': 'string'}]}, {'minimum': 0, 'type': 'integer'}]}, 'description': {'minLength': 1, 'type': 'string'}, 'input': {'minProperties': 1, 'patternProperties': {'^\\w+$': {'anyOf': [{'type': 'null'}, {'type': 'array'}, {'type': 'boolean'}, {'type': 'integer'}, {'type': 'number'}, {'type': 'object'}, {'type': 'string'}]}}, 'type': 'object'}, 'join': {'oneOf': [{'enum': ['all', 'one']}, {'minimum': 0, 'type': 'integer'}]}, 'keep-result': {'oneOf': [{'oneOf': [{'pattern': '^({{(.*)?}})\\s*$', 'type': 'string'}, {'pattern': '^<%.*?%>\\s*$', 'type': 'string'}]}, {'type': 'boolean'}]}, 'name': {'minLength': 1, 'type': 'string'}, 'on-complete': {'oneOf': [{'minLength': 1, 'type': 'string'}, {'items': {'oneOf': [{'minLength': 1, 'type': 'string'}, {'minProperties': 1, 'patternProperties': {'^\\w+$': {'oneOf': [{'pattern': '^({{(.*)?}})\\s*$', 'type': 'string'}, {'pattern': '^<%.*?%>\\s*$', 'type': 'string'}]}}, 'type': 'object'}]}, 'minItems': 1, 'type': 'array', 'uniqueItems': True}]}, 'on-error': {'oneOf': [{'minLength': 1, 'type': 'string'}, {'items': {'oneOf': [{'minLength': 1, 'type': 'string'}, {'minProperties': 1, 'patternProperties': {'^\\w+$': {'oneOf': [{'pattern': '^({{(.*)?}})\\s*$', 'type': 'string'}, {'pattern': '^<%.*?%>\\s*$', 'type': 'string'}]}}, 'type': 'object'}]}, 'minItems': 1, 'type': 'array', 'uniqueItems': True}]}, 'on-success': {'oneOf': [{'minLength': 1, 'type': 'string'}, {'items': {'oneOf': [{'minLength': 1, 'type': 'string'}, {'minProperties': 1, 'patternProperties': {'^\\w+$': {'oneOf': [{'pattern': '^({{(.*)?}})\\s*$', 'type': 'string'}, {'pattern': '^<%.*?%>\\s*$', 'type': 'string'}]}}, 'type': 'object'}]}, 'minItems': 1, 'type': 'array', 'uniqueItems': True}]}, 'pause-before': {'oneOf': [{'oneOf': [{'pattern': '^({{(.*)?}})\\s*$', 'type': 'string'}, {'pattern': '^<%.*?%>\\s*$', 'type': 'string'}]}, {'type': 'boolean'}]}, 'publish': {'minProperties': 1, 'patternProperties': {'^\\w+$': {'anyOf': [{'type': 'null'}, {'type': 'array'}, {'type': 'boolean'}, {'type': 'integer'}, {'type': 'number'}, {'type': 'object'}, {'type': 'string'}]}}, 'type': 'object'}, 'publish-on-error': {'minProperties': 1, 'patternProperties': {'^\\w+$': {'anyOf': [{'type': 'null'}, {'type': 'array'}, {'type': 'boolean'}, {'type': 'integer'}, {'type': 'number'}, {'type': 'object'}, {'type': 'string'}]}}, 'type': 'object'}, 'retry': {'oneOf': [{'additionalProperties': False, 'properties': {'break-on': {'oneOf': [{'pattern': '^({{(.*)?}})\\s*$', 'type': 'string'}, {'pattern': '^<%.*?%>\\s*$', 'type': 'string'}]}, 'continue-on': {'oneOf': [{'pattern': '^({{(.*)?}})\\s*$', 'type': 'string'}, {'pattern': '^<%.*?%>\\s*$', 'type': 'string'}]}, 'count': {'oneOf': [{'oneOf': [{'pattern': '^({{(.*)?}})\\s*$', 'type': 'string'}, {'pattern': '^<%.*?%>\\s*$', 'type': 'string'}]}, {'minimum': 0, 'type': 'integer'}]}, 'delay': {'oneOf': [{'oneOf': [{'pattern': '^({{(.*)?}})\\s*$', 'type': 'string'}, {'pattern': '^<%.*?%>\\s*$', 'type': 'string'}]}, {'minimum': 0, 'type': 'integer'}]}}, 'required': ['delay', 'count'], 'type': 'object'}, {'minLength': 1, 'type': 'string'}], 'properties': {'description': {'minLength': 1, 'type': 'string'}, 'name': {'minLength': 1, 'type': 'string'}, 'tags': {'items': {'minLength': 1, 'type': 'string'}, 'minItems': 1, 'type': 'array', 'uniqueItems': True}, 'version': {'anyOf': [{'minLength': 1, 'type': 'string'}, {'minimum': 0, 'type': 'integer'}, {'minimum': 0.0, 'type': 'number'}]}}}, 'safe-rerun': {'oneOf': [{'oneOf': [{'pattern': '^({{(.*)?}})\\s*$', 'type': 'string'}, {'pattern': '^<%.*?%>\\s*$', 'type': 'string'}]}, {'type': 'boolean'}]}, 'tags': {'items': {'minLength': 1, 'type': 'string'}, 'minItems': 1, 'type': 'array', 'uniqueItems': True}, 'target': {'minLength': 1, 'type': 'string'}, 'timeout': {'oneOf': [{'oneOf': [{'pattern': '^({{(.*)?}})\\s*$', 'type': 'string'}, {'pattern': '^<%.*?%>\\s*$', 'type': 'string'}]}, {'minimum': 0, 'type': 'integer'}]}, 'type': {'enum': ['direct']}, 'version': {'anyOf': [{'minLength': 1, 'type': 'string'}, {'minimum': 0, 'type': 'integer'}, {'minimum': 0.0, 'type': 'number'}]}, 'wait-after': {'oneOf': [{'oneOf': [{'pattern': '^({{(.*)?}})\\s*$', 'type': 'string'}, {'pattern': '^<%.*?%>\\s*$', 'type': 'string'}]}, {'minimum': 0, 'type': 'integer'}]}, 'wait-before': {'oneOf': [{'oneOf': [{'pattern': '^({{(.*)?}})\\s*$', 'type': 'string'}, {'pattern': '^<%.*?%>\\s*$', 'type': 'string'}]}, {'minimum': 0, 'type': 'integer'}]}, 'with-items': {'oneOf': [{'minLength': 1, 'type': 'string'}, {'items': {'minLength': 1, 'type': 'string'}, 'minItems': 1, 'type': 'array', 'uniqueItems': True}]}, 'workflow': {'minLength': 1, 'type': 'string'}}, 'type': 'object'} On instance['tasks']['type']: 'blabla'

Ideally, it would be cool to retain only "Invalid DSL: 'blabla' is not of type 'object' Failed validating 'type'".

Changed in mistral:
assignee: nobody → Gal Margalit (galmargalit)
status: New → Confirmed
importance: Undecided → Medium
milestone: none → ocata-2
Changed in mistral:
milestone: ocata-2 → ocata-3
Revision history for this message
Sharat Sharma (sharat-sharma) wrote :

Hi Renat,

This is the error message i got when i tried the same template.

Changed in mistral:
milestone: ocata-3 → ocata-rc1
Changed in mistral:
milestone: ocata-rc1 → ocata-rc2
Changed in mistral:
milestone: ocata-rc2 → pike-1
Revision history for this message
Sharat Sharma (sharat-sharma) wrote :

This problem is fixed. The error message that we get now is:

Failed to find a specification class to instantiate [spec_cls=<class 'mistral.lang.v2.workflows.WorkflowSpec'>, data={'tasks': {'task1': {'action': 'std.echo output="Hi Mistral!"'}}, 'type': 'blablabla', 'name': 'my_wf', 'version': '2.0'}]

which IMO is precise.

Changed in mistral:
status: Confirmed → Fix Committed
Revision history for this message
Renat Akhmerov (rakhmerov) wrote :

@Sharat, what patch fixed it?

Changed in mistral:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.