-
Bug
-
Resolution: Fixed
-
Minor
-
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