modifying a @DataboundConstructor

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

modifying a @DataboundConstructor

Goyot, Martin
Hi there,

On the OAuth plugin I'm working on, I'd like to modify the @DataboundConstructor for the Realm. Issue is, if I modify it, whether be the signature or the inners of the function, the deserialization for previous instances won't work anymore hence breaking any previous installation of the plugin.

How am I supposed to proceed in such particular cases, when I need to update this constructor without breaking any config already set on Jenkins instances?

Here is some code for reference:

public class MySecurityRealm extends SecurityRealm {
    private String clientId;
    private Secret clientSecret;

    @DataBoundConstructor
    public MySecurityRealm(String clientId, String clientSecret) {
        this.clientId = Util.fixEmptyAndTrim(clientId);
        this.setClientSecret(Util.fixEmptyAndTrim(clientSecret));
    }
}

Thanks in advance !
Martin

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CA%2Bb6JB-wx%3D%2BPRcXb057-9idgZkL7kYw%3DSvmSsaR-mxRJ9_g96A%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: modifying a @DataboundConstructor

Ulli Hafner


Am 08.07.2020 um 10:16 schrieb Goyot, Martin <[hidden email]>:

Hi there,

On the OAuth plugin I'm working on, I'd like to modify the @DataboundConstructor for the Realm. Issue is, if I modify it, whether be the signature or the inners of the function, the deserialization for previous instances won't work anymore hence breaking any previous installation of the plugin.

How am I supposed to proceed in such particular cases, when I need to update this constructor without breaking any config already set on Jenkins instances?


The serialization does not use the constructor. You need to provide a readResolve method that will map the old fields to the new fields.

Here is some code for reference:

public class MySecurityRealm extends SecurityRealm {
    private String clientId;
    private Secret clientSecret;

    @DataBoundConstructor
    public MySecurityRealm(String clientId, String clientSecret) {
        this.clientId = Util.fixEmptyAndTrim(clientId);
        this.setClientSecret(Util.fixEmptyAndTrim(clientSecret));
    }
}

Thanks in advance !
Martin

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CA%2Bb6JB-wx%3D%2BPRcXb057-9idgZkL7kYw%3DSvmSsaR-mxRJ9_g96A%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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/E316B1D7-CCBE-4BCE-A50C-E64A53A88E68%40gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: modifying a @DataboundConstructor

Goyot, Martin
Thanks Ullrich!

Do you have any pointer for me as to how to proceed?

Le mer. 8 juil. 2020 à 10:34, Ullrich Hafner <[hidden email]> a écrit :


Am 08.07.2020 um 10:16 schrieb Goyot, Martin <[hidden email]>:

Hi there,

On the OAuth plugin I'm working on, I'd like to modify the @DataboundConstructor for the Realm. Issue is, if I modify it, whether be the signature or the inners of the function, the deserialization for previous instances won't work anymore hence breaking any previous installation of the plugin.

How am I supposed to proceed in such particular cases, when I need to update this constructor without breaking any config already set on Jenkins instances?


The serialization does not use the constructor. You need to provide a readResolve method that will map the old fields to the new fields.

Here is some code for reference:

public class MySecurityRealm extends SecurityRealm {
    private String clientId;
    private Secret clientSecret;

    @DataBoundConstructor
    public MySecurityRealm(String clientId, String clientSecret) {
        this.clientId = Util.fixEmptyAndTrim(clientId);
        this.setClientSecret(Util.fixEmptyAndTrim(clientSecret));
    }
}

Thanks in advance !
Martin

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CA%2Bb6JB-wx%3D%2BPRcXb057-9idgZkL7kYw%3DSvmSsaR-mxRJ9_g96A%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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/E316B1D7-CCBE-4BCE-A50C-E64A53A88E68%40gmail.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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CA%2Bb6JB8J4-AHbMyb%3DWDATiXGvtnuw6YcEcB-pV0SPc4Ju6xNkA%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: modifying a @DataboundConstructor

Ulli Hafner
https://wiki.jenkins.io/display/JENKINS/Hint+on+retaining+backward+compatibility

It would help if you could describe the exact changes in your class (old vs. new version).

