Skip to content

Commit

Permalink
[JENKINS-64746] public API hudson.model.UpdateCenter.HudsonUpgradeJob…
Browse files Browse the repository at this point in the history
… constructor signature change (jenkinsci#5216)

Co-authored-by: Jesse Glick <jglick@cloudbees.com>
(cherry picked from commit 2c1e839)
  • Loading branch information
escoem authored and timja committed Feb 17, 2021
1 parent da74c0e commit 0b3ef72
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
35 changes: 35 additions & 0 deletions core/src/main/java/hudson/model/UpdateCenter.java
Original file line number Diff line number Diff line change
Expand Up @@ -2111,6 +2111,14 @@ public InstallationJob(Plugin plugin, UpdateSite site, Authentication auth) {
this(plugin,site,auth,false);
}

/**
* @deprecated use {@link InstallationJob(Plugin, UpdateSite, Authentication, boolean)}
*/
@Deprecated
public InstallationJob(Plugin plugin, UpdateSite site, org.acegisecurity.Authentication auth, boolean dynamicLoad) {
this(plugin, site, auth.toSpring(), dynamicLoad);
}

public InstallationJob(Plugin plugin, UpdateSite site, Authentication auth, boolean dynamicLoad) {
super(site, auth);
this.plugin = plugin;
Expand Down Expand Up @@ -2326,6 +2334,15 @@ public final class PluginDowngradeJob extends DownloadJob {

private final PluginManager pm = Jenkins.get().getPluginManager();

/**
* @deprecated use {@link PluginDowngradeJob(Plugin, UpdateSite, Authentication)}
*/
@Deprecated
public PluginDowngradeJob(Plugin plugin, UpdateSite site, org.acegisecurity.Authentication auth) {
this(plugin, site, auth.toSpring());
}


public PluginDowngradeJob(Plugin plugin, UpdateSite site, Authentication auth) {
super(site, auth);
this.plugin = plugin;
Expand Down Expand Up @@ -2410,6 +2427,15 @@ public String toString() {
* Represents the state of the upgrade activity of Jenkins core.
*/
public final class HudsonUpgradeJob extends DownloadJob {

/**
* @deprecated use {@link HudsonUpgradeJob(UpdateSite site, Authentication auth)}
*/
@Deprecated
public HudsonUpgradeJob(UpdateSite site, org.acegisecurity.Authentication auth) {
super(site, auth.toSpring());
}

public HudsonUpgradeJob(UpdateSite site, Authentication auth) {
super(site, auth);
}
Expand Down Expand Up @@ -2444,6 +2470,15 @@ protected void replace(File dst, File src) throws IOException {
}

public final class HudsonDowngradeJob extends DownloadJob {

/**
* @deprecated use {@link HudsonDowngradeJob(UpdateSite site, Authentication auth)}
*/
@Deprecated
public HudsonDowngradeJob(UpdateSite site, org.acegisecurity.Authentication auth) {
super(site, auth.toSpring());
}

public HudsonDowngradeJob(UpdateSite site, Authentication auth) {
super(site, auth);
}
Expand Down
4 changes: 3 additions & 1 deletion test/src/test/java/jenkins/install/InstallUtilTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.util.Map;
import java.util.UUID;

import hudson.security.ACL;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
Expand All @@ -52,6 +53,7 @@
import jenkins.model.Jenkins;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.security.core.Authentication;

/**
* Test
Expand Down Expand Up @@ -180,7 +182,7 @@ else if("Installing".equals(statusType)) {
json.put("dependencies", new JSONArray());
Plugin p = new Plugin(getId(), json);

InstallationJob job = new InstallationJob(p, null, null, false);
InstallationJob job = new InstallationJob(p, null, (Authentication) null, false);
job.status = status;
job.setCorrelationId(UUID.randomUUID()); // this indicates the plugin was 'directly selected'
updates.add(job);
Expand Down

0 comments on commit 0b3ef72

Please sign in to comment.