Skip to content
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
80 changes: 50 additions & 30 deletions plugin/pom.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.289.x</artifactId>
<version>950.v396cb834de1e</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>

<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.17</version>
<version>4.25</version>
<relativePath/>
</parent>

<artifactId>openstack-cloud</artifactId>
Expand All @@ -14,27 +29,29 @@
<url>https://github.com/jenkinsci/openstack-cloud-plugin</url>

<properties>
<jenkins.version>2.222.4</jenkins.version>
<jenkins.version>2.289.1</jenkins.version>
<java.level>8</java.level>
<concurrency>1C</concurrency>
<surefire.useFile>false</surefire.useFile>
<spotbugs.failOnError>false</spotbugs.failOnError>
<spotbugs.excludeFilterFile>src/findbugs-exclude.xml</spotbugs.excludeFilterFile>
<spotbugs.skip>true</spotbugs.skip> <!-- Upstream Jenkins fails the build if some are found. Excludes does not seem to work. -->
<spotbugs.skip>true
</spotbugs.skip> <!-- Upstream Jenkins fails the build if some are found. Excludes does not seem to work. -->
<maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>

<guava.version>20.0</guava.version> <!-- version compatible with openstack4j -->
<jsr305.version>1.3.9</jsr305.version>
<openstack4j.version>3.8</openstack4j.version>
<openstack4j.version>3.10</openstack4j.version>
<okhttp.version>3.9.1</okhttp.version>
<configuration-as-code.version>1.38</configuration-as-code.version>
<jenkins-test-harness.version>1626.v46b0925e70db</jenkins-test-harness.version>
<jackson.version>2.12.4</jackson.version>
</properties>

<developers>
<developer>
<id>olivergondza</id>
<name>Oliver Gondža</name>
<email>ogondza@gmail.com</email>
<id>olivergondza</id>
<name>Oliver Gondža</name>
<email>ogondza@gmail.com</email>
</developer>
</developers>

Expand Down Expand Up @@ -70,17 +87,14 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>ssh-slaves</artifactId>
<version>1.31.5</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>ssh-credentials</artifactId>
<version>1.18.1</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>credentials</artifactId>
<version>2.3.14</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
Expand All @@ -95,12 +109,10 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>resource-disposer</artifactId>
<version>0.5</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-durable-task-step</artifactId>
<version>2.30</version>
<optional>true</optional>
</dependency>
<dependency>
Expand All @@ -111,19 +123,16 @@
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>caffeine-api</artifactId>
<version>2.9.1-23.v51c4e2c879c8</version>
</dependency>

<!-- Hardcoding upper-bound versions of dependencies -->
<dependency>
<groupId>org.jenkins-ci</groupId>
<artifactId>annotation-indexer</artifactId>
<version>1.12</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>script-security</artifactId>
<version>1.50</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
Expand All @@ -138,19 +147,40 @@
<dependency>
<groupId>org.jenkins-ci</groupId>
<artifactId>symbol-annotation</artifactId>
<version>1.20</version>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.26</version>
<version>1.29</version>
</dependency>

<!--Specifying jenkins version to avoid maven.plugins.enforcer.RequireUpperBoundDeps error
between configuration as code and openstack4j -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
<version>${jackson.version}</version>
</dependency>

<!-- Test Dependencies -->
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>2.2</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -162,53 +192,45 @@
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-cps</artifactId>
<version>2.25</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-support</artifactId>
<classifier>tests</classifier>
<version>3.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-job</artifactId>
<version>2.9</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-basic-steps</artifactId>
<version>2.3</version>
<scope>test</scope>
</dependency>

<!-- Plugins split from core -->
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>command-launcher</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>jdk-tool</artifactId>
<version>1.1</version>
<!-- actually used from production source of ssh-slaves so cannot be test scoped -->
</dependency>

