Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[FIXED JENKINS-46854] Do parsing pass on script/expression blocks in …
…validation This doesn't catch all possible script/expression errors that'll show up in full Groovy parsing and validation, but it'll catch errors like mismatched quotes in JSON form and report back their location and that compilation failed. Getting a more granular error would be too much text, so I opted for just the "hey, this wasn't valid Groovy syntax" approach.
- Loading branch information
Showing
6 changed files
with
88 additions
and
5 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
64 changes: 64 additions & 0 deletions
64
pipeline-model-definition/src/test/resources/json/errors/quoteRoundTripping.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{"pipeline": { | ||
"stages": [ { | ||
"name": "Each of these takes ten seconds", | ||
"parallel": [ | ||
{ | ||
"name": "first", | ||
"branches": [ { | ||
"name": "default", | ||
"steps": [ | ||
{ | ||
"name": "echo", | ||
"arguments": [ { | ||
"key": "message", | ||
"value": { | ||
"isLiteral": true, | ||
"value": "First branch" | ||
} | ||
}] | ||
}, | ||
{ | ||
"name": "script", | ||
"arguments": [ { | ||
"key": "scriptBlock", | ||
"value": { | ||
"isLiteral": true, | ||
"value": "sh 'for i in `seq 1 10`; do echo \"Sleeping 1S\"; sleep 1;' done'" | ||
} | ||
}] | ||
} | ||
] | ||
}] | ||
}, | ||
{ | ||
"name": "second", | ||
"branches": [ { | ||
"name": "default", | ||
"steps": [ | ||
{ | ||
"name": "echo", | ||
"arguments": [ { | ||
"key": "message", | ||
"value": { | ||
"isLiteral": true, | ||
"value": "Second branch" | ||
} | ||
}] | ||
}, | ||
{ | ||
"name": "script", | ||
"arguments": [ { | ||
"key": "scriptBlock", | ||
"value": { | ||
"isLiteral": true, | ||
"value": "sh 'for i in `seq 1 10`; do echo \"Sleeping 1S\"; sleep 1; done'" | ||
} | ||
}] | ||
} | ||
] | ||
}] | ||
} | ||
] | ||
}], | ||
"agent": {"type": "any"} | ||
}} |