From c1b43213e5b09decadf264fc5d4258812fad1751 Mon Sep 17 00:00:00 2001 From: Valentin Delaye Date: Sun, 17 Nov 2024 09:12:26 +0100 Subject: [PATCH] Bump Jenkins baseline to 2.479 and use StaplerRequest2 --- Jenkinsfile | 1 + pom.xml | 8 ++++---- .../plugins/pipeline/PipelineAsYamlScmFlowDefinition.java | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9bdbcc7..09032da 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,6 +3,7 @@ https://github.com/jenkins-infra/pipeline-library/ */ 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: 21], diff --git a/pom.xml b/pom.xml index 9eea62c..120bf18 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.jenkins-ci.plugins plugin - 4.88 + 5.2 io.jenkins.plugins @@ -28,8 +28,8 @@ 999999-SNAPSHOT - 2.440 - ${jenkins.baseline}.3 + 2.479 + ${jenkins.baseline}.1 0.13-rc false @@ -39,7 +39,7 @@ io.jenkins.tools.bom bom-${jenkins.baseline}.x - 3435.v238d66a_043fb_ + 3696.vb_b_4e2d1a_0542 pom import diff --git a/src/main/java/io/jenkins/plugins/pipeline/PipelineAsYamlScmFlowDefinition.java b/src/main/java/io/jenkins/plugins/pipeline/PipelineAsYamlScmFlowDefinition.java index ee58023..24d8713 100644 --- a/src/main/java/io/jenkins/plugins/pipeline/PipelineAsYamlScmFlowDefinition.java +++ b/src/main/java/io/jenkins/plugins/pipeline/PipelineAsYamlScmFlowDefinition.java @@ -16,7 +16,7 @@ import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.DataBoundSetter; import org.kohsuke.stapler.Stapler; -import org.kohsuke.stapler.StaplerRequest; +import org.kohsuke.stapler.StaplerRequest2; /** * SCM Binder class for {@link org.jenkinsci.plugins.workflow.multibranch.WorkflowBranchProjectFactory} @@ -87,7 +87,7 @@ public String getDisplayName() { } public Collection> getApplicableDescriptors() { - StaplerRequest req = Stapler.getCurrentRequest(); + StaplerRequest2 req = Stapler.getCurrentRequest2(); Job job = req != null ? req.findAncestorObject(Job.class) : null; return SCM._for(job); }