Am 08.07.2020 um 10:51 schrieb Goyot, Martin <[hidden email]>:

Thanks Ullrich!

Do you have any pointer for me as to how to proceed?

Le mer. 8 juil. 2020 à 10:34, Ullrich Hafner <[hidden email]> a écrit :


Am 08.07.2020 um 10:16 schrieb Goyot, Martin <[hidden email]>:

Hi there,

On the OAuth plugin I'm working on, I'd like to modify the @DataboundConstructor for the Realm. Issue is, if I modify it, whether be the signature or the inners of the function, the deserialization for previous instances won't work anymore hence breaking any previous installation of the plugin.

How am I supposed to proceed in such particular cases, when I need to update this constructor without breaking any config already set on Jenkins instances?


The serialization does not use the constructor. You need to provide a readResolve method that will map the old fields to the new fields.

Here is some code for reference:

public class MySecurityRealm extends SecurityRealm {
    private String clientId;
    private Secret clientSecret;

    @DataBoundConstructor
    public MySecurityRealm(String clientId, String clientSecret) {
        this.clientId = Util.fixEmptyAndTrim(clientId);
        this.setClientSecret(Util.fixEmptyAndTrim(clientSecret));
    }
}

Thanks in advance !
Martin

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CA%2Bb6JB-wx%3D%2BPRcXb057-9idgZkL7kYw%3DSvmSsaR-mxRJ9_g96A%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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/E316B1D7-CCBE-4BCE-A50C-E64A53A88E68%40gmail.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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CA%2Bb6JB8J4-AHbMyb%3DWDATiXGvtnuw6YcEcB-pV0SPc4Ju6xNkA%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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/1C9C0447-9863-4833-A03A-9EF3ADC9872A%40gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: modifying a @DataboundConstructor

Matt Sicker
In reply to this post by Goyot, Martin
There's an automatic converter between String and Secret when loading
XML files via XStream in Jenkins. The only compatibility concerns you
should have here are for any code that directly calls that constructor
or uses the string value of the secret.

On Wed, Jul 8, 2020 at 3:51 AM Goyot, Martin <[hidden email]> wrote:

>
> Thanks Ullrich!
>
> Do you have any pointer for me as to how to proceed?
>
> Le mer. 8 juil. 2020 à 10:34, Ullrich Hafner <[hidden email]> a écrit :
>>
>>
>>
>> Am 08.07.2020 um 10:16 schrieb Goyot, Martin <[hidden email]>:
>>
>> Hi there,
>>
>> On the OAuth plugin I'm working on, I'd like to modify the @DataboundConstructor for the Realm. Issue is, if I modify it, whether be the signature or the inners of the function, the deserialization for previous instances won't work anymore hence breaking any previous installation of the plugin.
>>
>> How am I supposed to proceed in such particular cases, when I need to update this constructor without breaking any config already set on Jenkins instances?
>>
>>
>> The serialization does not use the constructor. You need to provide a readResolve method that will map the old fields to the new fields.
>>
>> Here is some code for reference:
>>
>> public class MySecurityRealm extends SecurityRealm {
>>     private String clientId;
>>     private Secret clientSecret;
>>
>>     @DataBoundConstructor
>>     public MySecurityRealm(String clientId, String clientSecret) {
>>         this.clientId = Util.fixEmptyAndTrim(clientId);
>>         this.setClientSecret(Util.fixEmptyAndTrim(clientSecret));
>>     }
>> }
>>
>> Thanks in advance !
>> Martin
>>
>> --
>> 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 [hidden email].
>> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CA%2Bb6JB-wx%3D%2BPRcXb057-9idgZkL7kYw%3DSvmSsaR-mxRJ9_g96A%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 [hidden email].
>> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/E316B1D7-CCBE-4BCE-A50C-E64A53A88E68%40gmail.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 [hidden email].
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CA%2Bb6JB8J4-AHbMyb%3DWDATiXGvtnuw6YcEcB-pV0SPc4Ju6xNkA%40mail.gmail.com.



--
Matt Sicker
Senior Software Engineer, CloudBees

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAEot4ozZDBe3yKLAVUWjFYiUPjD5NtweBqW0%2BozvBPr5hb1ScA%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: modifying a @DataboundConstructor

