Skip to content

Update dependencies #54

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

Merged
merged 4 commits into from
Feb 22, 2024
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: 3 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
buildPlugin(
platforms: ["linux"],
configurations: [
[ platform: "linux", jdk: "17" ],
],
spotbugs: [
qualityGates: [[threshold: 100, type: 'NEW', unstable: false]]
]
Expand Down
9 changes: 9 additions & 0 deletions exclude.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<FindBugsFilter>
<Match>
<Source name="~.*\.groovy" />
<Or>
<Bug pattern="SE_NO_SERIALVERSIONID" />
<Bug pattern="LI_LAZY_INIT_STATIC" />
</Or>
</Match>
</FindBugsFilter>
36 changes: 19 additions & 17 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>2.17</version><!-- which version of Jenkins is this plugin built against? -->
<version>4.78</version>
</parent>

<artifactId>yaml-axis</artifactId>
Expand All @@ -12,10 +12,13 @@
<version>0.3.1-SNAPSHOT</version>
<packaging>hpi</packaging>
<url>https://github.com/jenkinsci/yaml-axis-plugin</url>
<properties>
<jenkins.version>2.361</jenkins.version>
</properties>

<scm>
<connection>scm:git:ssh://git@github.com/jenkinsci/yaml-axis-plugin.git</connection>
<developerConnection>scm:git:ssh://git@github.com/jenkinsci/yaml-axis-plugin.git</developerConnection>
<connection>scm:git:https://github.com/jenkinsci/yaml-axis-plugin.git</connection>
<developerConnection>scm:git:https://github.com/jenkinsci/yaml-axis-plugin.git</developerConnection>
<url>https://github.com/jenkinsci/yaml-axis-plugin.git</url>
<tag>HEAD</tag>
</scm>
Expand Down Expand Up @@ -65,14 +68,13 @@
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-core</artifactId>
<version>1.609</version>
<version>${jenkins.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>matrix-project</artifactId>
<version>1.6</version>
<version>1.14</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
Expand All @@ -82,19 +84,19 @@
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.33</version>
<version>2.2</version>
</dependency>

<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
<version>1.0-groovy-2.4</version>
<version>1.3-groovy-2.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-test-harness</artifactId>
<version>1.609</version>
<version>2165.vf0266a_2d187f</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -105,8 +107,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<encoding>utf-8</encoding>
<source>1.6</source>
<target>1.6</target>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -149,12 +151,12 @@
visit https://github.com/groovy/GMavenPlus/wiki -->
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<version>1.4</version>
<version>3.0.2</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
<goal>compileTests</goal>
</goals>
</execution>
</executions>
Expand All @@ -172,9 +174,9 @@
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.5</version>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.8.3.0</version>
<executions>
<execution>
<id>check</id>
Expand All @@ -186,8 +188,8 @@
</executions>
<configuration>
<xmlOutput>false</xmlOutput>
<findbugsXmlOutput>false</findbugsXmlOutput>
<failOnError>false</failOnError>
<excludeFilterFile>exclude.xml</excludeFilterFile>
</configuration>
</plugin>
</plugins>
Expand Down
16 changes: 16 additions & 0 deletions src/main/groovy/org/jenkinsci/plugins/yamlaxis/YamlAxis.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,20 @@ class YamlAxis extends Axis {
DescriptorUtils.checkFieldNotEmpty(value, "valueStrng")
}
}

@Override
public boolean equals(Object o) {
if (this == o) return true
if (!(o instanceof YamlAxis)) return false

YamlAxis yamlAxis = (YamlAxis) o
if (computedValues != null ? !computedValues.equals(yamlAxis.computedValues) : yamlAxis.computedValues != null)
return false

true
}

@Override public int hashCode() {
return computedValues ? computedValues.hashCode() : 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package org.jenkinsci.plugins.yamlaxis
import groovy.transform.TupleConstructor
import hudson.FilePath
import hudson.Util
import org.yaml.snakeyaml.LoaderOptions
import org.yaml.snakeyaml.Yaml
import org.yaml.snakeyaml.constructor.SafeConstructor

Expand All @@ -18,7 +19,7 @@ class YamlFileLoader extends YamlLoader {
return null
}

Yaml yaml = new Yaml(new SafeConstructor())
Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions()))
InputStream input = createFilePath().read()

try{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.jenkinsci.plugins.yamlaxis
import groovy.transform.TupleConstructor
import org.yaml.snakeyaml.LoaderOptions
import org.yaml.snakeyaml.Yaml
import org.yaml.snakeyaml.constructor.SafeConstructor

Expand All @@ -11,7 +12,7 @@ class YamlTextLoader extends YamlLoader {

@Override
Map getContent() {
Yaml yaml = new Yaml(new SafeConstructor())
Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions()))
yaml.load(yamlText)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import hudson.matrix.Combination
import hudson.matrix.MatrixProject
import hudson.matrix.TextAxis
import org.junit.Rule
import org.jvnet.hudson.test.GroovyJenkinsRule
import org.jvnet.hudson.test.JenkinsRule
import spock.lang.Specification

class YamlMatrixExecutionStrategySpec extends Specification {
@Rule
GroovyJenkinsRule rule = new GroovyJenkinsRule()
JenkinsRule rule = new JenkinsRule()

MatrixProject configure() {
def matrixProject = rule.createMatrixProject()
def matrixProject = rule.createProject(MatrixProject.class);

def axis = new TextAxis('axis1', ['a', 'b', 'c'])
def axis2 = new TextAxis('axis2', ['x', 'y', 'z'])
Expand Down