Skip to content

Bug: Incorrect breadcrumbs in job validation #130

@ddneilson

Description

@ddneilson

Expected Behaviour

The breadcrumb should direct the user to the correct location within the job template that they should be looking to correct the error.

The breadcrumb:

steps[0] -> steps[0] -> parameterSpace -> steps[0] -> parameterSpace -> steps[0] -> parameterSpace -> taskParameterDefinitions[0] -> range:

should just be:

steps[0] -> parameterSpace -> taskParameterDefinitions[0] -> range:

Current Behaviour

The validation that is happening after job instantiation (i.e. after job parameters have been evaluated for instantiation) is reporting an incorrect breadcrumb for errors in task parameter range expressions.

Reproduction Steps

Given:

specificationVersion: jobtemplate-2023-09
name: BadRangeExpr
parameterDefinitions:
  - name: V
    type: STRING
    default: "1-10:2;10"
steps:
  - name: Test
    parameterSpace:
      taskParameterDefinitions:
        - name: P
          type: INT
          range: "{{Param.V}}"
    script:
      actions:
        onRun:
          command: bash
          args:
          - "-c"
          - "echo 'Hi'"

Run

% openjd run --step Test expr.template.yaml 
ERROR generating Job: Could not generate Job from template and parameters: 1 validation errors for JobTemplate
steps[0] -> steps[0] -> parameterSpace -> steps[0] -> parameterSpace -> steps[0] -> parameterSpace -> taskParameterDefinitions[0] -> range:
	Unexpected ';' in '1-10:2;10' after '1-10:2'

Code Snippet

See the reproduction steps. The likely place that this error is coming from is in the instantiate_model method here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions