Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-64746] public API hudson.model.UpdateCenter.HudsonUpgradeJob constructor signature change #5216

Merged
merged 6 commits into from
Feb 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would also be polite to add @since 2.266 for the Spring overloads.

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)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @deprecated use {@link HudsonUpgradeJob(UpdateSite site, Authentication auth)}
* @deprecated use {@link HudsonUpgradeJob(UpdateSite, Authentication)}

How is this not a build failure? Hmm…

*/
@Deprecated
jglick marked this conversation as resolved.
Show resolved Hide resolved
jglick marked this conversation as resolved.
Show resolved Hide resolved
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)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @deprecated use {@link HudsonDowngradeJob(UpdateSite site, Authentication auth)}
* @deprecated use {@link HudsonDowngradeJob(UpdateSite, Authentication)}

*/
@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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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