validating-string-parameter plugin and pipeline compatibility
966 views
Skip to first unread message
Juri Lelli
unread,
Mar 26, 2018, 1:22:18 PM3/26/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to jenkin...@googlegroups.com
Hi,
I'm trying to make validating-string-parameter-plugin [1] work with
Jenkins Pipelines.
So far I've managed to get it "working" by throwing a raw
RuntimeException from the @Override buildEnvironment [2]. But this is
far from optimal, as AFAIU buildEnvironment shouldn't be dealing with
parameters valitation at all. The problem with the current version of
the plugin instead is that runtime validation is performed by setUp
method of BuildWrapper(), which doesn't get invoked when using
Pipelines.
So, ideally I would actually like to prevent user hitting "Build" button
if form validation wasn't OK. Is there a way to perform realtime
validation (validation is currently performed when the field looses
focus) and grey out "Build" button if validation didn't succeed?
Alternatively, I was thinking that ParameterDefinition:createValue()
might be changed to possibly throw some form of exception
(AbortException maybe?) if something was wrong at the time user hit
"Build". Of course this would require Jenkins' core mods, would that be
a reasonable and acceptable approach?
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Jenkins Dev
On Mon, Mar 26, 2018 at 1:20 PM, Juri Lelli <juri....@redhat.com> wrote:
> ideally I would actually like to prevent user hitting "Build" button
> if form validation wasn't OK. Is there a way to perform realtime
> validation (validation is currently performed when the field looses
> focus) and grey out "Build" button if validation didn't succeed?
Not that I am aware.
> I was thinking that ParameterDefinition:createValue()
> might be changed to possibly throw some form of exception
> (AbortException maybe?)
Try throwing `Failure`.
Juri Lelli
unread,
Mar 30, 2018, 6:14:36 AM3/30/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message