Skip to content

Commit

Permalink
feat: bump LTS line and other related dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
rantoniuk committed Jan 12, 2025
1 parent 395d7b3 commit bab4eb8
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 33 deletions.
3 changes: 1 addition & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ buildPlugin(
forkCount: '1C', // run this number of tests in parallel for faster feedback. If the number terminates with a 'C', the value will be multiplied by the number of available CPU cores
useContainerAgent: true, // Set to `false` if you need to use Docker for containerized tests
configurations: [
[platform: 'linux', jdk: 17],
[platform: 'linux', jdk: 21],
[platform: 'windows', jdk: 17],
[platform: 'linux', jdk: 17],
[platform: 'linux', jdk: 21]
])
15 changes: 6 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.86</version>
<version>5.4</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -52,20 +52,17 @@
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
<jira-rest-client.version>5.2.7</jira-rest-client.version>
<fugue.version>4.7.2</fugue.version>
<!-- TODO: Remove when 2.472 is available in LTS -->
<jenkins.version>2.472</jenkins.version>
<!-- TODO JENKINS-73339 until in parent POM -->
<jenkins-test-harness.version>2254.vcff7a_d4969e5</jenkins-test-harness.version>
<!-- jenkins -->
<jenkins.version>2.479.3</jenkins.version>
<spotless.check.skip>false</spotless.check.skip>
<maven.compiler.release>17</maven.compiler.release>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.462.x</artifactId>
<version>3258.vcdcf15936a_fd</version>
<artifactId>bom-2.479.x</artifactId>
<version>3875.v1df09947cde6</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -77,7 +74,7 @@
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20240303</version>
<version>20241224</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/hudson/plugins/jira/CredentialsHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl;
import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.model.Descriptor.FormException;
import hudson.model.Item;
import hudson.model.Queue;
import hudson.model.queue.Tasks;
Expand Down Expand Up @@ -53,7 +54,7 @@ protected static StandardUsernamePasswordCredentials lookupSystemCredentials(
}