Goyot, Martin
In reply to this post by Ulli Hafner
Sure,

so the old version was:

public class MySecurityRealm extends SecurityRealm {
    private String clientId;
    private Secret clientSecret;

    @DataBoundConstructor
    public MySecurityRealm(String clientId, String clientSecret) {
        this.clientId = Util.fixEmptyAndTrim(clientId);
        this.setClientSecret(Util.fixEmptyAndTrim(clientSecret));
    }
}

And the new is:


public class MySecurityRealm extends SecurityRealm {
    private MyConfiguration configuration;

    @DataBoundConstructor
    public MySecurityRealm(String clientId, String clientSecret) {
        this.configuration = new MyConfiguration(
          Util.fixEmptyAndTrim(clientId),
          Secret.fromString(Util.fixEmptyAndTrim(clientSecret))
        );
    }
}

Something along those lines.

Le mer. 8 juil. 2020 à 15:50, Ullrich Hafner <[hidden email]> a écrit :
https://wiki.jenkins.io/display/JENKINS/Hint+on+retaining+backward+compatibility

It would help if you could describe the exact changes in your class (old vs. new version).

Am 08.07.2020 um 10:51 schrieb Goyot, Martin <[hidden email]>:

Thanks Ullrich!

Do you have any pointer for me as to how to proceed?

Le mer. 8 juil. 2020 à 10:34, Ullrich Hafner <[hidden email]> a écrit :


Am 08.07.2020 um 10:16 schrieb Goyot, Martin <[hidden email]>:

Hi there,

On the OAuth plugin I'm working on, I'd like to modify the @DataboundConstructor for the Realm. Issue is, if I modify it, whether be the signature or the inners of the function, the deserialization for previous instances won't work anymore hence breaking any previous installation of the plugin.

How am I supposed to proceed in such particular cases, when I need to update this constructor without breaking any config already set on Jenkins instances?


The serialization does not use the constructor. You need to provide a readResolve method that will map the old fields to the new fields.

Here is some code for reference:

public class MySecurityRealm extends SecurityRealm {
    private String clientId;
    private Secret clientSecret;

    @DataBoundConstructor
    public MySecurityRealm(String clientId, String clientSecret) {
        this.clientId = Util.fixEmptyAndTrim(clientId);
        this.setClientSecret(Util.fixEmptyAndTrim(clientSecret));
    }
}

Thanks in advance !
Martin

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CA%2Bb6JB-wx%3D%2BPRcXb057-9idgZkL7kYw%3DSvmSsaR-mxRJ9_g96A%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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/E316B1D7-CCBE-4BCE-A50C-E64A53A88E68%40gmail.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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CA%2Bb6JB8J4-AHbMyb%3DWDATiXGvtnuw6YcEcB-pV0SPc4Ju6xNkA%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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/1C9C0447-9863-4833-A03A-9EF3ADC9872A%40gmail.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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CA%2Bb6JB9Bz-YyMi9oC1mrRWZdDtteCszf7FmpCOxHEQLRmrKRQw%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: modifying a @DataboundConstructor

Daniel Beck
You want something like this:

-----

public class MySecurityRealm extends SecurityRealm {
    private MyConfiguration configuration;
    private transient String clientId;
    private transient Secret clientSecret;

    private Object readResolve() {
      if (clientId != null || clientSecret != null) {
        this.configuration = new MyConfiguration(…)
        clientId = null;
        clientSecret = null;
      }
      return this;
    }

    @DataBoundConstructor
    public MySecurityRealm(String clientId, String clientSecret) {
        this.configuration = new MyConfiguration(
          Util.fixEmptyAndTrim(clientId),
          Secret.fromString(Util.fixEmptyAndTrim(clientSecret))
        );
    }
}

-----

For examples, search for readResolve in Jenkins and plugin source code.


