Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolver: inject fewer IDs #430

Merged
merged 3 commits into from
Sep 14, 2021
Merged

resolver: inject fewer IDs #430

merged 3 commits into from
Sep 14, 2021

Conversation

mr-c
Copy link
Member

@mr-c mr-c commented Sep 4, 2021

  • bump the minor version due to the behavior change?

Fixes common-workflow-language/cwltool#1505 and partially addresses common-workflow-language/cwl-utils#71

Will still inject an id (or other identifier) in some circumstances.

For example with CWL: https://github.com/common-workflow-language/cwl-v1.2/blob/main/tests/schemadef-wf.cwl#L7 will result in "id": "#schemadef-type.yml" as part of the first entry in requirements as show below

{
    "$graph": [
        {
            "class": "CommandLineTool",
            "requirements": [
                {
                    "class": "SchemaDefRequirement",
                    "types": [
                        {
                            "name": "#schemadef-type.yml/HelloType",
                            "type": "record",
                            "fields": [
                                {
                                    "name": "#schemadef-type.yml/HelloType/a",
                                    "type": "string"
                                },
                                {
                                    "name": "#schemadef-type.yml/HelloType/b",
                                    "type": "string"
                                }
                            ]
                        }
                    ],
                    "id": "#schemadef-type.yml"
                }
            ],
            "inputs": [
                {
                    "id": "#schemadef-tool.cwl/hello",
                    "type": "#schemadef-type.yml/HelloType",
                    "inputBinding": {
                        "valueFrom": "$(self.a)/$(self.b)"
                    }
                }
            ],
            "outputs": [
                {
                    "id": "#schemadef-tool.cwl/output",
                    "type": "File",
                    "outputBinding": {
                        "glob": "output.txt"
                    }
                }
            ],
            "stdout": "output.txt",
            "baseCommand": "echo",
            "id": "#schemadef-tool.cwl"
        },
        {
            "class": "Workflow",
            "requirements": [
                {
                    "$import": "#schemadef-type.yml"
                }
            ],
            "inputs": [
                {
                    "type": "#schemadef-type.yml/HelloType",
                    "id": "#main/hello"
                }
            ],
            "outputs": [
                {
                    "type": "File",
                    "outputSource": "#main/step1/output",
                    "id": "#main/output"
                }
            ],
            "steps": [
                {
                    "in": [
                        {
                            "source": "#main/hello",
                            "id": "#main/step1/hello"
                        }
                    ],
                    "out": [
                        "#main/step1/output"
                    ],
                    "run": "#schemadef-tool.cwl",
                    "id": "#main/step1"
                }
            ],
            "id": "#main"
        }
    ],
    "cwlVersion": "v1.2"

@codecov
Copy link

codecov bot commented Sep 4, 2021

Codecov Report

Merging #430 (eb37fd9) into main (3ed19d6) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #430      +/-   ##
==========================================
+ Coverage   79.49%   79.51%   +0.01%     
==========================================
  Files          18       18              
  Lines        3272     3275       +3     
  Branches      881      882       +1     
==========================================
+ Hits         2601     2604       +3     
  Misses        439      439              
  Partials      232      232              
Impacted Files Coverage Δ
schema_salad/ref_resolver.py 84.44% <100.00%> (+0.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3ed19d6...eb37fd9. Read the comment docs.

@mr-c mr-c requested a review from tetron September 4, 2021 15:57
@mr-c
Copy link
Member Author

mr-c commented Sep 9, 2021

I did a run of cwltool with this branch; all tests pass including all CWL v1.[012] conformance tests

@mr-c mr-c enabled auto-merge (squash) September 14, 2021 09:26
@mr-c mr-c merged commit a6e2c34 into main Sep 14, 2021
@mr-c mr-c deleted the resolver_inject_fewer_ids branch September 14, 2021 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cwltool --pack adds an 'id' to InputRecordSchemas that is invalid
1 participant