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

Migrate from EE 8 to EE 9 #103

Merged
merged 1 commit into from
Feb 11, 2025
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
4 changes: 2 additions & 2 deletions src/main/java/org/jenkinsci/plugin/gitea/GiteaBrowser.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import org.apache.commons.lang.StringUtils;
import org.jenkinsci.plugin.gitea.servers.GiteaServers;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerRequest2;

/**
* A {@link GitRepositoryBrowser} for Gitea.
Expand Down Expand Up @@ -143,7 +143,7 @@ public String getDisplayName() {
* {@inheritDoc}
*/
@Override
public GiteaBrowser newInstance(StaplerRequest req, JSONObject jsonObject) throws FormException {
public GiteaBrowser newInstance(StaplerRequest2 req, JSONObject jsonObject) throws FormException {
return req.bindJSON(GiteaBrowser.class, jsonObject);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jenkinsci/plugin/gitea/GiteaLink.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
Icon icon = IconSet.icons.getIconByClassSpec(iconClassName + " icon-md");
if (icon != null) {
JellyContext ctx = new JellyContext();
ctx.setVariable("resURL", Stapler.getCurrentRequest().getContextPath() + Jenkins.RESOURCE_PATH);
ctx.setVariable("resURL", Stapler.getCurrentRequest2().getContextPath() + Jenkins.RESOURCE_PATH);

Check warning on line 90 in src/main/java/org/jenkinsci/plugin/gitea/GiteaLink.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 90 is not covered by tests
return icon.getQualifiedUrl(ctx);
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/org/jenkinsci/plugin/gitea/GiteaWebhookAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@
import hudson.model.UnprotectedRootAction;
import hudson.security.csrf.CrumbExclusion;
import hudson.util.HttpResponses;
import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jenkins.scm.api.SCMEvent;
import org.apache.commons.lang.StringUtils;
import org.kohsuke.stapler.HttpResponse;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerRequest2;

@Extension
public class GiteaWebhookAction extends CrumbExclusion implements UnprotectedRootAction {
Expand Down Expand Up @@ -70,7 +70,7 @@ public boolean process(HttpServletRequest req, HttpServletResponse resp, FilterC
return false;
}

public HttpResponse doPost(StaplerRequest request) throws IOException {
public HttpResponse doPost(StaplerRequest2 request) throws IOException {
String origin = SCMEvent.originOf(request);
if (!request.getMethod().equals("POST")) {
LOGGER.log(Level.FINE, "Received {0} request (expecting POST) from {1}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import jenkins.model.Jenkins;
import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerRequest2;

/**
* Represents the global configuration of Gitea servers.
Expand Down Expand Up @@ -214,7 +214,7 @@ public ListBoxModel getServerItems() {
* {@inheritDoc}
*/
@Override
public boolean configure(StaplerRequest req, JSONObject json) throws FormException {
public boolean configure(StaplerRequest2 req, JSONObject json) throws FormException {
req.bindJSON(this, json);
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
import org.jenkinsci.plugin.gitea.client.api.GiteaConnection;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.DataBoundSetter;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerRequest2;

public class GiteaAssetPublisher implements SimpleBuildStep, Describable<GiteaAssetPublisher> {

Expand Down Expand Up @@ -311,7 +311,7 @@ public boolean isApplicable(Class<? extends AbstractProject> jobType) {
}

@Override
public GiteaAssetPublisher newInstance(@NonNull StaplerRequest req, JSONObject formData) throws FormException {
public GiteaAssetPublisher newInstance(@NonNull StaplerRequest2 req, JSONObject formData) throws FormException {
return req.bindJSON(GiteaAssetPublisher.class, formData);
}

Expand Down
Loading