-
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.
Prior to this commit, the regexes in substitution.go file were hard to understand and hard to reuse because of the complexity of the regexes. For example, we have to consider - all the three notations (dot notation, bracket with single quote, and bracket with double quote) - the operator suffix including star `[*]` operator and int indexing that was not considerd before. Also the old regex coupled each notation part with the operator part, which leads to extra step to be done in the extract-related functions i.e. have to trim the [*] every time. In this PR, we - clean up the regexes and make it as much reable and reuseble as possible - make the method `extractVariablesFromString` be capable of extracting both variable name and the operator (indexing operator or star operator) examples: - $(params.myString) - name: "myString", operator: "" - $(params['myArray'][2]) - name: "myArray", operator: "1" - $(params.myObject[*]) - name: "myObject", operator: "*" Enabling `extractVariablesFromString` to extract both name and operator is particularly useful for array indexing validation. There will be more PRs to come to clean up considering the complexity of the all regexes. Also results-related regexes in resultref.go file need cleanup too.
- Loading branch information
Showing
9 changed files
with
312 additions
and
107 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
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.