Skip to content

Commit

Permalink
Report model and value being checked
Browse files Browse the repository at this point in the history
This gxformat2 document has a wrong type on the max of a float
parameter.
```
class: GalaxyWorkflow
doc: |
  Simple workflow that no-op cats a file.
inputs:
  the_input:
    type: File
    doc: input doc
  the_collection:
    type: collection
    collection_type: list
  the_integer:
    type: int
    min: 1
    max: 3
  the_float:
    type: float
    min: 1.0
    max: 3.0a
outputs:
  the_output:
    outputSource: cat/out_file1
steps:
  cat:
    tool_id: cat1
    doc: cat doc
    in:
      input1: the_input
```

Before:
```
.. ERROR: Validation failed schema/v19_09/examples/valid1.yml:1:1:   Object `valid1.yml` is not valid because:
schema/v19_09/examples/valid1.yml:4:1:     the `inputs` field is not valid because:
                                            array item is invalid because
schema/v19_09/examples/valid1.yml:15:3:       checking object `valid1.yml#the_float`
                                                * checking object `valid1.yml#the_float`
schema/v19_09/examples/valid1.yml:17:5:           * invalid field `min`, expected one of: `label`,
                                                  `doc`, `id`, `default`, `position`, `optional`, `type`,
                                                  `regex`
schema/v19_09/examples/valid1.yml:18:5:           * invalid field `max`, expected one of: `label`,
                                                  `doc`, `id`, `default`, `position`, `optional`, `type`,
                                                  `regex`
schema/v19_09/examples/valid1.yml:15:3:         * checking object `valid1.yml#the_float`
schema/v19_09/examples/valid1.yml:18:5:           the `max` field is not valid because:
                                                    Value is a str, but valid types for this field
                                                    are (int, float)
schema/v19_09/examples/valid1.yml:15:3:         * checking object `valid1.yml#the_float`
schema/v19_09/examples/valid1.yml:18:5:           * the `max` field is not valid because:
                                                    Value is a str, but valid types for this field
                                                    are (int, float)
schema/v19_09/examples/valid1.yml:16:5:           * the `type` field is not valid because:
                                                    Expected one of ('integer', 'int')
schema/v19_09/examples/valid1.yml:15:3:         * checking object `valid1.yml#the_float`
schema/v19_09/examples/valid1.yml:16:5:           * the `type` field is not valid because:
                                                    Value is a str, but valid values for this field
                                                    are ("File", "data")
schema/v19_09/examples/valid1.yml:17:5:           * invalid field `min`, expected one of: `label`,
                                                  `doc`, `id`, `default`, `position`, `optional`, `format`,
                                                  `type`
schema/v19_09/examples/valid1.yml:18:5:           * invalid field `max`, expected one of: `label`,
                                                  `doc`, `id`, `default`, `position`, `optional`, `format`,
                                                  `type`
schema/v19_09/examples/valid1.yml:15:3:         * checking object `valid1.yml#the_float`
schema/v19_09/examples/valid1.yml:16:5:           * the `type` field is not valid because:
                                                    Expected one of ('collection',)
schema/v19_09/examples/valid1.yml:17:5:           * invalid field `min`, expected one of: `label`,
                                                  `doc`, `id`, `default`, `position`, `optional`, `format`,
                                                  `type`, `collection_type`
schema/v19_09/examples/valid1.yml:18:5:           * invalid field `max`, expected one of: `label`,
                                                  `doc`, `id`, `default`, `position`, `optional`, `format`,
                                                  `type`, `collection_type`
```

After:
```
.. ERROR: Validation failed schema/v19_09/examples/valid1.yml:1:1:   Object `valid1.yml` is not valid because:
schema/v19_09/examples/valid1.yml:4:1:     the `inputs` field with value `ordereddict([('the_input',
                                          ordereddict([('type', 'File'), ('doc', 'input doc')])),
                                          ('the_collection', ordereddict([('type', 'collection'),
                                          ('collection_type', 'list')])), ('the_integer',
                                          ordereddict([('type', 'int'), ('min', 1), ('max', 3)])),
                                          ('the_float', ordereddict([('type', 'float'), ('min', 1.0),
                                          ('max', '3.0a')]))])` is not valid because:
                                            array item is invalid because
schema/v19_09/examples/valid1.yml:15:3:       checking object `valid1.yml#the_float` using
                                              `WorkflowInputParameterLoader`
                                                * checking object `valid1.yml#the_float` using
                                                `WorkflowTextParameter`
schema/v19_09/examples/valid1.yml:17:5:           * invalid field `min`, expected one of: `label`,
                                                  `doc`, `id`, `default`, `position`, `optional`, `type`,
                                                  `regex`
schema/v19_09/examples/valid1.yml:18:5:           * invalid field `max`, expected one of: `label`,
                                                  `doc`, `id`, `default`, `position`, `optional`, `type`,
                                                  `regex`
schema/v19_09/examples/valid1.yml:15:3:         * checking object `valid1.yml#the_float` using
                                                `WorkflowFloatParameter`
schema/v19_09/examples/valid1.yml:18:5:           the `max` field is not valid because:
                                                    Value `3.0a` is a str, but valid types for this
                                                    field are (float, int)
schema/v19_09/examples/valid1.yml:15:3:         * checking object `valid1.yml#the_float` using
                                                `WorkflowIntegerParameter`
schema/v19_09/examples/valid1.yml:18:5:           * the `max` field is not valid because:
                                                    Value `3.0a` is a str, but valid types for this
                                                    field are (float, int)
schema/v19_09/examples/valid1.yml:16:5:           * the `type` field with value `float` is not
                                                  valid because:
                                                    Expected one of ('integer', 'int')
schema/v19_09/examples/valid1.yml:15:3:         * checking object `valid1.yml#the_float` using
                                                `WorkflowDataParameter`
schema/v19_09/examples/valid1.yml:16:5:           * the `type` field is not valid because:
                                                    Value `float` is a str, but valid values for
                                                    this field are ("data", "File")
schema/v19_09/examples/valid1.yml:17:5:           * invalid field `min`, expected one of: `label`,
                                                  `doc`, `id`, `default`, `position`, `optional`, `format`,
                                                  `type`
schema/v19_09/examples/valid1.yml:18:5:           * invalid field `max`, expected one of: `label`,
                                                  `doc`, `id`, `default`, `position`, `optional`, `format`,
                                                  `type`
schema/v19_09/examples/valid1.yml:15:3:         * checking object `valid1.yml#the_float` using
                                                `WorkflowCollectionParameter`
schema/v19_09/examples/valid1.yml:16:5:           * the `type` field with value `float` is not
                                                  valid because:
                                                    Expected one of ('collection',)
schema/v19_09/examples/valid1.yml:17:5:           * invalid field `min`, expected one of: `label`,
                                                  `doc`, `id`, `default`, `position`, `optional`, `format`,
                                                  `type`, `collection_type`
schema/v19_09/examples/valid1.yml:18:5:           * invalid field `max`, expected one of: `label`,
                                                  `doc`, `id`, `default`, `position`, `optional`, `format`,
                                                  `type`, `collection_type`
```

I don't know if we like the top level dictionary dump there, but in terms of
understanding why a document didn't validate I find the after version
much easier to understand.
  • Loading branch information
mvdbeek authored and mr-c committed Nov 5, 2024
1 parent ebe586d commit 78fcf8d
Show file tree
Hide file tree
Showing 3 changed files with 336 additions and 253 deletions.
Loading

0 comments on commit 78fcf8d

Please sign in to comment.