auto backward compatibility of plugin

38 views
Skip to first unread message

Nikhil Bhoski

unread,
Oct 12, 2019, 7:36:23 AM10/12/19
to Jenkins Developers
Hi Guys ,

I have plugin with few input parameters. one of the parameter which accepts installation path of a 3 rd party tool from user. Now in new version i am planning to add those installation through global tool config area and then auto populate during build as dropdown selection. I want to make sure when i make these changes and release it, existing users need not to reconfigure their jobs. i want my plugin to identify if old config.xml present . and if it is present then automatically add the path in tools section and populate the same as default under my build. please guide me if this auto upgrade is possible. i came across some method like readResolve() but did not understand fully. 

Nikhil

Jeff

unread,
Oct 12, 2019, 8:21:54 AM10/12/19
to jenkin...@googlegroups.com
Are you adding a new field to your global config? I think you might want the readResolve() method.

Here's some hints about maintaining backward compatibility https://wiki.jenkins.io/display/JENKINS/Hint+on+retaining+backward+compatibility

Best
Jeff

--
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/c0d217b2-1d75-46bc-b4b9-d68eec14db05%40googlegroups.com.

Nikhil Bhoski

unread,
Oct 13, 2019, 3:01:30 AM10/13/19
to Jenkins Developers
Thanks Jeff,
i am planning to add dropdown instead of text box from earlier layout which will be auto populated from the global tool configuration page.
Regards
Nikhil


On Saturday, 12 October 2019 17:51:54 UTC+5:30, Jeff wrote:
Are you adding a new field to your global config? I think you might want the readResolve() method.

Here's some hints about maintaining backward compatibility https://wiki.jenkins.io/display/JENKINS/Hint+on+retaining+backward+compatibility

Best
Jeff

On Sat, Oct 12, 2019 at 4:36 AM Nikhil Bhoski <nikhil...@gmail.com> wrote:
Hi Guys ,

I have plugin with few input parameters. one of the parameter which accepts installation path of a 3 rd party tool from user. Now in new version i am planning to add those installation through global tool config area and then auto populate during build as dropdown selection. I want to make sure when i make these changes and release it, existing users need not to reconfigure their jobs. i want my plugin to identify if old config.xml present . and if it is present then automatically add the path in tools section and populate the same as default under my build. please guide me if this auto upgrade is possible. i came across some method like readResolve() but did not understand fully. 

Nikhil

--
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 jenkin...@googlegroups.com.

Jeff

unread,
Oct 13, 2019, 9:45:26 AM10/13/19
to jenkin...@googlegroups.com
Does readResolve help? I would expect you just want to repopulate an existing string value on load?

Best
Jeff

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/711c7bcc-0220-4532-b19c-040f696b3dac%40googlegroups.com.

Nikhil Bhoski

unread,
Oct 16, 2019, 5:03:05 AM10/16/19
to Jenkins Developers
I tried below 
Read resolve did not seem to be working with this scenario. i may not be doing things rite . i tried below 

protected Object ReadResolve() {
        if(matlabRoot != null) {
            MatlabInstallation matlab = new MatlabInstallation("default", matlabRoot, null, false, false);
            this.setMatlabRoot(matlab.getHome());
            
        }
        return this;
    }


Where :
matlabRoot is my old field which i want to add it as installation section by name default and populate this default in my build step instead of matlabRoot

Daniel Beck

unread,
Oct 16, 2019, 7:19:53 AM10/16/19
to Jenkins Developers


> On 16. Oct 2019, at 11:03, Nikhil Bhoski <nikhil...@gmail.com> wrote:
>
> protected Object ReadResolve() {
>

It's called readResolve, not ReadResolve.

Reply all
Reply to author
Forward
0 new messages