Combine top level and type validation error messages
The current validation checks for correct naming of TOSCA top level sections in the template and stops the parser execution flow if find any incorrect name. This makes sense, however, it would be ideal if validation combine all the wrong names in to a single message when raise an error. This will be very useful as it doesn’t require running parser multiple times to locate incorrect naming error individually. Having all names together a part of message will just require a single fix before running parser again.
Also, validation for the naming for node types are an important validation aspect. However the current validation provides an error for an individual wrong node type naming instead of showing that altogether. It would be idea to combine names into a single message.
The scope of what to validate and how to validate is very wide and can not be covered in once, and so this requirement is just an initial step towards making validation better and can a low hanging fruit blueprint implementation for a new contributor.
As an example, TOSCA template with following top level section,
node_temp:
mysql_database:
type: tosca.nodes.
out:
url:
description: Test url.
gives following error first,
translator.
And after user fix that and run parser again it gives following error,
translator.
Similarly for the following template with node_templates,
node_templates:
webserver:
type: tosca.nodes.server
server:
type: tosca.nodes.comp
gives error as:
translator.
Once you fix tosca.nodes.
translator.
Ideally, such validation error should be combined and then should be provided to user in a single message as much as possible.
Blueprint information
- Status:
- Complete
- Approver:
- None
- Priority:
- Medium
- Drafter:
- Sahdev Zala
- Direction:
- Approved
- Assignee:
- Sahdev Zala
- Definition:
- Approved
- Series goal:
- None
- Implementation:
- Implemented
- Milestone target:
- None
- Started by
- Sahdev Zala
- Completed by
- Sahdev Zala
Related branches
Related bugs
Sprints
Whiteboard
(spzala) implemented separately in the tosca-parser project.