Skip to content

Commit

Permalink
chore: Update Dependencies (#91)
Browse files Browse the repository at this point in the history
* Support tests when git requires signed commits.

* Bring deps up to date

* Fix spot bugs issues.
  • Loading branch information
bstopp authored Jun 10, 2024
1 parent 890f18e commit b0814d5
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 108 deletions.
142 changes: 45 additions & 97 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.19</version>
<version>4.83</version>
<relativePath/>
</parent>
<groupId>io.jenkins.plugins</groupId>
Expand All @@ -15,11 +15,13 @@
<packaging>hpi</packaging>

<properties>
<java.level>11</java.level>

<changelist>999999-SNAPSHOT</changelist>
<jenkins.version>2.277.3</jenkins.version>
<java.level>8</java.level>
<jenkins.version>2.426.3</jenkins.version>
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
<hpi.compatibleSinceVersion>2.0</hpi.compatibleSinceVersion>

<hpi.compatibleSinceVersion>44.0</hpi.compatibleSinceVersion>

<spotbugs.threshold>Low</spotbugs.threshold>
<spotbugs.effort>Max</spotbugs.effort>
Expand All @@ -37,17 +39,7 @@
<name>Adobe Inc</name>
</organization>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.249.x</artifactId>
<version>872.v03c18fa35487</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>


<licenses>
<license>
Expand All @@ -69,8 +61,8 @@
</developers>

<scm>
<connection>scm:git:git://github.com/${gitHubRepo}.git</connection>
<developerConnection>scm:git:git@github.com:${gitHubRepo}.git</developerConnection>
<connection>scm:git://github.com/${gitHubRepo}.git</connection>
<developerConnection>scm:git@github.com:${gitHubRepo}.git</developerConnection>
<url>https://github.com/${gitHubRepo}</url>
<tag>${scmTag}</tag>
</scm>
Expand All @@ -94,69 +86,64 @@
</pluginRepository>
</pluginRepositories>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.426.x</artifactId>
<version>3105.v672692894683</version>
<scope>import</scope>
<type>pom</type>
</dependency>

<!-- Pin dependencies due to conflicts with transitive -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.16.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.13</version>
</dependency>
<!-- CM API Transitive issue -->
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>1.9.10</version>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>io.adobe.cloudmanager</groupId>
<artifactId>aio-lib-cloudmanager</artifactId>
<version>1.0.0</version>
<classifier>java8</classifier>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.20</version>
<version>1.18.32</version>
<scope>provided</scope>
</dependency>
<!-- Prefer to be explicit about provided dependencies to clearly articulate what is usd. -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.12.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.30</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.10.0</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>credentials</artifactId>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plain-credentials</artifactId>
</dependency>

<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>git</artifactId>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>git-client</artifactId>
<version>3.7.2</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-step-api</artifactId>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>apache-httpcomponents-client-4-api</artifactId>
<artifactId>scm-api</artifactId>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-job</artifactId>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-step-api</artifactId>
</dependency>
<dependency>
<groupId>io.jenkins</groupId>
Expand Down Expand Up @@ -189,7 +176,7 @@
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-aggregator</artifactId>
<version>2.6</version>
<version>596.v8c21c963d92d</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -198,12 +185,6 @@
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-step-api</artifactId>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-cps</artifactId>
Expand All @@ -214,39 +195,6 @@
<artifactId>workflow-durable-task-step</artifactId>
<scope>test</scope>
</dependency>

<!-- Fix version conflicts for tests -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>${jackson.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-jaxb-annotations</artifactId>
<version>${jackson.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.jmockit</groupId>
<artifactId>jmockit</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ public class PipelineWaitingAction implements RunAction2, Serializable {
private static final Logger LOGGER = LoggerFactory.getLogger(PipelineWaitingAction.class);
private static final long serialVersionUID = 1L;

@SuppressFBWarnings(value = "SE_TRANSIENT_FIELD_NOT_RESTORED", justification = "Reloaded during onLoad(Run)")
@SuppressFBWarnings(value = "SE_TRANSIENT_FIELD_NOT_RESTORED", justification = "Reloaded during onAttached/onLoad(Run)")
private transient List<PipelineStepStateExecution> executions = new ArrayList<>();
@SuppressFBWarnings(value = "UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR", justification = "Reloaded during onAttached/onLoad(Run)")
private transient Run<?, ?> run;
private List<String> ids = new CopyOnWriteArrayList<>();

Expand Down Expand Up @@ -165,7 +166,7 @@ public PipelineStepStateExecution getDynamic(String id) throws InterruptedExcept
return getExecution(id);
}

// Load all of the executions. Be careful with the logic here, can sometimes block the VM thread - don't want that.
// Load all the executions. Be careful with the logic here, can sometimes block the VM thread - don't want that.
private synchronized void loadExecutions() throws InterruptedException, TimeoutException {
if (executions == null) { // Loaded after restart.
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

import org.apache.commons.lang3.StringUtils;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.Extension;
import io.jenkins.plugins.adobe.cloudmanager.webhook.CloudManagerWebHook;
import jenkins.model.GlobalConfiguration;
Expand All @@ -59,6 +60,7 @@ public class AdobeIOConfig extends GlobalConfiguration {
// Webhook is disabled by default - make a conscious decision to enable it.
private boolean webhookEnabled = false;

@SuppressFBWarnings("MC_OVERRIDABLE_METHOD_CALL_IN_CONSTRUCTOR")
public AdobeIOConfig() {
getConfigFile().getXStream().alias("adobe-io-project-config", AdobeIOProjectConfig.class);
load();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ public static ListBoxModel fillAioProjectItems() {
lbm.add(Messages.DescriptorHelper_defaultListItem(), "");
AdobeIOConfig aio = AdobeIOConfig.configuration();
for (AdobeIOProjectConfig cfg : aio.getProjectConfigs()) {
lbm.add(cfg.getDisplayName(), cfg.getName());
String name = cfg.getName();
if (name != null) {
lbm.add(cfg.getDisplayName(), name);
}
}
return lbm;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.ContentType;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.adobe.cloudmanager.CloudManagerApiException;
import io.adobe.cloudmanager.event.CloudManagerEvent;
import io.adobe.cloudmanager.event.CloudManagerEvent.EventType;
Expand All @@ -68,6 +69,7 @@
/**
* Annotation Handler for processing the payload.
*/
@SuppressFBWarnings("DCN_NULLPOINTER_EXCEPTION") // See note.
class PayloadHandler extends AnnotationHandler<CMEventPayload> {
private static final Logger LOGGER = LoggerFactory.getLogger(CMEventPayload.PayloadHandler.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,12 @@ public static void beforeClass() throws Exception {

@Before
public void before() throws Exception {
srcRepo.git("init");
srcRepo.git("config", "--local", "commit.gpgsign", "false");
srcRepo.init();
srcRepo.git("checkout", "-b", defaultBranch);
bareDestRepo.git("init", "--bare");
bareDestRepo.git("config", "--local", "commit.gpgsign", "false");
bareDestRepo.git("symbolic-ref", "HEAD", "refs/heads/" + defaultBranch);

CredentialsStore store = CredentialsProvider.lookupStores(rule.jenkins).iterator().next();
Expand Down Expand Up @@ -161,6 +164,7 @@ public void conflictNoForce() throws Exception {

destRepo.git("clone", bareDestRepo.toString(), ".");
destRepo.git("checkout", "-b", defaultBranch);
destRepo.git("config", "--local", "commit.gpgsign", "false");
destRepo.git("config", "user.name", "Git SampleRepoRule");
destRepo.git("config", "user.email", "gits@mplereporule");
destRepo.write("testfile", "testfilecontents");
Expand Down Expand Up @@ -193,6 +197,7 @@ public void conflictWithForce() throws Exception {

destRepo.git("clone", bareDestRepo.toString(), ".");
destRepo.git("checkout", "-b", defaultBranch);
destRepo.git("config", "--local", "commit.gpgsign", "false");
destRepo.git("config", "user.name", "Git SampleRepoRule");
destRepo.git("config", "user.email", "gits@mplereporule");
destRepo.write("testfile", "testfilecontents");
Expand Down Expand Up @@ -227,6 +232,7 @@ public void missingTargetBranch() throws Exception {
srcRepo.git("commit", "--message=file");

destRepo.git("clone", bareDestRepo.toString(), ".");
destRepo.git("config", "--local", "commit.gpgsign", "false");
destRepo.git("config", "user.name", "Git SampleRepoRule");
destRepo.git("config", "user.email", "gits@mplereporule");
destRepo.write("testfile", "testfilecontents");
Expand Down Expand Up @@ -255,6 +261,8 @@ public void missingTargetBranch() throws Exception {

@Test
public void multipleScmsWarning() throws Exception {
destRepo.git("init");
destRepo.git("config", "--local", "commit.gpgsign", "false");
destRepo.init();

WorkflowJob job = rule.jenkins.createProject(WorkflowJob.class, "test");
Expand Down Expand Up @@ -333,6 +341,7 @@ public void pipelineSuccess() throws Exception {
public void pipelineCredentialed() throws Exception {
Server server = new Server();
ServerConnector connector = new ServerConnector(server);
connector.setHost("127.0.0.1");
server.addConnector(connector);
ServletContextHandler handler = new ServletContextHandler(ServletContextHandler.NO_SESSIONS);
handler.setContextPath("/*");
Expand All @@ -342,11 +351,11 @@ public void pipelineCredentialed() throws Exception {
server.start();

String host = connector.getHost() == null ? "localhost" : connector.getHost();
String repoUrl = "http://" + host + ":" + connector.getLocalPort() + "/repo";
String repoUrl = "http://127.0.0.1:" + connector.getLocalPort() + "/repo";

String pipeline = "" +
String pipeline =
"pipeline {\n" +
" agent { label 'master' }\n" +
" agent any\n" +
" stages {\n" +
" stage('sync') {\n" +
" steps {\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;

import com.gargoylesoftware.htmlunit.HttpMethod;
import com.gargoylesoftware.htmlunit.Page;
import com.gargoylesoftware.htmlunit.WebRequest;
import hudson.security.GlobalMatrixAuthorizationStrategy;
import io.jenkins.plugins.adobe.cloudmanager.test.TestHelper;
import jenkins.model.Jenkins;
Expand All @@ -50,12 +47,16 @@
import org.eclipse.jetty.servlet.DefaultServlet;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.htmlunit.HttpMethod;
import org.htmlunit.Page;
import org.htmlunit.WebRequest;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.For;
import org.jvnet.hudson.test.JenkinsRule;

import static io.jenkins.plugins.adobe.cloudmanager.test.TestHelper.*;
import static org.junit.Assert.*;

Expand Down
Loading

0 comments on commit b0814d5

Please sign in to comment.