-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
harden look like a result references check
looksLikeResultRef checks for a prefix task and if a string contains .result. Any expression satisfying these two conditions are considered as a result reference, for example, all of the following expressions are considered as a result reference: tasks.a-task.results.bResult (valid reference) tasks.a-task.resultTypo.bResult (invalid reference) task.result (invalid reference) tasks.a-task.b-task.c-task.results.result.result (invalid reference) etc. But, this way of checking for a result reference is weak. looksLikeResultRef returns true for some invalid expressions but not others, for example: tasks.a-task.typoresults.bResult (invalid reference) task.typoresult (invalid reference) etc A pipeline with such expressions tasks.a-task.resultsTypo.bResult results in validation failure with a vague error "invalid value: expected all of the expressions [tasks.a-task.resultTypo.bResult] to be result expressions but only [] were: tasks[0].params[a-param].value" v/s a pipeline with an another invalid expression tasks.a-task.typoresults.bResult does not recognize this expression as an invalid result reference but considers it as a string constant. This PR drops the vague validation error for such expressions. Also, the validation function validateParamResults is also relying on the same weak looksLikeResultRef which is redundant with validateGraph. The validation function validateGraph which is called prior to validateParamResults is using NewResultRef to discover the dependencies and make sure a valid DAG can be constructed. The way we have implemented reporting validation errors with errs.Also(, the pipeline validation calls the same function NewResultRef with the same set of expressions. This redundancy impacts the amount of time spent in validation. This PR deletes these redundant checks.
- Loading branch information
1 parent
34274fb
commit 9221ac3
Showing
12 changed files
with
150 additions
and
292 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.