Job metadata fails validation with values other than strings
According to the schema, the job metadata
should be able to contain values of any kind:
Optional("metadata"): {str: object},
(in lava_common/schemas/__init__.py
)
However, when sending a value that is either a list or a dictionary the validation fails. For example:
metadata:
api_config:
name: staging.kernelci.org
url: https://staging.kernelci.org:9000
version: latest
node_id: 645372a98fec6b4207361e03
raises the following validation error:
Invalid definition: expected str for dictionary value @ data['metadata']['api_config']
I've tried this with a small schema locally but couldn't reproduce the problem:
def main():
schema = voluptuous.Schema({
voluptuous.Required('name'): str,
voluptuous.Optional('metadata'): {str: object},
})
data = {
'name': 'Hello',
'metadata': {
'foo': 'bar',
'a': {'x': 1, 'y': 3}
},
}
val = schema(data)
print(val)
which prints:
{'name': 'Hello', 'metadata': {'foo': 'bar', 'a': {'x': 1, 'y': 3}}}
So it seems like something is interfering with the plain voluptuous
validation. The validation error shown via the web UI was also hit when trying to submit a job directly using the REST API, so it doesn't seem to be a web UI problem.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information