public boolean configure(StaplerRequest req, JSONObject json) throws FormException {
req.bindJSON(this, json);
save();
return true;
}
--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr3Vq3AVbvMFQDiB2xApKiqT%3Dswcsr%3D606V5OuKVrkKZmA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/230C492B-23E2-4816-BB0A-5647E749AB15%40beckweb.net.
Right, so hopefully we already have docs on best practices for plugin developers ;)An issue remain. Let's consider I refactor Mailer plugin to adopt this approach (see https://github.com/ndeloof/mailer-plugin/commit/ffc57e0ff1cb1b74dc1d6fdcb2329a5b9141daaa), with a new nested optionalProperty describable SMTPAuthentication { username, password } to replace nullable attributes in Mailer$DescriptorI'll rewrite configure method as :public boolean configure(StaplerRequest req, JSONObject json) throws FormException {
req.bindJSON(this, json);
save();
return true;
}(by the way, shouldn't this be the default implementation ?)
But with this, if I UNCHECK the optional property, no "authentication" value is posted to JSON form, and I don't get SMTPAuthentication reset to null in my descriptor.AFAICT Describable mechanism documented here only supports immutable components.
Does this mean Descriptors would need to include an extra "reset" method to set all attributes to null / default value ?This also make me think this configuration mechanism isn't atomic, and there's some possible race condition for related attributes to have inconsistent values seen from another thread while the configuration is being changed.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr3Vq3AVbvMFQDiB2xApKiqT%3Dswcsr%3D606V5OuKVrkKZmA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANMVJz%3DDrRF%3DXM8rp0A-zyt4D6wTXTBU2eQ_YFZ%3DHjQyHxzGpw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr0fLxzZ_4JtTsedFY_-22wdLCJGBuR1e%3DOcKCdD9Zrz%3DA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr0%2Bd%2BE1RO8PTVeUHnpvH3367zd6D%2Bwa2%2BAeSTgTd9Zc4Q%40mail.gmail.com.
I wrote this documentation for plugin developers to understand the required changes so we can support Descriptor as configuration-as-code targets.I'll work on writing some pull-requests applying this approach to some major plugins.
2017-11-15 16:27 GMT+01:00 nicolas de loof <nicolas...@gmail.com>:
this is really work in progress, i.e not even tested on my own before I propose this in a PR :Pwas just for information that I was looking into implementing a fix for this idea
2017-11-15 16:24 GMT+01:00 Jesse Glick <jgl...@cloudbees.com>:
On Wed, Nov 15, 2017 at 9:51 AM, nicolas de loof
<nicolas...@gmail.com> wrote:
> proposed improvement to Descriptor.configure (WiP) :
> https://github.com/ndeloof/jenkins/tree/JENKINS-48018
If you are soliciting feedback, just file as a PR and mark as
`work-in-progress`. Easier to gather comments that way.
--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/99138212-72cf-47e8-b002-8e00974e1c44%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/eb597cea-7a8e-43ec-a311-42bc44a80c7b%40googlegroups.com.
URL global = ConfigurationAsCode.class.getClassLoader().getResource(cl+"/global.jelly");
URL global = descriptor.getKlass().toJavaClass().getClassLoader().getResource(cl+"/global.jelly");
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/8f73dced-21c7-4d43-8f55-f41da66c8ea0%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr2G8BuOuprwSpnSgT8uOof_KaWbW7m-P0C8ETHTa61afA%40mail.gmail.com.