> On 8. Jul 2020, at 15:57, Goyot, Martin <[hidden email]> wrote:
>
> Sure,
>
> so the old version was:
>
> public class MySecurityRealm extends SecurityRealm {
>     private String clientId;
>     private Secret clientSecret;
>
>     @DataBoundConstructor
>     public MySecurityRealm(String clientId, String clientSecret) {
>         this.clientId = Util.fixEmptyAndTrim(clientId);
>         this.setClientSecret(Util.fixEmptyAndTrim(clientSecret));
>     }
> }
>
> And the new is:
>
>
> public class MySecurityRealm extends SecurityRealm {
>     private MyConfiguration configuration;
>
>     @DataBoundConstructor
>     public MySecurityRealm(String clientId, String clientSecret) {
>         this.configuration = new MyConfiguration(
>           Util.fixEmptyAndTrim(clientId),
>           Secret.fromString(Util.fixEmptyAndTrim(clientSecret))
>         );
>     }
> }
>
> Something along those lines.
>
> Le mer. 8 juil. 2020 à 15:50, Ullrich Hafner <[hidden email]> a écrit :
> https://wiki.jenkins.io/display/JENKINS/Hint+on+retaining+backward+compatibility
>
> It would help if you could describe the exact changes in your class (old vs. new version).
>
>> Am 08.07.2020 um 10:51 schrieb Goyot, Martin <[hidden email]>:
>>
>> Thanks Ullrich!
>>
>> Do you have any pointer for me as to how to proceed?
>>
>> Le mer. 8 juil. 2020 à 10:34, Ullrich Hafner <[hidden email]> a écrit :
>>
>>
>>> Am 08.07.2020 um 10:16 schrieb Goyot, Martin <[hidden email]>:
>>>
>>> Hi there,
>>>
>>> On the OAuth plugin I'm working on, I'd like to modify the @DataboundConstructor for the Realm. Issue is, if I modify it, whether be the signature or the inners of the function, the deserialization for previous instances won't work anymore hence breaking any previous installation of the plugin.
>>>
>>> How am I supposed to proceed in such particular cases, when I need to update this constructor without breaking any config already set on Jenkins instances?
>>>
>>
>> The serialization does not use the constructor. You need to provide a readResolve method that will map the old fields to the new fields.
>>
>>> Here is some code for reference:
>>>
>>> public class MySecurityRealm extends SecurityRealm {
>>>     private String clientId;
>>>     private Secret clientSecret;
>>>
>>>     @DataBoundConstructor
>>>     public MySecurityRealm(String clientId, String clientSecret) {
>>>         this.clientId = Util.fixEmptyAndTrim(clientId);
>>>         this.setClientSecret(Util.fixEmptyAndTrim(clientSecret));
>>>     }
>>> }
>>>
>>> Thanks in advance !
>>> Martin
>>>
>>> --
>>> 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 [hidden email].
>>> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CA%2Bb6JB-wx%3D%2BPRcXb057-9idgZkL7kYw%3DSvmSsaR-mxRJ9_g96A%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 [hidden email].
>> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/E316B1D7-CCBE-4BCE-A50C-E64A53A88E68%40gmail.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 [hidden email].
>> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CA%2Bb6JB8J4-AHbMyb%3DWDATiXGvtnuw6YcEcB-pV0SPc4Ju6xNkA%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 [hidden email].
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/1C9C0447-9863-4833-A03A-9EF3ADC9872A%40gmail.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 [hidden email].
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CA%2Bb6JB9Bz-YyMi9oC1mrRWZdDtteCszf7FmpCOxHEQLRmrKRQw%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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/28EB61A5-5DFF-4BC4-8CEF-4C13FDDD7D52%40beckweb.net.
Reply | Threaded
Open this post in threaded view
|

Re: modifying a @DataboundConstructor

Goyot, Martin
Thank you very much! I'll try this!

Le mer. 8 juil. 2020 à 22:32, Daniel Beck <[hidden email]> a écrit :
You want something like this:

-----

public class MySecurityRealm extends SecurityRealm {
    private MyConfiguration configuration;
    private transient String clientId;
    private transient Secret clientSecret;

    private Object readResolve() {
      if (clientId != null || clientSecret != null) {
        this.configuration = new MyConfiguration(…)
        clientId = null;
        clientSecret = null;
      }
      return this;
    }

