Are doCheckXyz validators run during global configuration?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Are doCheckXyz validators run during global configuration?

Bill Bruyn
I'm writing a little plugin using Hudson 1.300, and I have a few global configuration options that I collect from a global.jelly and persist with a Descriptor.configure.  I'd like to be able to validate that input before it's persisted, but my doCheck methods don't seem to be run.

Do I still need a checkUrl attribute on my jelly tag, as outlined in this thread?  I actually tried that over the weekend, but wasn't able to get the Url right - either that, or I just have something wrong with my setup.  BTW, the documentation at Figuring out URL binding of Stapler is empty - it's referred to from the Stapler doc, so I assume there used to be something there?

In any case, I get a vanilla 404 when I try a URL like http://localhost:8080/plugin/http-notifier/checkFailureUrl?value=ooof and the following error when I try it this way:   http://localhost:8080/publisher/http-notifier/checkFailureUrl?value=ooof

Stapler processed this HTTP request as follows, but couldn't find the resource to consume the request

-> evaluate(<hudson.model.Hudson@1e694e9> :hudson.model.Hudson,"/publisher/http-notifier/checkFailureUrl")
-> evaluate(((StaplerProxy)<hudson.model.Hudson@1e694e9>).getTarget(),"/publisher/http-notifier/checkFailureUrl")
-> evaluate(<hudson.model.Hudson@1e694e9>.getPublisher("http-notifier"),"/checkFailureUrl")
-> evaluate(null,"/checkFailureUrl")
-> unexpected null!

If this 404 is unexpected, double check the last part of the trace to see if it should have evaluated to null.



I'd appreciate a hand, including any bit of documentation I might have missed.

Reply | Threaded
Open this post in threaded view
|

Re: Are doCheckXyz validators run during global configuration?

Kohsuke Kawaguchi
Administrator
Bill Bruyn wrote:
> I'm writing a little plugin using Hudson 1.300, and I have a few global
> configuration options that I collect from a global.jelly and persist with a
> Descriptor.configure.  I'd like to be able to validate that input before
> it's persisted, but my doCheck methods don't seem to be run.

Right, this hook up currently only works between Describable/Descriptor.

Technically speaking, if Descriptor have the doCheckXyz for both global
and instance-level configuration, there's a room for collision, but I
suppose in practice that's not an issue.

Any chance you can file an issue for this, so that I can keep track?

>
> Do I still need a checkUrl attribute on my jelly tag, as outlined in
> http://osdir.com/ml/java.hudson.user/2007-02/msg00085.html this thread ?  I
> actually tried that over the weekend, but wasn't able to get the Url right -
> either that, or I just have something wrong with my setup.  BTW, the
> documentation at
> http://wiki.hudson-ci.org/display/HUDSON/Figuring+out+URL+binding+of+Stapler
> Figuring out URL binding of Stapler  is empty - it's referred to from the
> https://stapler.dev.java.net/reference.html Stapler doc , so I assume there
> used to be something there?
>
> In any case, I get a vanilla 404 when I try a URL like
> http://localhost:8080/plugin/http-notifier/checkFailureUrl?value=ooof and
> the following error when I try it this way:  
> http://localhost:8080/publisher/http-notifier/checkFailureUrl?value=ooof
>
> Stapler processed this HTTP request as follows, but couldn't find the
> resource to consume the request
>
> -> evaluate(<hudson.model.Hudson@1e694e9>
> :hudson.model.Hudson,"/publisher/http-notifier/checkFailureUrl")
> ->
> evaluate(((StaplerProxy)<hudson.model.Hudson@1e694e9>).getTarget(),"/publisher/http-notifier/checkFailureUrl")
> ->
> evaluate(<hudson.model.Hudson@1e694e9>.getPublisher("http-notifier"),"/checkFailureUrl")
> -> evaluate(null,"/checkFailureUrl")
> -> unexpected null!
>
> If this 404 is unexpected, double check the last part of the trace to see if
> it should have evaluated to null.
>
>
> I'd appreciate a hand, including any bit of documentation I might have
> missed.
>
>

--
Kohsuke Kawaguchi
Sun Microsystems                   http://weblogs.java.net/blog/kohsuke/

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Are doCheckXyz validators run during global configuration?

Bill Bruyn
kohsuke wrote
Any chance you can file an issue for this, so that I can keep track?
Sure, happy to.

Is there a way to make this work in the meantime?