Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Incorrect breadcrumbs in job validation #130

Open
ddneilson opened this issue Jul 8, 2024 · 0 comments
Open

Bug: Incorrect breadcrumbs in job validation #130

ddneilson opened this issue Jul 8, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ddneilson
Copy link
Contributor

ddneilson commented Jul 8, 2024

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.

@ddneilson ddneilson added the bug Something isn't working label Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant