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.
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:
should just be:
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:
Run
Code Snippet
See the reproduction steps. The likely place that this error is coming from is in the
instantiate_model
method here.