protected static StandardUsernamePasswordCredentials migrateCredentials(
@NonNull String username, String password, @CheckForNull URL url) {
@NonNull String username, String password, @CheckForNull URL url) throws FormException {
List<StandardUsernamePasswordCredentials> credentials = CredentialsMatchers.filter(
CredentialsProvider.lookupCredentials(
StandardUsernamePasswordCredentials.class,
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/hudson/plugins/jira/JiraSite.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import hudson.Util;
import hudson.model.AbstractDescribableImpl;
import hudson.model.Descriptor;
import hudson.model.Descriptor.FormException;
import hudson.model.Item;
import hudson.model.ItemGroup;
import hudson.model.Job;
Expand Down Expand Up @@ -306,7 +307,8 @@ public JiraSite(
boolean updateJiraIssueForAllStatus,
@CheckForNull String groupVisibility,
@CheckForNull String roleVisibility,
boolean useHTTPAuth) {
boolean useHTTPAuth)
throws FormException {
this(
url,
alternativeUrl,
Expand All @@ -332,7 +334,8 @@ public JiraSite(
boolean updateJiraIssueForAllStatus,
String groupVisibility,
String roleVisibility,
boolean useHTTPAuth) {
boolean useHTTPAuth)
throws FormException {
this(
url,
alternativeUrl,
Expand Down Expand Up @@ -646,8 +649,9 @@ public void setUpdateJiraIssueForAllStatus(boolean updateJiraIssueForAllStatus)
}

@SuppressWarnings("unused")
protected Object readResolve() {
protected Object readResolve() throws FormException {
JiraSite jiraSite;

if (credentialsId == null && userName != null && password != null) { // Migrate credentials
jiraSite = new JiraSite(
url,
Expand Down
9 changes: 5 additions & 4 deletions src/test/java/hudson/plugins/jira/CredentialsHelperTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.cloudbees.plugins.credentials.domains.DomainSpecification;
import com.cloudbees.plugins.credentials.domains.HostnameSpecification;
import com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl;
import hudson.model.Descriptor.FormException;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
Expand All @@ -29,7 +30,7 @@ public class CredentialsHelperTest {
public JenkinsRule r = new JenkinsRule();

@Test
public void lookupSystemCredentials() throws IOException {
public void lookupSystemCredentials() throws IOException, FormException {
assertNull(CredentialsHelper.lookupSystemCredentials("nonexistent-credentials-id", null));

StandardUsernamePasswordCredentials c =
Expand All @@ -41,7 +42,7 @@ public void lookupSystemCredentials() throws IOException {
}

@Test
public void lookupSystemCredentialsWithDomainRestriction() throws IOException {
public void lookupSystemCredentialsWithDomainRestriction() throws IOException, FormException {
Domain domain = new Domain(
"example",
"test domain",
Expand All @@ -56,7 +57,7 @@ public void lookupSystemCredentialsWithDomainRestriction() throws IOException {
}

@Test
public void migrateCredentials() throws MalformedURLException {
public void migrateCredentials() throws MalformedURLException, FormException {
assertThat(
CredentialsProvider.lookupStores(r.jenkins).iterator().next().getCredentials(Domain.global()), empty());

Expand All @@ -70,7 +71,7 @@ public void migrateCredentials() throws MalformedURLException {
}

@Test
public void migrateCredentialsWithExsitingCredentials() throws IOException {
public void migrateCredentialsWithExsitingCredentials() throws IOException, FormException {
Domain domain = new Domain(
"example",
"test domain",
Expand Down
3 changes: 2 additions & 1 deletion src/test/java/hudson/plugins/jira/DescriptorImplTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl;
import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.model.Descriptor.FormException;
import hudson.model.FreeStyleBuild;
import hudson.model.FreeStyleProject;
import hudson.model.Item;
Expand Down Expand Up @@ -60,7 +61,7 @@ public class DescriptorImplTest {
JiraSite.Builder builder = spy(new JiraSite.Builder());

@Test
public void doFillCredentialsIdItems() throws IOException {
public void doFillCredentialsIdItems() throws IOException, FormException {

MockFolder dummy = r.createFolder("dummy");
r.jenkins.setSecurityRealm(r.createDummySecurityRealm());
Expand Down
12 changes: 6 additions & 6 deletions src/test/java/hudson/plugins/jira/JiraSiteSecurity1029Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@
import com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl;
import hudson.model.Item;
import hudson.model.User;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URI;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Base64;
import java.util.HashMap;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jenkins.model.Jenkins;
import jenkins.security.ApiTokenProperty;
import net.sf.json.JSONObject;
import org.eclipse.jetty.ee8.servlet.DefaultServlet;
import org.eclipse.jetty.ee8.servlet.ServletContextHandler;
import org.eclipse.jetty.ee8.servlet.ServletHolder;
import org.eclipse.jetty.ee9.servlet.DefaultServlet;
import org.eclipse.jetty.ee9.servlet.ServletContextHandler;
import org.eclipse.jetty.ee9.servlet.ServletHolder;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.htmlunit.HttpMethod;
Expand Down
16 changes: 9 additions & 7 deletions src/test/java/hudson/plugins/jira/JiraSiteTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.cloudbees.plugins.credentials.domains.DomainSpecification;
import com.cloudbees.plugins.credentials.domains.HostnameSpecification;
import com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl;
import hudson.model.Descriptor.FormException;
import hudson.model.FreeStyleProject;
import hudson.model.Job;
import hudson.plugins.jira.model.JiraIssue;
Expand Down Expand Up @@ -62,7 +63,7 @@ public void init() throws MalformedURLException {
}

@Test
public void createSessionWithProvidedCredentials() {
public void createSessionWithProvidedCredentials() throws FormException {
JiraSite site = new JiraSite(
validPrimaryUrl,
null,
Expand All @@ -82,7 +83,7 @@ public void createSessionWithProvidedCredentials() {

@Test
@Issue("JENKINS-64083")
public void createSessionWithGlobalCredentials() {
public void createSessionWithGlobalCredentials() throws FormException {
JiraSite site = new JiraSite(
validPrimaryUrl,
null,
Expand All @@ -101,7 +102,7 @@ public void createSessionWithGlobalCredentials() {
}

@Test
public void createSessionReturnsNullIfCredentialsIsNull() {
public void createSessionReturnsNullIfCredentialsIsNull() throws FormException {
JiraSite site = new JiraSite(
validPrimaryUrl,
null,
Expand All @@ -120,7 +121,7 @@ public void createSessionReturnsNullIfCredentialsIsNull() {
}

@Test
public void deserializeMigrateCredentials() throws MalformedURLException {
public void deserializeMigrateCredentials() throws MalformedURLException, FormException {
JiraSiteOld old = new JiraSiteOld(
validPrimaryUrl, null, ANY_USER, ANY_PASSWORD, false, false, null, false, null, null, true);

Expand Down Expand Up @@ -153,7 +154,7 @@ public void deserializeMigrateCredentials() throws MalformedURLException {
}

@Test
public void deserializeNormal() throws IOException {
public void deserializeNormal() throws IOException, FormException {
Domain domain = new Domain(
"example",
"test domain",
Expand Down Expand Up @@ -207,7 +208,8 @@ private static class JiraSiteOld extends JiraSite {
boolean updateJiraIssueForAllStatus,
String groupVisibility,
String roleVisibility,
boolean useHTTPAuth) {
boolean useHTTPAuth)
throws FormException {
super(
url,
alternativeUrl,
Expand All @@ -226,7 +228,7 @@ private static class JiraSiteOld extends JiraSite {

@Test
@WithoutJenkins
public void alternativeURLNotNull() {
public void alternativeURLNotNull() throws FormException {
JiraSite site = new JiraSite(
validPrimaryUrl,
exampleOrg,
Expand Down

0 comments on commit bab4eb8

Please sign in to comment.