<dependency>
<artifactId>configuration-as-code</artifactId>
<groupId>io.jenkins</groupId>
<version>${configuration-as-code.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>test-harness</artifactId>
<groupId>io.jenkins.configuration-as-code</groupId>
<version>${configuration-as-code.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -219,12 +241,10 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.7</version> <!-- JDK 7+ support -->
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<additionalOptions>
<option>-Xdoclint:all,-missing</option>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import hudson.util.FormValidation;
import jenkins.model.Jenkins;
import jenkins.plugins.openstack.compute.auth.OpenstackCredential;
import org.apache.commons.codec.Charsets;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.codec.digest.DigestUtils;
import org.jenkinsci.main.modules.instance_identity.InstanceIdentity;
Expand Down Expand Up @@ -95,6 +94,8 @@
import java.util.logging.Logger;
import java.util.stream.Collectors;

import static java.nio.charset.StandardCharsets.UTF_8;

/**
* Encapsulate {@link OSClient}.
*
Expand Down Expand Up @@ -517,7 +518,7 @@ private boolean isOurs(@Nonnull Server server) {
// Use salted hash not to disclose the public key. The key is used to authenticate agent connections.
INSTANCE_FINGERPRINT = DigestUtils.sha1Hex(
"openstack-cloud-plugin-identity-fingerprint:"
+ new String(Base64.encodeBase64(InstanceIdentity.get().getPublic().getEncoded()), Charsets.UTF_8)
+ new String(Base64.encodeBase64(InstanceIdentity.get().getPublic().getEncoded()), UTF_8)
);
}
return INSTANCE_FINGERPRINT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import hudson.model.User;
import hudson.security.ACL;
import hudson.security.ACLContext;
import hudson.security.AccessDeniedException3;
import hudson.security.Permission;
import hudson.security.SidACL;
import hudson.slaves.Cloud;
Expand Down Expand Up @@ -334,7 +335,7 @@ public void doProvision() throws Exception {
try {
j.executeOnServer(new DoProvision(jenkinsRead, template));
fail("Expected 'AccessDeniedException' exception hasn't been thrown");
} catch (AccessDeniedException ex) {
} catch (AccessDeniedException3 ex) {
// Expected
}
}
Expand Down Expand Up @@ -518,7 +519,7 @@ public void security808() throws Exception {
try {
desc.doTestConnection(true, c.getId(), destination, "");
fail();
} catch (AccessDeniedException ex) {
} catch (AccessDeniedException3 ex) {
// Expected
}
assertEquals(0, credentialsCollectingPortal.reqs.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
import org.openstack4j.model.storage.block.VolumeSnapshot;

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

import static java.util.Locale.US;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.junit.Assert.assertEquals;
Expand All @@ -55,7 +55,7 @@
import static org.mockito.Mockito.when;

public class BootSourceTest {
private static final FormValidation VALIDATION_REQUIRED = FormValidation.error(hudson.util.Messages.FormValidation_ValidateRequired());
private static final FormValidation VALIDATION_REQUIRED = FormValidation.error(hudson.util.Messages._FormValidation_ValidateRequired().toString(US));
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

If running the Test jenkins.plugins.openstack.compute.slaveopts.BootSourceTest#doCheckImageIdWhenNoValueSet at a machine without US or GB localisation the assertion will fail, because the created VALIDATION_REQUIRED which is used for the expect value changes based on the jvm default java.util.Locale (See the Implementation org.jvnet.localizer.ResourceBundleHolder#format)
This change forces the US Localisation for the creation of the expected value of VALIDATION_REQUIRED.


public @Rule PluginTestRule j = new PluginTestRule();

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<version>2.61-SNAPSHOT</version>

<properties>
<jenkins.version>2.222.4</jenkins.version>
<jenkins.version>2.289.1</jenkins.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand Down
2 changes: 1 addition & 1 deletion ui-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<dependency>
<groupId>org.jenkins-ci</groupId>
<artifactId>acceptance-test-harness</artifactId>
<version>1.70</version>
<version>1.101</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
Expand Down