    @DataBoundConstructor
    public MySecurityRealm(String clientId, String clientSecret) {
        this.configuration = new MyConfiguration(
          Util.fixEmptyAndTrim(clientId),
          Secret.fromString(Util.fixEmptyAndTrim(clientSecret))
        );
    }
}

-----

For examples, search for readResolve in Jenkins and plugin source code.


> On 8. Jul 2020, at 15:57, Goyot, Martin <[hidden email]> wrote:
>
> Sure,
>
> so the old version was:
>
> public class MySecurityRealm extends SecurityRealm {
>     private String clientId;
>     private Secret clientSecret;
>
>     @DataBoundConstructor
>     public MySecurityRealm(String clientId, String clientSecret) {
>         this.clientId = Util.fixEmptyAndTrim(clientId);
>         this.setClientSecret(Util.fixEmptyAndTrim(clientSecret));
>     }
> }
>
> And the new is:
>
>
> public class MySecurityRealm extends SecurityRealm {
>     private MyConfiguration configuration;
>
>     @DataBoundConstructor
>     public MySecurityRealm(String clientId, String clientSecret) {
>         this.configuration = new MyConfiguration(
>           Util.fixEmptyAndTrim(clientId),
>           Secret.fromString(Util.fixEmptyAndTrim(clientSecret))
>         );
>     }
> }
>
> Something along those lines.
>
> Le mer. 8 juil. 2020 à 15:50, Ullrich Hafner <[hidden email]> a écrit :
> https://wiki.jenkins.io/display/JENKINS/Hint+on+retaining+backward+compatibility
>
> It would help if you could describe the exact changes in your class (old vs. new version).
>
>> Am 08.07.2020 um 10:51 schrieb Goyot, Martin <[hidden email]>:
>>
>> Thanks Ullrich!
>>
>> Do you have any pointer for me as to how to proceed?
>>
>> Le mer. 8 juil. 2020 à 10:34, Ullrich Hafner <[hidden email]> a écrit :
>>
>>
>>> Am 08.07.2020 um 10:16 schrieb Goyot, Martin <[hidden email]>:
>>>
>>> Hi there,
>>>
>>> On the OAuth plugin I'm working on, I'd like to modify the @DataboundConstructor for the Realm. Issue is, if I modify it, whether be the signature or the inners of the function, the deserialization for previous instances won't work anymore hence breaking any previous installation of the plugin.
>>>
>>> How am I supposed to proceed in such particular cases, when I need to update this constructor without breaking any config already set on Jenkins instances?
>>>
>>
>> The serialization does not use the constructor. You need to provide a readResolve method that will map the old fields to the new fields.
>>
>>> Here is some code for reference:
>>>
>>> public class MySecurityRealm extends SecurityRealm {
>>>     private String clientId;
>>>     private Secret clientSecret;
>>>
>>>     @DataBoundConstructor
>>>     public MySecurityRealm(String clientId, String clientSecret) {
>>>         this.clientId = Util.fixEmptyAndTrim(clientId);
>>>         this.setClientSecret(Util.fixEmptyAndTrim(clientSecret));
>>>     }
>>> }
>>>
>>> Thanks in advance !
>>> Martin
>>>
>>> --
>>> 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 [hidden email].
>>> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CA%2Bb6JB-wx%3D%2BPRcXb057-9idgZkL7kYw%3DSvmSsaR-mxRJ9_g96A%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 [hidden email].
>> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/E316B1D7-CCBE-4BCE-A50C-E64A53A88E68%40gmail.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 [hidden email].
>> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CA%2Bb6JB8J4-AHbMyb%3DWDATiXGvtnuw6YcEcB-pV0SPc4Ju6xNkA%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 [hidden email].
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/1C9C0447-9863-4833-A03A-9EF3ADC9872A%40gmail.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 [hidden email].
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CA%2Bb6JB9Bz-YyMi9oC1mrRWZdDtteCszf7FmpCOxHEQLRmrKRQw%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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/28EB61A5-5DFF-4BC4-8CEF-4C13FDDD7D52%40beckweb.net.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CA%2Bb6JB9z%3DSZVnXrfij58q%3Dqy1PrTB_8hdiUhc7r-byD6nEux-A%40mail.gmail.com.