common-workflow-language / common-workflow-language/schema_salad

makedoc: Field 'type' references unknown identifier 'File'

Open
#827 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
86
Forks
64
Avg merge
19h 24m
Merged PRs (30d)
19

Description

# Summary

CWL passes as valid using `cwltool --validate`, but the following error occurs when `schema-salad-doc gtadexp-hyperthought-daily.json` is run.

# System Info

- CWL version: 1.2
- python version: 3.11.9
- schema-salad-tool version: 8.5.20240410123758

# Error

```
Traceback (most recent call last):
File "/opt/anaconda3/envs/cwl-1.3/bin/schema-salad-doc", line 11, in
sys.exit(main())
^^^^^^
File "schema_salad/makedoc.py", line 775, in main
File "schema_salad/makedoc.py", line 813, in makedoc
File "schema_salad/ref_resolver.py", line 556, in resolve_ref
File "schema_salad/ref_resolver.py", line 990, in resolve_all
File "schema_salad/ref_resolver.py", line 1196, in validate_links
schema_salad.exceptions.ValidationException: gtadexp-hyperthought-daily.json:24:3: checking field 'outputs'
gtadexp-hyperthought-daily.json:25:5: checking item
Field 'type' references unknown identifier 'File', tried
file:///Users/bkappes/workspace/CWLCon2024/schema-salad/gtadexp-hyperthought-daily.json#File
```

# CWL

```
[
{
"class": "CommandLineTool",
"cwlVersion": "v1.2"
},
"baseCommand": [],
"inputs": [
{
"id": "workspace",
"type": "string?",
"default": "Global Test Artifact Data Exchange Program"
},
{
"id": "apikey",
"type": "string?"
},
{
"id": "num_tasks",
"type": "int?",
"default": 4
}
],
"outputs": [
{
"id": "output",
"type": "File?",
"outputBinding": {
"glob": "*.pkl"
}
}
],
"label": "gtadexp-hyperthought-download",
"arguments": [
{
"prefix": "",
"shellQuote": false,
"position": 0,
"valueFrom": "[ ! -f $(inputs.workspace.replace(/ /g, \"-\").replace(/_/g, \"-\"))-${\n var date = new Date()\n return date.toISOString().split('T')[0] + \".pkl\"\n} ] && \\\n[ ! -z \"$(inputs.apikey)\" ] && \\\ndriveam \\\ndownload \\\n -w \"$(inputs.workspace)\" \\\n -n $(inputs.num_tasks) \\\n -k \"$(inputs.apikey)\" \\\ndump \\\n -f $(inputs.workspace.replace(/ /g, \"-\").replace(/_/g, \"-\"))-${\n var date = new Date()\n return date.toISOString().split('T')[0] + \".pkl\"\n }"
}
],
"requirements": [
{
"class": "ShellCommandRequirement"
},
{
"class": "DockerRequirement",
"dockerPull": "/hyperthought-tools:0.1.4"
},
{
"class": "EnvVarRequirement",
"envDef": [
{
"envName": "DEBUG",
"envValue": "1"
}
]
},
{
"class": "InlineJavascriptRequirement"
}
]
]
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with `schema-salad-doc gtadexp-hyperthought-daily.json` and inspect the `makedoc.py` and `ref_resolver.py` paths shown in the traceback. Trace why the `File` output type is unresolved even though `cwltool --validate` succeeds. Done means the documented CWL input no longer raises the unknown-identifier error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.