Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-64297

JEP-228 anticipation side effect (broken XStream annotations autodetection, pre-2.266)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • core
    • None
    • Jenkins 2.249.3
      promoted-builds 3.7
      deploy 1.16

      This is not really a bug report, just some notes about something I wish I knew / had understood earlier, about the side-effects of the upcoming JEP-228. Hopefully it might help someone who, like me, searches through Jira for clues about some recent XStream-related regressions.

      I'm in charge of some Jenkins servers which use, among many other plugins, an internal/proprietary plugin which relies on an autodetected @XStreamAlias annotation. It's been working fine for years, and I wasn't expecting it to break before whatever LTS comes after 2.266, with JEP-228 (XStream unforking). But today it broke, on Jenkins 2.249.3, after some apparently minor updates to a few other plugins...

      Why? Because in order to anticipate the upcoming JEP-228, some plugins have been updated to not rely on XSTream annotations autodetection anymore, and to explicitly call XStream.processAnnotations() instead. Examples:

      https://github.com/jenkinsci/deploy-plugin/pull/43

      https://github.com/jenkinsci/xunit-plugin/pull/84

      https://github.com/jenkinsci/promoted-builds-plugin/pull/150

      If you read JEP-228, the necessity of such changes for compatibility with future Jenkins versions is well explained. Something else which is explained is that the historical XStream annotations autodetection was fragile anyway: the thing is, if some plugin happens to call XStream.processAnnotations(), then it alters XStream configuration an may break detection of annotations in your plugin:

      https://github.com/jenkinsci/jep/blob/master/jep/228/README.adoc#autodetection-of-annotations

      This implies many plugins relying on autodetection of annotations were already broken under some conditions, depending on which other plugins were installed and the precise order of operations.

      Ok, when I've first read JEP-228 (after jglick's blog post), I thought I understood all that, and was glad that thing would eventually improve. What I had not seen coming was the irony, the fact that anticipation of JEP-228 on some plugins would actually become the trigger of regressions on other plugins as soon as right now. After years of luck, I've seen for the first time XStream annotations autodetection actually not working anymore, and some existing jobs configuration not being read correctly. Simply because I have updated "promoted-builds" and "deploy" plugins to their latest versions, which makes them ready for the future, but also, as a side-effect, alters XStream behaviour for other plugins.

      To be clear, I'm not complaining, or requesting that anything gets "fixed". I'm blogging. The only thing which, maybe, could have helped avoiding my specific situation would have been warnings in the releases notes of the updated plugins ("Changes in this version might have side-effects on how XStream works for other plugins").

      Thanks for reading, I will now submit and close this issue

            tom_gl Thomas de Grenier de Latour
            tom_gl Thomas de Grenier de Latour
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: