-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
Jenkins 2.387.2
JOB-DSL 1.83
The Action for removed jobs is not updated to previously removed jobs if it's changed from one strategy to another
Steps to reproduce:
- Configure JOB DSL --> Action for removed jobs: Disable
- Lets assume that the DSL script contains two Jobs named Test-1 and Test-2
. . pipelineJob('F__Folder1/F__Folder2/Test-1') { description('Test-1 Job') } pipelineJob('F__Folder1/F__Folder2/Test-2') { description('Test-2 Job') } . .
- Run the Seed Job the result will be two Jobs Test-1 and Test-2 are generated
- Now remove Test-2 job from the DSL scripts
. . pipelineJob('F__Folder1/F__Folder2/Test-1') { description('Test-1 Job') } . .
- Run the Seed Job the result will be Job Test-2 will be disabled
- Now change the JOB DSL configuration --> Action for removed jobs: Delete
- Run the Seed Job the result will be the same for Job Test-2, which will be disabled and it will not be deleted
- Which is unexpected behaviour as the Job Test-2 is still tracked by the Seed job. However the new config strategy which is 'Delete' is not applied to this previously removed Job Test-2 (which is already disabled as per the old strategy) before the strategy configuration change.
- Now remove Test-1 Job from the DSL scripts
- Run the Seed Job the result will be Job Test-1 will be deleted, However Job Test-2 will still exists and disabled.
- Conclusion:
- The Action for removed jobs strategy configuration is only applied for all the Jobs that are removed from the DSL scripts since the configuration strategy selection and in case the strategy configuration is changed, this new strategy does not apply for all the previously affected Jobs with the old strategy (while the old strategy remains in effect for these jobs).
- Expected behaviour:
- Action for removed jobs in case changed should be updated and applied for any previously tracked removed jobs that were affected by the old strategy. Not only to the newly removed jobs since the strategy change.