Finally I have ended with following solution.

1. add removed fields and mark them as transient
2. register static method with @Initializer(after = 
InitMilestone.JOB_LOADED)
3. for each job do check whether new job property exists if not create new 
one and move transient fields to it and then add new job property to the job

does it go? what do you think guys?

On Thursday, July 31, 2014 2:21:05 PM UTC+4, addic...@gmail.com wrote:
>
> Thanks, Stephen. nice approach. but what to do if I just moved some fields 
> from one job property to another new one (not swapping them entirely)
>
> On Tuesday, July 29, 2014 6:36:30 PM UTC+4, Stephen Connolly wrote:
>>
>> Note that you need to be swapping like for like... you can swap one 
>> Publisher for another Publisher, but you cannot swap a Publisher for a 
>> JobProperty
>>
>>
>> On 29 July 2014 15:35, Stephen Connolly <stephen.al...@gmail.com> wrote:
>>
>>> If you are swapping one JobProperty for another just have readResolve 
>>> return the correctly configured new JobProperty, e.g. see similar 
>>> https://github.com/jenkinsci/cloudbees-deployer-plugin/blob/master/src/main/java/org/jenkins/plugins/cloudbees/CloudbeesPublisher.java#L102
>>>  
>>>
>>> On 29 July 2014 14:25, <addic...@gmail.com> wrote:
>>>
>>>> thanks, slide. I have already gone through it. but I can't figure out 
>>>> the final solution of issue - 
>>>> so I can mark fields as transient and check their values at 
>>>> readResolve, what then? how to move these values to new job property?
>>>>
>>>> вторник, 29 июля 2014 г., 16:36:08 UTC+4 пользователь slide написал:
>>>>>
>>>>> This page, [1], has some good tips.
>>>>>
>>>>> slide
>>>>>
>>>>> 1 - https://wiki.jenkins-ci.org/display/JENKINS/Hint+on+
>>>>> retaining+backward+compatibility
>>>>>
>>>>>
>>>>> On Tue, Jul 29, 2014 at 5:30 AM, <addic...@gmail.com> wrote:
>>>>>
>>>>>>  Hi, everyone. Could you please advice me what to do at the 
>>>>>> following case:
>>>>>>
>>>>>> I have one JobProperty at the old version of plugin. after some 
>>>>>> refactoring I have created another one job property and moved attributes 
>>>>>> from old job property to new one.
>>>>>> the issue is how to upgrade old job configurations to new one 
>>>>>> seamlessly?
>>>>>>
>>>>>> thanks in advance
>>>>>>
>>>>>>
>>>>>>
>>>>>>  -- 
>>>>>> 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.
>>>>>>
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> -- 
>>>>> Website: http://earl-of-code.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-de...@googlegroups.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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to