Skip to content

Don't use subprocess or temporary files when validating CWL #1268

@grallewellyn

Description

@grallewellyn

Problem is that a lot of the approaches I need the CWL file to be a temporary file to validate and get the specific javascript error that James was getting. I can get other easier to catch errors using a Python approach without creating a temporary file for example
CWL file is not in the right format or is invalid: 'Workflow' object is not iterable

There is the messy approach of reading the standard error from ap-validator because the call to

app_package = AppPackage.from_string(cwl_text)
validation_result = app_package.check_all(include=["error"])

doesn't include the javascript error in the returned errors, but prints it to the stderr because it uses cwltool to validate. I am going to continue looking into better options and reading the documentation here

Note that ap-validator also creates a temporary file to validate with cwltool here

Created in response to @sujen1412 's comment here: MAAP-Project/maap-api-nasa#206 (comment)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions