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

Github plugin dependency sporadically fails with NPE during tests

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • github-plugin
    • None

      GithubPlugin.postInitialize() runs Migrator.migrate(), which accesses ExtensionList through GithubPushTrigger.DescriptorImpl.get().

      ExtensionsList is not usable until PLUGINS_PREPARED is attained [1] and Plugin.postInitialize() call is not guaranteed to be run after PLUGINS_PREPARED (though it does happen to run after it most of the time).

      In the example log [2], Migrator.migrate is run at line 368, but PLUGINS_PREPARED is only attained at 499, almost before PLUGINS_STARTED.

      I think the migration should be run with @Initializer(after=PLUGINS_PREPARED) to be properly working.

      [1] https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/ExtensionList.java#L282
      [2] https://gist.github.com/atanasenko/d364aa30eb2aa07ecdb01af0e7b829be

            integer Kanstantsin Shautsou
            atanasenko Anton Tanasenko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: