Skip to content

Commit

Permalink
Merge branch 'master' into T282893
Browse files Browse the repository at this point in the history
  • Loading branch information
gounthar committed Nov 21, 2023
2 parents 76a5de9 + 9a306fc commit d540918
Show file tree
Hide file tree
Showing 24 changed files with 170 additions and 183 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @jenkinsci/parameterized-trigger-plugin-developers
10 changes: 8 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuring-dependabot-version-updates
---
version: 2
updates:
- package-ecosystem: "maven"
directory: "/"
labels:
- "dependencies"
schedule:
interval: "weekly"
interval: "monthly"
- package-ecosystem: "github-actions"
directory: "/"
labels:
- "skip-changelog"
schedule:
interval: "weekly"
interval: "monthly"
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5.18.1
- uses: release-drafter/release-drafter@v5.25.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 0 additions & 15 deletions .github/workflows/stale.yml

This file was deleted.

12 changes: 12 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
tasks:
- init: mvn clean verify

vscode:
extensions:
- bierner.markdown-preview-github-styles
- vscjava.vscode-java-pack
- redhat.java
- vscjava.vscode-java-debug
- vscjava.vscode-java-dependency
- vscjava.vscode-java-test
- vscjava.vscode-maven
2 changes: 1 addition & 1 deletion .mvn/extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<extension>
<groupId>io.jenkins.tools.incrementals</groupId>
<artifactId>git-changelist-maven-extension</artifactId>
<version>1.3</version>
<version>1.7</version>
</extension>
</extensions>
48 changes: 48 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Contributing to the Parameterized Trigger Plugin

## Beginner Topics

Look for contribution areas in the
[issues in our issues tracker](https://issues.jenkins.io/issues/?jql=resolution%20is%20EMPTY%20and%20component%3D15592).

## Background

Plugin source code is hosted on https://github.com/jenkinsci/parameterized-trigger-plugin[GitHub].
New feature proposals and bug fix proposals should be submitted as https://help.github.com/articles/creating-a-pull-request[GitHub pull requests].
Your pull request will be evaluated by the https://ci.jenkins.io/job/Plugins/job/parameterized-trigger-plugin/[Jenkins job].

Before submitting your change, please assure that you've added tests to verify your change.
Tests help us assure that we're delivering a reliable plugin, and that we've communicated our intent to other developers as executable descriptions of plugin behavior.

## Building and Testing

Compile and test the plugin with the command:

* `mvn clean verify`

Compile the plugin without running tests using the command:

* `mvn clean -DskipTests verify`

Code coverage reporting is available as a maven target.
Please try to improve code coverage with tests when you submit.

* `mvn -P enable-jacoco clean install jacoco:report` to report code coverage

Please don't introduce new spotbugs output.

* `mvn spotbugs:check` to analyze project using https://spotbugs.github.io/[Spotbugs].
* `mvn spotbugs:gui` to review Spotbugs report using GUI

## Automated Tests

Automated tests are run as part of the `verify` phase.
Run automated tests with multiple Java virtual machines with the command:

```
$ mvn clean -DforkCount=1C verify
```

## Issue Reports

Please report issues and enhancements through the [Jenkins issue tracker](https://www.jenkins.io/participate/report-issue/redirect/#15592).
15 changes: 10 additions & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
// Builds a module using https://github.com/jenkins-infra/pipeline-library
buildPlugin(useAci: true, configurations: [
[ platform: "linux", jdk: "8" ],
[ platform: "windows", jdk: "8" ],
[ platform: "linux", jdk: "11" ]
/*
See the documentation for more options:
https://github.com/jenkins-infra/pipeline-library/
*/
buildPlugin(
forkCount: '1C', // Run parallel tests on ci.jenkins.io for lower costs, faster feedback
useContainerAgent: true, // Set to `false` if you need to use Docker for containerized tests
configurations: [
[platform: 'linux', jdk: 21],
[platform: 'windows', jdk: 17],
])
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,7 @@ In Windows system, you can modify jenkins.xml placed in the installed folder.
-<arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\\jenkins.war" --httpPort=8080\</arguments>
+\<arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -Dhudson.plugins.parameterizedtrigger.ProjectSpecificParametersActionFactory.compatibility_mode=true -jar "%BASE%\\jenkins.war" --httpPort=8080\</arguments>
```

# Report an issue

Please report issues and enhancements through the [Jenkins issue tracker](https://www.jenkins.io/participate/report-issue/redirect/#15592).
90 changes: 14 additions & 76 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.31</version>
<version>4.75</version>
<relativePath />
</parent>

Expand All @@ -26,18 +26,7 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>subversion</artifactId>
<version>2.15.1</version>
<optional>true</optional>
<exclusions>
<exclusion>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>ssh-credentials</artifactId>
</exclusion>
<exclusion>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>structs</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
Expand All @@ -57,27 +46,19 @@
<groupId>org.sonatype.sisu</groupId>
<artifactId>sisu-guice</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>conditional-buildstep</artifactId>
<version>1.4.1</version>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>apache-httpcomponents-client-4-api</artifactId>
<scope>test</scope>
</dependency>
<!-- Workflow plugin imports are used to test compatibility -->
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
Expand All @@ -88,12 +69,6 @@
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-cps</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.jenkins-ci</groupId>
<artifactId>symbol-annotation</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
Expand All @@ -119,23 +94,11 @@
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>matrix-auth</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.jenkins-ci.plugins.icon-shim</groupId>
<artifactId>icon-set</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
Expand All @@ -149,46 +112,20 @@
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>4.1.1</version>
<version>4.2.0</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.263.x</artifactId>
<version>961.vf0c9f6f59827</version>
<artifactId>bom-2.387.x</artifactId>
<version>2543.vfb_1a_5fb_9496d</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_annotations</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.12.0</version>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch.agentproxy.core</artifactId>
<version>0.0.9</version>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch.agentproxy.connector-factory</artifactId>
<version>0.0.9</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand All @@ -214,11 +151,12 @@
</pluginRepositories>

<properties>
<revision>2.45</revision>
<revision>2.47</revision>
<changelist>-SNAPSHOT</changelist>
<gitHubRepo>jenkinsci/parameterized-trigger-plugin</gitHubRepo>
<java.level>8</java.level>
<jenkins.version>2.270</jenkins.version>
<spotbugs.failOnError>false</spotbugs.failOnError>
<jenkins.version>2.387.3</jenkins.version>
<spotbugs.effort>Max</spotbugs.effort>
<spotbugs.failOnError>true</spotbugs.failOnError>
<spotbugs.threshold>Low</spotbugs.threshold>
</properties>
</project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package hudson.plugins.parameterizedtrigger;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

import hudson.Extension;
import hudson.Launcher;
import hudson.model.AbstractBuild;
Expand All @@ -13,6 +15,7 @@

import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.ListMultimap;
import hudson.model.Label;
import hudson.model.TaskListener;
import hudson.model.queue.QueueTaskFuture;

Expand All @@ -28,6 +31,8 @@
*/
public class BlockableBuildTriggerConfig extends BuildTriggerConfig {
private final BlockingBehaviour block;
// Field is unused, but would change public API if it were deleted
@SuppressFBWarnings(value = "UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD", justification = "Part of the public API")
public boolean buildAllNodesWithLabel;

public BlockableBuildTriggerConfig(String projects, BlockingBehaviour block, List<AbstractBuildParameters> configs) {
Expand Down Expand Up @@ -90,7 +95,9 @@ protected QueueTaskFuture schedule(AbstractBuild<?, ?> build, Job project, List<
}

public Collection<Node> getNodes() {
return Jenkins.get().getLabel("asrt").getNodes();
Label label = Jenkins.get().getLabel("asrt");
if (label==null) return Collections.emptyList();
return label.getNodes();
}

@Extension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import hudson.model.Result;
import org.kohsuke.stapler.DataBoundConstructor;

import javax.annotation.CheckForNull;
import edu.umd.cs.findbugs.annotations.CheckForNull;
import java.util.Arrays;
import java.util.List;

Expand Down
Loading

0 comments on commit d540918

Please sign in to comment.