Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • lava lava
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 95
    • Issues 95
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 58
    • Merge requests 58
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • lava
  • lavalava
  • Issues
  • #610

Closed
Open
Created May 16, 2023 by Guillaume Tucker@gtuckerMaintainer

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
Assignee
Assign to
Time tracking