Skip to content

Commit 1be1698

Browse files
authored
Migrate from EE 8 to EE 9 (#207)
1 parent 8ee0248 commit 1be1698

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

pom.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>org.jenkins-ci.plugins</groupId>
66
<artifactId>plugin</artifactId>
7-
<version>4.88</version>
7+
<version>5.7</version>
88
<relativePath />
99
</parent>
1010

@@ -50,8 +50,8 @@
5050
<properties>
5151
<changelist>999999-SNAPSHOT</changelist>
5252
<!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
53-
<jenkins.baseline>2.452</jenkins.baseline>
54-
<jenkins.version>${jenkins.baseline}.4</jenkins.version>
53+
<jenkins.baseline>2.479</jenkins.baseline>
54+
<jenkins.version>${jenkins.baseline}.1</jenkins.version>
5555
<jira-rest-client.version>5.2.7</jira-rest-client.version>
5656
<fugue.version>4.7.2</fugue.version>
5757
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
@@ -64,7 +64,7 @@
6464
<dependency>
6565
<groupId>io.jenkins.tools.bom</groupId>
6666
<artifactId>bom-${jenkins.baseline}.x</artifactId>
67-
<version>3654.v237e4a_f2d8da_</version>
67+
<version>3850.vb_c5319efa_e29</version>
6868
<type>pom</type>
6969
<scope>import</scope>
7070
</dependency>

src/main/java/org/jenkinsci/plugins/JiraTestResultReporter/JiraTestAction.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,11 @@ public JiraTestAction(JiraTestData testData, CaseResult test) {
129129
* @return
130130
*/
131131
private Job initProject() {
132-
if (Stapler.getCurrentRequest() == null) {
132+
if (Stapler.getCurrentRequest2() == null) {
133133
return null;
134134
}
135135

136-
List<Ancestor> ancestors = Stapler.getCurrentRequest().getAncestors();
136+
List<Ancestor> ancestors = Stapler.getCurrentRequest2().getAncestors();
137137
for (Ancestor ancestor : ancestors) {
138138
if (ancestor.getObject() instanceof AbstractProject) {
139139
return (AbstractProject) ancestor.getObject();

src/main/java/org/jenkinsci/plugins/JiraTestResultReporter/JiraTestDataPublisher.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
import org.kohsuke.stapler.DataBoundSetter;
8282
import org.kohsuke.stapler.QueryParameter;
8383
import org.kohsuke.stapler.Stapler;
84-
import org.kohsuke.stapler.StaplerRequest;
84+
import org.kohsuke.stapler.StaplerRequest2;
8585
import org.kohsuke.stapler.bind.JavaScriptMethod;
8686
import org.kohsuke.stapler.interceptor.RequirePOST;
8787

@@ -157,7 +157,7 @@ public List<String> getAttachments(String className, String name) {
157157
* @return
158158
*/
159159
private @CheckForNull AbstractProject getJobName() {
160-
StaplerRequest currentRequest = Stapler.getCurrentRequest();
160+
StaplerRequest2 currentRequest = Stapler.getCurrentRequest2();
161161
return currentRequest != null ? currentRequest.findAncestorObject(AbstractProject.class) : null;
162162
}
163163

@@ -229,9 +229,9 @@ public JiraTestDataPublisher(
229229
.withConfigs(Util.fixNull(configs))
230230
.build();
231231

232-
if (Stapler.getCurrentRequest() != null) {
232+
if (Stapler.getCurrentRequest2() != null) {
233233
// classic job - e.g. Freestyle project, Matrix project, etc.
234-
AbstractProject project = Stapler.getCurrentRequest().findAncestorObject(AbstractProject.class);
234+
AbstractProject project = Stapler.getCurrentRequest2().findAncestorObject(AbstractProject.class);
235235
TestToIssueMapping.getInstance().register(project);
236236
JobConfigMapping.getInstance().saveConfig(project, getJobConfig());
237237
} else {
@@ -585,7 +585,7 @@ public String getDisplayName() {
585585
* @throws FormException
586586
*/
587587
@Override
588-
public boolean configure(StaplerRequest req, JSONObject json) throws FormException {
588+
public boolean configure(StaplerRequest2 req, JSONObject json) throws FormException {
589589

590590
try {
591591
jiraUri = new URI(json.getString("jiraUrl"));
@@ -660,7 +660,7 @@ private void tryCreatingStatusToCategoryMap() {
660660
* @throws FormException
661661
*/
662662
@Override
663-
public TestDataPublisher newInstance(StaplerRequest req, JSONObject json) throws FormException {
663+
public TestDataPublisher newInstance(StaplerRequest2 req, JSONObject json) throws FormException {
664664
String projectKey = json.getString("projectKey");
665665
String issueType = json.getString("issueType");
666666
metadataCache.removeCacheEntry(projectKey, issueType);
@@ -787,7 +787,7 @@ public ListBoxModel doFillIssueTypeItems(@QueryParameter String projectKey) {
787787
@JavaScriptMethod
788788
public FormValidation validateFieldConfigs(String jsonForm) throws FormException {
789789
// extracting the configurations for associated with this plugin (we receive the entire form)
790-
StaplerRequest req = Stapler.getCurrentRequest();
790+
StaplerRequest2 req = Stapler.getCurrentRequest2();
791791
JSONObject jsonObject = JSONObject.fromObject(jsonForm);
792792
JSONObject publishers = jsonObject.getJSONObject("publisher");
793793
JSONObject jiraPublisherJSON = null;

src/main/java/org/jenkinsci/plugins/JiraTestResultReporter/api/TestToIssueMappingApi.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
import hudson.model.Api;
88
import hudson.model.Item;
99
import hudson.model.Job;
10+
import jakarta.servlet.ServletException;
11+
import jakarta.servlet.http.HttpServletResponse;
1012
import java.io.IOException;
11-
import javax.servlet.ServletException;
12-
import javax.servlet.http.HttpServletResponse;
1313
import jenkins.model.Jenkins;
1414
import org.jenkinsci.plugins.JiraTestResultReporter.TestToIssueMapping;
15-
import org.kohsuke.stapler.StaplerRequest;
16-
import org.kohsuke.stapler.StaplerResponse;
15+
import org.kohsuke.stapler.StaplerRequest2;
16+
import org.kohsuke.stapler.StaplerResponse2;
1717

1818
/**
1919
* Created by tuicu on 12/08/16.
@@ -31,7 +31,7 @@ public TestToIssueMappingApi() {
3131
}
3232

3333
@Override
34-
public void doJson(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
34+
public void doJson(StaplerRequest2 req, StaplerResponse2 rsp) throws IOException, ServletException {
3535
String jobName = req.getParameter("job");
3636
JsonElement result;
3737

0 commit comments

Comments
 (0)