Skip to content

Commit

Permalink
[FIXED JENKINS-36446] Ensure all plugin extensions are initialized be…
Browse files Browse the repository at this point in the history
…fore migration (#150)
  • Loading branch information
stephenc authored and lanwen committed Oct 19, 2016
1 parent a9b9b28 commit c1ab72c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main/java/org/jenkinsci/plugins/github/GitHubPlugin.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package org.jenkinsci.plugins.github;

import hudson.Plugin;
import hudson.init.InitMilestone;
import hudson.init.Initializer;
import org.jenkinsci.plugins.github.config.GitHubPluginConfig;
import org.jenkinsci.plugins.github.migration.Migrator;

import javax.annotation.Nonnull;

import static hudson.init.InitMilestone.PLUGINS_PREPARED;
import static hudson.init.InitMilestone.PLUGINS_STARTED;
import static org.apache.commons.lang3.ObjectUtils.defaultIfNull;

/**
Expand All @@ -30,10 +29,12 @@ public static void addXStreamAliases() {
}

/**
* Launches migration after plugin already initialized.
* Launches migration after all extensions have been augmented as we need to ensure that the credentials plugin
* has been initialized.
* We need ensure that migrator will run after xstream aliases will be added.
* @see <a href="https://issues.jenkins-ci.org/browse/JENKINS-36446>JENKINS-36446</a>
*/
@Initializer(after = PLUGINS_PREPARED, before = PLUGINS_STARTED)
@Initializer(after = InitMilestone.EXTENSIONS_AUGMENTED, before = InitMilestone.JOB_LOADED)
public static void runMigrator() throws Exception {
new Migrator().migrate();
}
Expand Down

0 comments on commit c1ab72c

Please sign in to comment.