common-workflow-language / common-workflow-language/cwl-upgrader
Imports inside the requirements block cause cwl-upgrader to fail
- Dominant language
- Python
- Stars
- 7
- Forks
- 4
- Avg merge
- 11h 6m
- Merged PRs (30d)
- 1
Description
The `$import` key seems to cause this to fail. For example, here is the minimal CWL that will cause this problem:
```yaml
cwlVersion: "cwl:draft-3"
class: CommandLineTool
requirements:
- $import: file.yml
```
The error I get is:
```
Traceback (most recent call last):
File "/usr/local/bin/cwl-upgrader", line 11, in
sys.exit(main())
File "/usr/local/lib/python3.6/dist-packages/cwlupgrader/main.py", line 24, in main
document = draft3_to_v1_0(document)
File "/usr/local/lib/python3.6/dist-packages/cwlupgrader/main.py", line 34, in draft3_to_v1_0
_draft3_to_v1_0(document)
File "/usr/local/lib/python3.6/dist-packages/cwlupgrader/main.py", line 57, in _draft3_to_v1_0
hints_and_requirements_clean(document)
File "/usr/local/lib/python3.6/dist-packages/cwlupgrader/main.py", line 161, in hints_and_requirements_clean
if entry["class"] == "CreateFileRequirement":
KeyError: 'class'
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in cwlupgrader/main.py at hints_and_requirements_clean(), identified in the traceback, and reproduce the failure with the minimal CWL document from the issue. Check that a requirements entry using $import no longer raises KeyError and that cwl-upgrader completes the draft-3 to v1.0 conversion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100