8000 [FIXED JENKINS-36446] Ensure all plugin extensions are initialized be… · srbala/github-plugin@c1ab72c · GitHub
[go: up one dir, main page]

Skip to content

Commit c1ab72c

Browse files
stephenclanwen
authored andcommitted
[FIXED JENKINS-36446] Ensure all plugin extensions are initialized before migration (jenkinsci#150)
1 parent a9b9b28 commit c1ab72c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/main/java/org/jenkinsci/plugins/github/GitHubPlugin.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
package org.jenkinsci.plugins.github;
22

33
import hudson.Plugin;
4+
import hudson.init.InitMilestone;
45
import hudson.init.Initializer;
56
import org.jenkinsci.plugins.github.config.GitHubPluginConfig;
67
import org.jenkinsci.plugins.github.migration.Migrator;
78

89
import javax.annotation.Nonnull;
910

10-
import static hudson.init.InitMilestone.PLUGINS_PREPARED;
11-
import static hudson.init.InitMilestone.PLUGINS_STARTED;
1211
import static org.apache.commons.lang3.ObjectUtils.defaultIfNull;
1312

1413
/**
@@ -30,10 +29,12 @@ public static void addXStreamAliases() {
3029
}
3130

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

0 commit comments

Comments
 (0)
0