From 348a9297ef2837454c999be0b71a6acb59b09908 Mon Sep 17 00:00:00 2001
From: Tim Jacomb
Date: Sat, 13 Jul 2024 12:58:03 +0100
Subject: [PATCH 01/30] Switch to renovate
---
.github/dependabot.yml | 68 ------------------------------------------
.github/renovate.json | 50 ++++++++++++++++++++++++++++++-
2 files changed, 49 insertions(+), 69 deletions(-)
delete mode 100644 .github/dependabot.yml
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
deleted file mode 100644
index 8c2bd4291a6e..000000000000
--- a/.github/dependabot.yml
+++ /dev/null
@@ -1,68 +0,0 @@
----
-version: 2
-updates:
- - package-ecosystem: "github-actions"
- directory: "/"
- schedule:
- interval: "daily"
- - package-ecosystem: "maven"
- directory: "/"
- schedule:
- interval: "daily"
- ignore:
- # Exclusions in this section have been triaged and determined to be
- # permanent. We do not anticipate removing exclusions from this section.
-
- # Provided by Jetty and should be aligned with the version provided by the
- # version of Jetty we deliver. See:
- # https://github.com/jenkinsci/jenkins/pull/5211
- - dependency-name: "jakarta.servlet:jakarta.servlet-api"
-
- # Jetty Maven Plugin and Winstone should be upgraded in lockstep in order
- # to keep their corresponding Jetty versions aligned.
- - dependency-name: "org.eclipse.jetty:jetty-maven-plugin"
- - dependency-name: "org.jenkins-ci:winstone"
-
- # Here lies technical debt. Exclusions in this section have been triaged
- # and determined to be temporary. Exclusions should be removed from this
- # section once the remaining action items have been completed.
-
- # Contains incompatible API changes and needs compatibility work.
- - dependency-name: "jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api"
-
- # Needs significant testing. See:
- # https://github.com/jenkinsci/jenkins/pull/5112#issuecomment-744429487
- # https://github.com/jenkinsci/jenkins/pull/5116#issuecomment-744526638
- - dependency-name: "org.codehaus.groovy:groovy-all"
- versions: [">=2.5.0"]
-
- # Consumed by Groovy and should be updated in lockstep with Groovy. See:
- # https://github.com/jenkinsci/jenkins/pull/5184
- - dependency-name: "org.fusesource.jansi:jansi"
-
- # Contains incompatible API changes and needs compatibility work. See:
- # https://github.com/jenkinsci/jenkins/pull/4224
- - dependency-name: "org.jfree:jfreechart"
-
- # Starting with 6.x, Spring requires Java 17 at a minimum.
- - dependency-name: "org.springframework:spring-framework-bom"
- versions: [">=6.0.0"]
-
- # Starting with 6.x, Spring Security requires Java 17 at a minimum.
- - dependency-name: "org.springframework.security:spring-security-bom"
- versions: [">=6.0.0"]
-
- # Starting with 7.x, Guice switches from javax.* to jakarta.* bindings.
- # See https://github.com/google/guice/wiki/Guice700
- - dependency-name: "com.google.inject:guice-bom"
- versions: [">=7.0.0"]
- - package-ecosystem: "maven"
- directory: "/"
- target-branch: "stable-2.452"
- labels:
- - "into-lts"
- - "needs-justification"
- schedule:
- interval: "daily"
- # Include only security updates and exclude version updates.
- open-pull-requests-limit: 0
diff --git a/.github/renovate.json b/.github/renovate.json
index 8c3c4ad17cea..23cf5480a3b6 100644
--- a/.github/renovate.json
+++ b/.github/renovate.json
@@ -5,7 +5,7 @@
":disableDependencyDashboard",
":semanticCommitsDisabled"
],
- "enabledManagers": ["npm", "regex"],
+ "prHourlyLimit": 0,
"postUpdateOptions": ["yarnDedupeHighest"],
"packageRules": [
{
@@ -17,6 +17,54 @@
{
"matchPackageNames": ["node"],
"allowedVersions": "/20.[0-9]+.[0-9]+(.[0-9]+)?$/"
+ },
+ {
+ "matchPackagePatterns": ["(org.eclipse.jetty:jetty-maven-plugin|org.jenkins-ci:winstone)"],
+ "description": "Should be upgraded in lockstep in order to keep their corresponding Jetty versions aligned, could be grouped but releases are likely separated by a bit of time",
+ "matchManagers": ["maven"],
+ "enabled": false
+ },
+ {
+ "matchPackagePatterns": ["jakarta.servlet:jakarta.servlet-api"],
+ "description": "Provided by Jetty and should be aligned with the version provided by the version of Jetty we deliver. See: https://github.com/jenkinsci/jenkins/pull/5211",
+ "matchManagers": ["maven"],
+ "enabled": false
+ },
+ {
+ "matchPackagePatterns": ["jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api"],
+ "description": "Contains incompatible API changes and needs compatibility work",
+ "matchManagers": ["maven"],
+ "enabled": false
+ },
+ {
+ "matchPackagePatterns": ["org.codehaus.groovy:groovy-all"],
+ "description": "Needs significant testing. See: https://github.com/jenkinsci/jenkins/pull/5112#issuecomment-744429487 and https://github.com/jenkinsci/jenkins/pull/5116#issuecomment-744526638",
+ "matchManagers": ["maven"],
+ "allowedVersions": "<2.5.0"
+ },
+ {
+ "matchPackagePatterns": ["org.fusesource.jansi:jansi"],
+ "description": "Consumed by Groovy and should be updated in lockstep with Groovy. See: https://github.com/jenkinsci/jenkins/pull/5184",
+ "matchManagers": ["maven"],
+ "enabled": false
+ },
+ {
+ "matchPackagePatterns": ["org.jfree:jfreechart"],
+ "description": "Contains incompatible API changes and needs compatibility work. See: https://github.com/jenkinsci/jenkins/pull/4224",
+ "matchManagers": ["maven"],
+ "enabled": false
+ },
+ {
+ "matchPackagePatterns": ["org.springframework"],
+ "description": "Starting with 6.x, Spring requires Java 17 at a minimum.",
+ "matchManagers": ["maven"],
+ "allowedVersions": "<6.0.0"
+ },
+ {
+ "matchPackagePatterns": ["com.google.inject:guice-bom"],
+ "description": "Starting with 7.x, Guice switches from javax.* to jakarta.* bindings. See https://github.com/google/guice/wiki/Guice700",
+ "matchManagers": ["maven"],
+ "allowedVersions": "<7.0.0"
}
],
"regexManagers": [
From 9dd4ab97dd341675f6d59d1ac08eead36a27a97c Mon Sep 17 00:00:00 2001
From: Tim Jacomb
Date: Sat, 13 Jul 2024 13:17:07 +0100
Subject: [PATCH 02/30] Downgrade remoting for test of renovate
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 858fffab01bb..ab6460817cac 100644
--- a/pom.xml
+++ b/pom.xml
@@ -87,7 +87,7 @@ THE SOFTWARE.
https://www.jenkins.io/changelog
- 3256.v88a_f6e922152
+ 3248.v65ecb_254c2983107.v665000b_51092
From 89cacef1f7bae782075144a6bf66bd10248c3838 Mon Sep 17 00:00:00 2001
From: Tim Jacomb
Date: Sun, 14 Jul 2024 08:24:15 +0100
Subject: [PATCH 03/30] Downgrade bootstrap-api for testing
---
test/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/pom.xml b/test/pom.xml
index b00467dc3f31..99ca6535435e 100644
--- a/test/pom.xml
+++ b/test/pom.xml
@@ -350,7 +350,7 @@ THE SOFTWARE.
io.jenkins.pluginsbootstrap5-api
- 5.3.3-1
+ 5.3.2-4hpi${project.build.outputDirectory}/pluginsbootstrap5-api.jpi
From b673f0d8108d2d03b5bb34d536060dc6741b107b Mon Sep 17 00:00:00 2001
From: Tim Jacomb
Date: Sun, 14 Jul 2024 08:30:33 +0100
Subject: [PATCH 04/30] Downgrade other one
---
war/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/war/pom.xml b/war/pom.xml
index 636b3e265c69..5e55e14ef7b2 100644
--- a/war/pom.xml
+++ b/war/pom.xml
@@ -319,7 +319,7 @@ THE SOFTWARE.
io.jenkins.pluginsbootstrap5-api
- 5.3.3-1
+ 5.3.2-4hpi
From 0f812f7cf8778f031d2d6b2cc4678825ba1f8c1a Mon Sep 17 00:00:00 2001
From: Tim Jacomb
Date: Sun, 14 Jul 2024 08:41:15 +0100
Subject: [PATCH 05/30] Update ignore paths
---
.github/renovate.json | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/.github/renovate.json b/.github/renovate.json
index 23cf5480a3b6..e3cbe5bdbdd6 100644
--- a/.github/renovate.json
+++ b/.github/renovate.json
@@ -107,5 +107,14 @@
}
],
"labels": ["dependencies", "skip-changelog"],
- "rebaseWhen": "conflicted"
+ "rebaseWhen": "conflicted",
+ "ignorePaths": [
+ "**/node_modules/**",
+ "**/bower_components/**",
+ "**/vendor/**",
+ "**/examples/**",
+ "**/__tests__/**",
+ "**/tests/**",
+ "**/__fixtures__/**"
+ ]
}
From 87558923469462c066bd84cecf19e257e804e2e2 Mon Sep 17 00:00:00 2001
From: Tim Jacomb
Date: Sun, 14 Jul 2024 09:02:57 +0100
Subject: [PATCH 06/30] Try this
---
.github/renovate.json | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/.github/renovate.json b/.github/renovate.json
index e3cbe5bdbdd6..995fadb5bc1f 100644
--- a/.github/renovate.json
+++ b/.github/renovate.json
@@ -65,6 +65,10 @@
"description": "Starting with 7.x, Guice switches from javax.* to jakarta.* bindings. See https://github.com/google/guice/wiki/Guice700",
"matchManagers": ["maven"],
"allowedVersions": "<7.0.0"
+ },
+ {
+ "paths": ["test/pom.xml"],
+ "excludePackageNames": ["org.jenkins-ci.main:remoting"]
}
],
"regexManagers": [
From 37f95213954136508d215a4972d701bae1689a8b Mon Sep 17 00:00:00 2001
From: Tim Jacomb
Date: Sun, 14 Jul 2024 18:43:32 +0100
Subject: [PATCH 07/30] Try this
---
.github/renovate.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/renovate.json b/.github/renovate.json
index 995fadb5bc1f..8dc58bccedf5 100644
--- a/.github/renovate.json
+++ b/.github/renovate.json
@@ -67,7 +67,7 @@
"allowedVersions": "<7.0.0"
},
{
- "paths": ["test/pom.xml"],
+ "matchFileNames": ["test/pom.xml"],
"excludePackageNames": ["org.jenkins-ci.main:remoting"]
}
],
From 489c98fe32a59a8fba8ea12bbf5a7ebf710a5b45 Mon Sep 17 00:00:00 2001
From: Tim Jacomb
Date: Mon, 15 Jul 2024 20:13:57 +0100
Subject: [PATCH 08/30] Try this
---
.github/renovate.json | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/.github/renovate.json b/.github/renovate.json
index 8dc58bccedf5..aea85ba69728 100644
--- a/.github/renovate.json
+++ b/.github/renovate.json
@@ -68,7 +68,8 @@
},
{
"matchFileNames": ["test/pom.xml"],
- "excludePackageNames": ["org.jenkins-ci.main:remoting"]
+ "matchPackageNames": ["org.jenkins-ci.main:remoting"],
+ "enabled": false
}
],
"regexManagers": [
From 0cf50d27255e2c7ffb92ca9604ee1195fda12494 Mon Sep 17 00:00:00 2001
From: Tim Jacomb
Date: Fri, 2 Aug 2024 11:08:22 +0100
Subject: [PATCH 09/30] Move property to maven.config file
---
.github/renovate.json | 2 +-
.mvn/maven.config | 3 +++
pom.xml | 2 --
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/.github/renovate.json b/.github/renovate.json
index aea85ba69728..d960d3f059f8 100644
--- a/.github/renovate.json
+++ b/.github/renovate.json
@@ -67,7 +67,7 @@
"allowedVersions": "<7.0.0"
},
{
- "matchFileNames": ["test/pom.xml"],
+ "matchFileNames": ["test/pom.xml", ".mvn/maven.config"],
"matchPackageNames": ["org.jenkins-ci.main:remoting"],
"enabled": false
}
diff --git a/.mvn/maven.config b/.mvn/maven.config
index 2a0299c4865d..ebd67cc35335 100644
--- a/.mvn/maven.config
+++ b/.mvn/maven.config
@@ -1,2 +1,5 @@
+# Minimum Remoting version, which is tested for API compatibility
+# Specified here as a workaround so that renovate doesn't update it when it updates the main remoting dependency
+-Dremoting.minimum.supported.version=3107.v665000b_51092
-Pconsume-incrementals
-Pmight-produce-incrementals
diff --git a/pom.xml b/pom.xml
index ab6460817cac..3d8a0ef1c45c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -88,8 +88,6 @@ THE SOFTWARE.
3248.v65ecb_254c298
-
- 3107.v665000b_51092MaxMedium
From b7d18ffba4ee5be154a6f26298d5f42f66afe099 Mon Sep 17 00:00:00 2001
From: Tim Jacomb
Date: Sat, 3 Aug 2024 15:53:36 +0100
Subject: [PATCH 10/30] Address review feedback
---
.github/renovate.json | 3 ++-
.mvn/maven.config | 3 ---
core/pom.xml | 2 ++
test/pom.xml | 2 ++
war/pom.xml | 12 +++++++-----
5 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/.github/renovate.json b/.github/renovate.json
index d960d3f059f8..cad65258dc6c 100644
--- a/.github/renovate.json
+++ b/.github/renovate.json
@@ -67,8 +67,9 @@
"allowedVersions": "<7.0.0"
},
{
- "matchFileNames": ["test/pom.xml", ".mvn/maven.config"],
+ "matchFileNames": ["test/pom.xml", "core/pom.xml", "war/pom.xml"],
"matchPackageNames": ["org.jenkins-ci.main:remoting"],
+ "description": "Avoid updating the remoting.minimum.supported.version property but still update latest one by not placing this property in the parent pom.xml",
"enabled": false
}
],
diff --git a/.mvn/maven.config b/.mvn/maven.config
index ebd67cc35335..2a0299c4865d 100644
--- a/.mvn/maven.config
+++ b/.mvn/maven.config
@@ -1,5 +1,2 @@
-# Minimum Remoting version, which is tested for API compatibility
-# Specified here as a workaround so that renovate doesn't update it when it updates the main remoting dependency
--Dremoting.minimum.supported.version=3107.v665000b_51092
-Pconsume-incrementals
-Pmight-produce-incrementals
diff --git a/core/pom.xml b/core/pom.xml
index 95c289164930..8e30ae211ed7 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -40,6 +40,8 @@ THE SOFTWARE.
2.10.0
+
+ 3107.v665000b_51092
diff --git a/test/pom.xml b/test/pom.xml
index 99ca6535435e..eac388e43b29 100644
--- a/test/pom.xml
+++ b/test/pom.xml
@@ -38,6 +38,8 @@ THE SOFTWARE.
false
+
+ 3107.v665000b_5109280802.13.1-117.v2f1a_b_66ff91d
- 20.15.1
+
+ 3107.v665000b_51092
+ 20.16.01.22.19
@@ -298,14 +300,14 @@ THE SOFTWARE.
org.jenkins-ci.pluginsjunit
- 1265.v65b_14fa_f12f0
+ 1280.v310a_78b_9a_1e0hpiorg.jenkins-ci.plugins.workflowworkflow-api
- 1316.v33eb_726c50b_a_
+ 1322.v857eeeea_9902hpi
@@ -319,7 +321,7 @@ THE SOFTWARE.
io.jenkins.pluginsbootstrap5-api
- 5.3.2-4
+ 5.3.3-1hpi
@@ -402,7 +404,7 @@ THE SOFTWARE.
org.jenkins-ci.pluginsscm-api
- 690.vfc8b_54395023
+ 696.v778d637b_a_762hpi
From 783ed37ec52de654d1547519bafd87e0d529e6b1 Mon Sep 17 00:00:00 2001
From: Tim Jacomb
Date: Sat, 3 Aug 2024 16:15:40 +0100
Subject: [PATCH 11/30] Validate config and adapt from deprecated config
npx --yes --package renovate -- renovate-config-validator
---
.github/renovate.json | 50 ++++++++++++++++++++++++++-----------------
1 file changed, 30 insertions(+), 20 deletions(-)
diff --git a/.github/renovate.json b/.github/renovate.json
index cad65258dc6c..8df185c873b3 100644
--- a/.github/renovate.json
+++ b/.github/renovate.json
@@ -1,7 +1,7 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
- "config:base",
+ "config:recommended",
":disableDependencyDashboard",
":semanticCommitsDisabled"
],
@@ -11,7 +11,7 @@
{
"matchDatasources": ["npm"],
"addLabels": ["javascript"],
- "stabilityDays": 3,
+ "minimumReleaseAge": "3 days",
"reviewers": ["team:sig-ux"]
},
{
@@ -19,52 +19,56 @@
"allowedVersions": "/20.[0-9]+.[0-9]+(.[0-9]+)?$/"
},
{
- "matchPackagePatterns": ["(org.eclipse.jetty:jetty-maven-plugin|org.jenkins-ci:winstone)"],
"description": "Should be upgraded in lockstep in order to keep their corresponding Jetty versions aligned, could be grouped but releases are likely separated by a bit of time",
"matchManagers": ["maven"],
- "enabled": false
+ "enabled": false,
+ "matchPackageNames": [
+ "/(org.eclipse.jetty:jetty-maven-plugin|org.jenkins-ci:winstone)/"
+ ]
},
{
- "matchPackagePatterns": ["jakarta.servlet:jakarta.servlet-api"],
"description": "Provided by Jetty and should be aligned with the version provided by the version of Jetty we deliver. See: https://github.com/jenkinsci/jenkins/pull/5211",
"matchManagers": ["maven"],
- "enabled": false
+ "enabled": false,
+ "matchPackageNames": ["/jakarta.servlet:jakarta.servlet-api/"]
},
{
- "matchPackagePatterns": ["jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api"],
"description": "Contains incompatible API changes and needs compatibility work",
"matchManagers": ["maven"],
- "enabled": false
+ "enabled": false,
+ "matchPackageNames": [
+ "/jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api/"
+ ]
},
{
- "matchPackagePatterns": ["org.codehaus.groovy:groovy-all"],
"description": "Needs significant testing. See: https://github.com/jenkinsci/jenkins/pull/5112#issuecomment-744429487 and https://github.com/jenkinsci/jenkins/pull/5116#issuecomment-744526638",
"matchManagers": ["maven"],
- "allowedVersions": "<2.5.0"
+ "allowedVersions": "<2.5.0",
+ "matchPackageNames": ["/org.codehaus.groovy:groovy-all/"]
},
{
- "matchPackagePatterns": ["org.fusesource.jansi:jansi"],
"description": "Consumed by Groovy and should be updated in lockstep with Groovy. See: https://github.com/jenkinsci/jenkins/pull/5184",
"matchManagers": ["maven"],
- "enabled": false
+ "enabled": false,
+ "matchPackageNames": ["/org.fusesource.jansi:jansi/"]
},
{
- "matchPackagePatterns": ["org.jfree:jfreechart"],
"description": "Contains incompatible API changes and needs compatibility work. See: https://github.com/jenkinsci/jenkins/pull/4224",
"matchManagers": ["maven"],
- "enabled": false
+ "enabled": false,
+ "matchPackageNames": ["/org.jfree:jfreechart/"]
},
{
- "matchPackagePatterns": ["org.springframework"],
"description": "Starting with 6.x, Spring requires Java 17 at a minimum.",
"matchManagers": ["maven"],
- "allowedVersions": "<6.0.0"
+ "allowedVersions": "<6.0.0",
+ "matchPackageNames": ["/org.springframework/"]
},
{
- "matchPackagePatterns": ["com.google.inject:guice-bom"],
"description": "Starting with 7.x, Guice switches from javax.* to jakarta.* bindings. See https://github.com/google/guice/wiki/Guice700",
"matchManagers": ["maven"],
- "allowedVersions": "<7.0.0"
+ "allowedVersions": "<7.0.0",
+ "matchPackageNames": ["/com.google.inject:guice-bom/"]
},
{
"matchFileNames": ["test/pom.xml", "core/pom.xml", "war/pom.xml"],
@@ -73,14 +77,16 @@
"enabled": false
}
],
- "regexManagers": [
+ "customManagers": [
{
+ "customType": "regex",
"fileMatch": ["war/pom.xml"],
"matchStrings": ["(?.*?)"],
"depNameTemplate": "node",
"datasourceTemplate": "npm"
},
{
+ "customType": "regex",
"fileMatch": ["ath.sh"],
"matchStrings": ["export ATH_VERSION=(?.*?)\n"],
"depNameTemplate": "jenkins/ath",
@@ -88,26 +94,30 @@
"versioningTemplate": "loose"
},
{
+ "customType": "regex",
"fileMatch": [".gitpod/Dockerfile"],
"matchStrings": ["ARG MAVEN_VERSION=(?.*?)\n"],
"depNameTemplate": "org.apache.maven:maven-core",
"datasourceTemplate": "maven"
},
{
+ "customType": "regex",
"fileMatch": ["core/src/site/site.xml"],
"matchStrings": ["lit@(?.*?)/"],
"depNameTemplate": "lit",
"datasourceTemplate": "npm"
},
{
+ "customType": "regex",
"fileMatch": ["core/src/site/site.xml"],
"matchStrings": ["webcomponentsjs@(?.*?)/"],
"depNameTemplate": "@webcomponents/webcomponentsjs",
"datasourceTemplate": "npm"
},
{
+ "customType": "regex",
"fileMatch": ["core/src/site/site.xml"],
- "matchStrings": ["(?.*?)<\/version>"],
+ "matchStrings": ["(?.*?)"],
"depNameTemplate": "org.apache.maven.skins:maven-fluido-skin",
"datasourceTemplate": "maven"
}
From 77fec5fcff6d2b02a9c65c118a92fb8a518a9fe9 Mon Sep 17 00:00:00 2001
From: Tim Jacomb
Date: Sat, 3 Aug 2024 16:21:07 +0100
Subject: [PATCH 12/30] Try this
---
.github/renovate.json | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/.github/renovate.json b/.github/renovate.json
index 8df185c873b3..683230391e9a 100644
--- a/.github/renovate.json
+++ b/.github/renovate.json
@@ -14,6 +14,11 @@
"minimumReleaseAge": "3 days",
"reviewers": ["team:sig-ux"]
},
+ {
+ "enabled": false,
+ "matchDatasources": ["maven"],
+ "matchPackageNames": ["org.eclipse.m2e:lifecycle-mapping"]
+ },
{
"matchPackageNames": ["node"],
"allowedVersions": "/20.[0-9]+.[0-9]+(.[0-9]+)?$/"
From 0a667e32bbea91711660e87fe468b3acf697f5d6 Mon Sep 17 00:00:00 2001
From: Tim Jacomb
Date: Sat, 3 Aug 2024 16:24:25 +0100
Subject: [PATCH 13/30] Revert "Try this"
This reverts commit 77fec5fcff6d2b02a9c65c118a92fb8a518a9fe9.
---
.github/renovate.json | 5 -----
1 file changed, 5 deletions(-)
diff --git a/.github/renovate.json b/.github/renovate.json
index 683230391e9a..8df185c873b3 100644
--- a/.github/renovate.json
+++ b/.github/renovate.json
@@ -14,11 +14,6 @@
"minimumReleaseAge": "3 days",
"reviewers": ["team:sig-ux"]
},
- {
- "enabled": false,
- "matchDatasources": ["maven"],
- "matchPackageNames": ["org.eclipse.m2e:lifecycle-mapping"]
- },
{
"matchPackageNames": ["node"],
"allowedVersions": "/20.[0-9]+.[0-9]+(.[0-9]+)?$/"
From 77abc9ba83e1cd57b357c8718af6778472367b8d Mon Sep 17 00:00:00 2001
From: Tim Jacomb
Date: Sat, 3 Aug 2024 16:55:14 +0100
Subject: [PATCH 14/30] Disable package causing warning
---
.github/renovate.json | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/.github/renovate.json b/.github/renovate.json
index 8df185c873b3..38710897fbb3 100644
--- a/.github/renovate.json
+++ b/.github/renovate.json
@@ -75,6 +75,12 @@
"matchPackageNames": ["org.jenkins-ci.main:remoting"],
"description": "Avoid updating the remoting.minimum.supported.version property but still update latest one by not placing this property in the parent pom.xml",
"enabled": false
+ },
+ {
+ "matchPackageNames": ["net.jcip:jcip-annotations"],
+ "matchDatasources": ["maven"],
+ "enabled": false,
+ "description": "maven-metadata.xml is missing for this really old package which is required by renovate"
}
],
"customManagers": [
From 9169adda2626421aa029c69a69fdd981cb6151cf Mon Sep 17 00:00:00 2001
From: Tim Jacomb
Date: Sat, 3 Aug 2024 16:56:06 +0100
Subject: [PATCH 15/30] Suppress other package causing warnings
---
.github/renovate.json | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/.github/renovate.json b/.github/renovate.json
index 38710897fbb3..a30cd370ca91 100644
--- a/.github/renovate.json
+++ b/.github/renovate.json
@@ -81,6 +81,12 @@
"matchDatasources": ["maven"],
"enabled": false,
"description": "maven-metadata.xml is missing for this really old package which is required by renovate"
+ },
+ {
+ "matchPackageNames": ["org.maven.ide.eclipse:lifecycle-mapping"],
+ "matchDatasources": ["maven"],
+ "enabled": false,
+ "description": "see https://github.com/jenkinsci/jenkins/pull/9522"
}
],
"customManagers": [
From 818b9cf0a3e193fd0d05c6a3a943fb8c14e37999 Mon Sep 17 00:00:00 2001
From: Tim Jacomb
Date: Sun, 4 Aug 2024 11:33:19 +0100
Subject: [PATCH 16/30] Update maven dependencies on latest LTS branch
---
.github/renovate.json | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/.github/renovate.json b/.github/renovate.json
index a30cd370ca91..5d7b49b4fab6 100644
--- a/.github/renovate.json
+++ b/.github/renovate.json
@@ -7,20 +7,30 @@
],
"prHourlyLimit": 0,
"postUpdateOptions": ["yarnDedupeHighest"],
+ "baseBranches": ["$default", "stable-2.462"],
"packageRules": [
+ {
+ "matchBaseBranches": ["/stable-.+/"],
+ "matchManagers": ["maven"],
+ "labels": ["dependencies", "into-lts", "needs-justification"],
+ "enabled": true
+ },
{
"matchDatasources": ["npm"],
+ "matchBaseBranches": ["$default"],
"addLabels": ["javascript"],
"minimumReleaseAge": "3 days",
"reviewers": ["team:sig-ux"]
},
{
"matchPackageNames": ["node"],
+ "matchBaseBranches": ["$default"],
"allowedVersions": "/20.[0-9]+.[0-9]+(.[0-9]+)?$/"
},
{
"description": "Should be upgraded in lockstep in order to keep their corresponding Jetty versions aligned, could be grouped but releases are likely separated by a bit of time",
"matchManagers": ["maven"],
+ "matchBaseBranches": ["$default", "/stable-.+/"],
"enabled": false,
"matchPackageNames": [
"/(org.eclipse.jetty:jetty-maven-plugin|org.jenkins-ci:winstone)/"
@@ -29,12 +39,14 @@
{
"description": "Provided by Jetty and should be aligned with the version provided by the version of Jetty we deliver. See: https://github.com/jenkinsci/jenkins/pull/5211",
"matchManagers": ["maven"],
+ "matchBaseBranches": ["$default", "/stable-.+/"],
"enabled": false,
"matchPackageNames": ["/jakarta.servlet:jakarta.servlet-api/"]
},
{
"description": "Contains incompatible API changes and needs compatibility work",
"matchManagers": ["maven"],
+ "matchBaseBranches": ["$default", "/stable-.+/"],
"enabled": false,
"matchPackageNames": [
"/jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api/"
@@ -43,47 +55,55 @@
{
"description": "Needs significant testing. See: https://github.com/jenkinsci/jenkins/pull/5112#issuecomment-744429487 and https://github.com/jenkinsci/jenkins/pull/5116#issuecomment-744526638",
"matchManagers": ["maven"],
+ "matchBaseBranches": ["$default", "/stable-.+/"],
"allowedVersions": "<2.5.0",
"matchPackageNames": ["/org.codehaus.groovy:groovy-all/"]
},
{
"description": "Consumed by Groovy and should be updated in lockstep with Groovy. See: https://github.com/jenkinsci/jenkins/pull/5184",
"matchManagers": ["maven"],
+ "matchBaseBranches": ["$default", "/stable-.+/"],
"enabled": false,
"matchPackageNames": ["/org.fusesource.jansi:jansi/"]
},
{
"description": "Contains incompatible API changes and needs compatibility work. See: https://github.com/jenkinsci/jenkins/pull/4224",
"matchManagers": ["maven"],
+ "matchBaseBranches": ["$default", "/stable-.+/"],
"enabled": false,
"matchPackageNames": ["/org.jfree:jfreechart/"]
},
{
"description": "Starting with 6.x, Spring requires Java 17 at a minimum.",
"matchManagers": ["maven"],
+ "matchBaseBranches": ["$default", "/stable-.+/"],
"allowedVersions": "<6.0.0",
"matchPackageNames": ["/org.springframework/"]
},
{
"description": "Starting with 7.x, Guice switches from javax.* to jakarta.* bindings. See https://github.com/google/guice/wiki/Guice700",
"matchManagers": ["maven"],
+ "matchBaseBranches": ["$default", "/stable-.+/"],
"allowedVersions": "<7.0.0",
"matchPackageNames": ["/com.google.inject:guice-bom/"]
},
{
"matchFileNames": ["test/pom.xml", "core/pom.xml", "war/pom.xml"],
+ "matchBaseBranches": ["$default", "/stable-.+/"],
"matchPackageNames": ["org.jenkins-ci.main:remoting"],
"description": "Avoid updating the remoting.minimum.supported.version property but still update latest one by not placing this property in the parent pom.xml",
"enabled": false
},
{
"matchPackageNames": ["net.jcip:jcip-annotations"],
+ "matchBaseBranches": ["$default", "/stable-.+/"],
"matchDatasources": ["maven"],
"enabled": false,
"description": "maven-metadata.xml is missing for this really old package which is required by renovate"
},
{
"matchPackageNames": ["org.maven.ide.eclipse:lifecycle-mapping"],
+ "matchBaseBranches": ["$default", "/stable-.+/"],
"matchDatasources": ["maven"],
"enabled": false,
"description": "see https://github.com/jenkinsci/jenkins/pull/9522"
From 2dd353d837d1925a8d97906933895778bfad2d27 Mon Sep 17 00:00:00 2001
From: Tim Jacomb
Date: Mon, 5 Aug 2024 14:48:05 +0100
Subject: [PATCH 17/30] Drop usage of $default which doesn't work fully
---
.github/renovate.json | 36 ++++++++++++++++++++----------------
1 file changed, 20 insertions(+), 16 deletions(-)
diff --git a/.github/renovate.json b/.github/renovate.json
index 5d7b49b4fab6..0d05a3b098a7 100644
--- a/.github/renovate.json
+++ b/.github/renovate.json
@@ -7,30 +7,34 @@
],
"prHourlyLimit": 0,
"postUpdateOptions": ["yarnDedupeHighest"],
- "baseBranches": ["$default", "stable-2.462"],
+ "baseBranches": ["master", "stable-2.462"],
"packageRules": [
{
"matchBaseBranches": ["/stable-.+/"],
"matchManagers": ["maven"],
- "labels": ["dependencies", "into-lts", "needs-justification"],
- "enabled": true
+ "labels": ["dependencies", "into-lts", "needs-justification"]
+ },
+ {
+ "matchBaseBranches": ["/stable-.+/"],
+ "matchManagers": ["custom.regex", "npm", "github-actions"],
+ "enabled": false
},
{
"matchDatasources": ["npm"],
- "matchBaseBranches": ["$default"],
+ "matchBaseBranches": ["master"],
"addLabels": ["javascript"],
"minimumReleaseAge": "3 days",
"reviewers": ["team:sig-ux"]
},
{
"matchPackageNames": ["node"],
- "matchBaseBranches": ["$default"],
+ "matchBaseBranches": ["master"],
"allowedVersions": "/20.[0-9]+.[0-9]+(.[0-9]+)?$/"
},
{
"description": "Should be upgraded in lockstep in order to keep their corresponding Jetty versions aligned, could be grouped but releases are likely separated by a bit of time",
"matchManagers": ["maven"],
- "matchBaseBranches": ["$default", "/stable-.+/"],
+ "matchBaseBranches": ["master", "/stable-.+/"],
"enabled": false,
"matchPackageNames": [
"/(org.eclipse.jetty:jetty-maven-plugin|org.jenkins-ci:winstone)/"
@@ -39,14 +43,14 @@
{
"description": "Provided by Jetty and should be aligned with the version provided by the version of Jetty we deliver. See: https://github.com/jenkinsci/jenkins/pull/5211",
"matchManagers": ["maven"],
- "matchBaseBranches": ["$default", "/stable-.+/"],
+ "matchBaseBranches": ["master", "/stable-.+/"],
"enabled": false,
"matchPackageNames": ["/jakarta.servlet:jakarta.servlet-api/"]
},
{
"description": "Contains incompatible API changes and needs compatibility work",
"matchManagers": ["maven"],
- "matchBaseBranches": ["$default", "/stable-.+/"],
+ "matchBaseBranches": ["master", "/stable-.+/"],
"enabled": false,
"matchPackageNames": [
"/jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api/"
@@ -55,55 +59,55 @@
{
"description": "Needs significant testing. See: https://github.com/jenkinsci/jenkins/pull/5112#issuecomment-744429487 and https://github.com/jenkinsci/jenkins/pull/5116#issuecomment-744526638",
"matchManagers": ["maven"],
- "matchBaseBranches": ["$default", "/stable-.+/"],
+ "matchBaseBranches": ["master", "/stable-.+/"],
"allowedVersions": "<2.5.0",
"matchPackageNames": ["/org.codehaus.groovy:groovy-all/"]
},
{
"description": "Consumed by Groovy and should be updated in lockstep with Groovy. See: https://github.com/jenkinsci/jenkins/pull/5184",
"matchManagers": ["maven"],
- "matchBaseBranches": ["$default", "/stable-.+/"],
+ "matchBaseBranches": ["master", "/stable-.+/"],
"enabled": false,
"matchPackageNames": ["/org.fusesource.jansi:jansi/"]
},
{
"description": "Contains incompatible API changes and needs compatibility work. See: https://github.com/jenkinsci/jenkins/pull/4224",
"matchManagers": ["maven"],
- "matchBaseBranches": ["$default", "/stable-.+/"],
+ "matchBaseBranches": ["master", "/stable-.+/"],
"enabled": false,
"matchPackageNames": ["/org.jfree:jfreechart/"]
},
{
"description": "Starting with 6.x, Spring requires Java 17 at a minimum.",
"matchManagers": ["maven"],
- "matchBaseBranches": ["$default", "/stable-.+/"],
+ "matchBaseBranches": ["master", "/stable-.+/"],
"allowedVersions": "<6.0.0",
"matchPackageNames": ["/org.springframework/"]
},
{
"description": "Starting with 7.x, Guice switches from javax.* to jakarta.* bindings. See https://github.com/google/guice/wiki/Guice700",
"matchManagers": ["maven"],
- "matchBaseBranches": ["$default", "/stable-.+/"],
+ "matchBaseBranches": ["master", "/stable-.+/"],
"allowedVersions": "<7.0.0",
"matchPackageNames": ["/com.google.inject:guice-bom/"]
},
{
"matchFileNames": ["test/pom.xml", "core/pom.xml", "war/pom.xml"],
- "matchBaseBranches": ["$default", "/stable-.+/"],
+ "matchBaseBranches": ["master", "/stable-.+/"],
"matchPackageNames": ["org.jenkins-ci.main:remoting"],
"description": "Avoid updating the remoting.minimum.supported.version property but still update latest one by not placing this property in the parent pom.xml",
"enabled": false
},
{
"matchPackageNames": ["net.jcip:jcip-annotations"],
- "matchBaseBranches": ["$default", "/stable-.+/"],
+ "matchBaseBranches": ["master", "/stable-.+/"],
"matchDatasources": ["maven"],
"enabled": false,
"description": "maven-metadata.xml is missing for this really old package which is required by renovate"
},
{
"matchPackageNames": ["org.maven.ide.eclipse:lifecycle-mapping"],
- "matchBaseBranches": ["$default", "/stable-.+/"],
+ "matchBaseBranches": ["master", "/stable-.+/"],
"matchDatasources": ["maven"],
"enabled": false,
"description": "see https://github.com/jenkinsci/jenkins/pull/9522"
From a08c801e5257e4462d7495087c3e931e31b3f075 Mon Sep 17 00:00:00 2001
From: Tim Jacomb
Date: Mon, 5 Aug 2024 15:04:35 +0100
Subject: [PATCH 18/30] Use same file as other branch
---
.github/renovate.json | 21 +++++++--------------
1 file changed, 7 insertions(+), 14 deletions(-)
diff --git a/.github/renovate.json b/.github/renovate.json
index 0d05a3b098a7..9dbeef8d188e 100644
--- a/.github/renovate.json
+++ b/.github/renovate.json
@@ -45,7 +45,7 @@
"matchManagers": ["maven"],
"matchBaseBranches": ["master", "/stable-.+/"],
"enabled": false,
- "matchPackageNames": ["/jakarta.servlet:jakarta.servlet-api/"]
+ "matchPackageNames": ["jakarta.servlet:jakarta.servlet-api"]
},
{
"description": "Contains incompatible API changes and needs compatibility work",
@@ -53,7 +53,7 @@
"matchBaseBranches": ["master", "/stable-.+/"],
"enabled": false,
"matchPackageNames": [
- "/jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api/"
+ "jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api"
]
},
{
@@ -61,35 +61,35 @@
"matchManagers": ["maven"],
"matchBaseBranches": ["master", "/stable-.+/"],
"allowedVersions": "<2.5.0",
- "matchPackageNames": ["/org.codehaus.groovy:groovy-all/"]
+ "matchPackageNames": ["org.codehaus.groovy:groovy-all"]
},
{
"description": "Consumed by Groovy and should be updated in lockstep with Groovy. See: https://github.com/jenkinsci/jenkins/pull/5184",
"matchManagers": ["maven"],
"matchBaseBranches": ["master", "/stable-.+/"],
"enabled": false,
- "matchPackageNames": ["/org.fusesource.jansi:jansi/"]
+ "matchPackageNames": ["org.fusesource.jansi:jansi"]
},
{
"description": "Contains incompatible API changes and needs compatibility work. See: https://github.com/jenkinsci/jenkins/pull/4224",
"matchManagers": ["maven"],
"matchBaseBranches": ["master", "/stable-.+/"],
"enabled": false,
- "matchPackageNames": ["/org.jfree:jfreechart/"]
+ "matchPackageNames": ["org.jfree:jfreechart"]
},
{
"description": "Starting with 6.x, Spring requires Java 17 at a minimum.",
"matchManagers": ["maven"],
"matchBaseBranches": ["master", "/stable-.+/"],
"allowedVersions": "<6.0.0",
- "matchPackageNames": ["/org.springframework/"]
+ "matchPackageNames": ["org.springframework"]
},
{
"description": "Starting with 7.x, Guice switches from javax.* to jakarta.* bindings. See https://github.com/google/guice/wiki/Guice700",
"matchManagers": ["maven"],
"matchBaseBranches": ["master", "/stable-.+/"],
"allowedVersions": "<7.0.0",
- "matchPackageNames": ["/com.google.inject:guice-bom/"]
+ "matchPackageNames": ["com.google.inject:guice-bom"]
},
{
"matchFileNames": ["test/pom.xml", "core/pom.xml", "war/pom.xml"],
@@ -104,13 +104,6 @@
"matchDatasources": ["maven"],
"enabled": false,
"description": "maven-metadata.xml is missing for this really old package which is required by renovate"
- },
- {
- "matchPackageNames": ["org.maven.ide.eclipse:lifecycle-mapping"],
- "matchBaseBranches": ["master", "/stable-.+/"],
- "matchDatasources": ["maven"],
- "enabled": false,
- "description": "see https://github.com/jenkinsci/jenkins/pull/9522"
}
],
"customManagers": [
From 12edfe352d2f76eb1f2be7d879ba395e24525727 Mon Sep 17 00:00:00 2001
From: Tim Jacomb
Date: Mon, 5 Aug 2024 15:08:06 +0100
Subject: [PATCH 19/30] Avoid rate limiting
---
.github/renovate.json | 1 +
1 file changed, 1 insertion(+)
diff --git a/.github/renovate.json b/.github/renovate.json
index 9dbeef8d188e..bd3531b54de0 100644
--- a/.github/renovate.json
+++ b/.github/renovate.json
@@ -6,6 +6,7 @@
":semanticCommitsDisabled"
],
"prHourlyLimit": 0,
+ "prConcurrentLimit": 0,
"postUpdateOptions": ["yarnDedupeHighest"],
"baseBranches": ["master", "stable-2.462"],
"packageRules": [
From c8e5bd75691da01f3d294a8a008218b645c70d27 Mon Sep 17 00:00:00 2001
From: Tim Jacomb
Date: Mon, 5 Aug 2024 15:20:09 +0100
Subject: [PATCH 20/30] Update master
---
.github/PULL_REQUEST_TEMPLATE.md | 12 +-
.../workflows/publish-release-artifact.yml | 10 +-
ath.sh | 2 +-
bom/pom.xml | 4 +-
.../java/hudson/ClassicPluginStrategy.java | 2 +-
core/src/main/java/hudson/PluginManager.java | 4 +-
.../java/hudson/lifecycle/ExitLifecycle.java | 6 +
.../main/java/hudson/lifecycle/Lifecycle.java | 10 +
.../main/java/hudson/model/AbstractItem.java | 94 +--
.../java/hudson/model/AbstractProject.java | 1 +
.../hudson/model/AdministrativeMonitor.java | 7 +-
.../hudson/model/BuildAuthorizationToken.java | 5 -
.../main/java/hudson/model/Descriptor.java | 5 +-
core/src/main/java/hudson/model/Queue.java | 5 +
.../main/java/hudson/model/UpdateCenter.java | 182 +++++-
core/src/main/java/hudson/model/User.java | 2 +-
.../main/java/hudson/model/UserProperty.java | 2 +-
.../hudson/model/UserPropertyDescriptor.java | 4 +-
.../hudson/model/listeners/ItemListener.java | 25 +
.../hudson/model/queue/MappingWorksheet.java | 3 +
.../hudson/model/queue/QueueTaskFilter.java | 1 +
.../main/java/hudson/model/queue/SubTask.java | 2 +
.../userproperty/UserPropertyCategory.java | 2 +-
.../main/java/hudson/util/BootFailure.java | 2 +
.../java/jenkins/agents/WebSocketAgents.java | 5 +-
...erRetentionCheckIntervalConfiguration.java | 4 +-
.../jenkins/model/ParameterizedJobMixIn.java | 1 +
.../RemoveYuiUserExperimentalFlag.java | 49 ++
.../jenkins/model/queue/ItemDeletion.java | 109 +++-
.../java/jenkins/widgets/BuildTimeTrend.java | 8 +
.../hudson/TcpSlaveAgentListener/index.jelly | 7 +-
.../hudson/model/Job/buildTimeTrend.jelly | 47 +-
.../model/Job/buildTimeTrend_resources.css | 11 +-
.../model/Job/buildTimeTrend_resources.js | 55 +-
.../end-of-life-data.json | 46 +-
.../resources/lib/form/secretTextarea.jelly | 28 +-
.../lib/form/secretTextarea/secret.css | 6 +-
.../lib/form/secretTextarea/secret.js | 35 +-
.../main/resources/lib/layout/layout.jelly | 47 +-
pom.xml | 8 +-
test/pom.xml | 10 +-
.../ParametersDefinitionPropertyTest.java | 31 +
...ildKeepsRunningWhenFaultySubTasksTest.java | 1 +
.../hudson/util/FormFieldValidatorTest.java | 125 +++-
.../jenkins/widgets/BuildTimeTrendTest.java | 12 +-
.../java/lib/form/SecretTextareaTest.java | 15 +-
.../ValidatingDescribable/config.jelly | 20 +
war/package.json | 22 +-
war/src/main/scss/components/_table.scss | 27 +-
war/src/main/scss/form/_layout.scss | 2 +-
.../main/webapp/scripts/hudson-behavior.js | 30 +-
war/yarn.lock | 599 +++++++++---------
52 files changed, 1165 insertions(+), 587 deletions(-)
create mode 100644 core/src/main/java/jenkins/model/experimentalflags/RemoveYuiUserExperimentalFlag.java
create mode 100644 test/src/test/resources/hudson/util/FormFieldValidatorTest/ValidatingDescribable/config.jelly
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 456f8fca6da7..a2ed88450df5 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -28,16 +28,17 @@ For refactoring and code cleanup changes, exercise the code before and after the
### Proposed changelog entries
-- JENKINS-XXXXX, human-readable text
+- human-readable text
@@ -45,6 +46,11 @@ You may add multiple changelog entries if applicable by adding a new entry to th
N/A
+
+
```[tasklist]
### Submitter checklist
- [ ] The Jira issue, if it exists, is well-described.
diff --git a/.github/workflows/publish-release-artifact.yml b/.github/workflows/publish-release-artifact.yml
index 04e3d0aa993e..ae5e6bf92602 100644
--- a/.github/workflows/publish-release-artifact.yml
+++ b/.github/workflows/publish-release-artifact.yml
@@ -73,7 +73,7 @@ jobs:
wget -q https://get.jenkins.io/${REPO}/${PROJECT_VERSION}/${FILE_NAME}
- name: Upload Release Asset
id: upload-war
- uses: softprops/action-gh-release@a74c6b72af54cfa997e81df42d94703d6313a2d0
+ uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
@@ -108,7 +108,7 @@ jobs:
- name: Upload Release Asset
id: upload-deb
if: always()
- uses: softprops/action-gh-release@a74c6b72af54cfa997e81df42d94703d6313a2d0
+ uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
@@ -144,7 +144,7 @@ jobs:
- name: Upload Release Asset
id: upload-rpm
if: always()
- uses: softprops/action-gh-release@a74c6b72af54cfa997e81df42d94703d6313a2d0
+ uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
@@ -180,7 +180,7 @@ jobs:
- name: Upload Release Asset
id: upload-msi
if: always()
- uses: softprops/action-gh-release@a74c6b72af54cfa997e81df42d94703d6313a2d0
+ uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
@@ -216,7 +216,7 @@ jobs:
- name: Upload Release Asset
id: upload-suse-rpm
if: always()
- uses: softprops/action-gh-release@a74c6b72af54cfa997e81df42d94703d6313a2d0
+ uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
diff --git a/ath.sh b/ath.sh
index 36af3cea0e85..3cd7dfd86d75 100644
--- a/ath.sh
+++ b/ath.sh
@@ -6,7 +6,7 @@ set -o xtrace
cd "$(dirname "$0")"
# https://github.com/jenkinsci/acceptance-test-harness/releases
-export ATH_VERSION=5883.vdea_99c1762a_d
+export ATH_VERSION=5911.v5f88b_6d0c450
if [[ $# -eq 0 ]]; then
export JDK=17
diff --git a/bom/pom.xml b/bom/pom.xml
index 150deffe0389..8f8e6412f7b0 100644
--- a/bom/pom.xml
+++ b/bom/pom.xml
@@ -40,7 +40,7 @@ THE SOFTWARE.
2.0.0-M22.0.13
- 1881.vd39f3ee5c629
+ 1892.v73465f3d074d2.4.21
@@ -113,7 +113,7 @@ THE SOFTWARE.
commons-codeccommons-codec
- 1.17.0
+ 1.17.1commons-collections
diff --git a/core/src/main/java/hudson/ClassicPluginStrategy.java b/core/src/main/java/hudson/ClassicPluginStrategy.java
index 8c39f14ef2d5..3d6edf832f9f 100644
--- a/core/src/main/java/hudson/ClassicPluginStrategy.java
+++ b/core/src/main/java/hudson/ClassicPluginStrategy.java
@@ -252,7 +252,7 @@ private void fix(Attributes atts, List optionalDepende
for (Dependency d : DetachedPluginsUtil.getImpliedDependencies(pluginName, jenkinsVersion)) {
LOGGER.fine(() -> "implied dep " + pluginName + " → " + d.shortName);
- pluginManager.considerDetachedPlugin(d.shortName);
+ pluginManager.considerDetachedPlugin(d.shortName, pluginName);
optionalDependencies.add(d);
}
}
diff --git a/core/src/main/java/hudson/PluginManager.java b/core/src/main/java/hudson/PluginManager.java
index eda266735173..75dd52c4d7b7 100644
--- a/core/src/main/java/hudson/PluginManager.java
+++ b/core/src/main/java/hudson/PluginManager.java
@@ -615,7 +615,7 @@ public void run(Reactor reactor) throws Exception {
}});
}
- void considerDetachedPlugin(String shortName) {
+ void considerDetachedPlugin(String shortName, String source) {
if (new File(rootDir, shortName + ".jpi").isFile() ||
new File(rootDir, shortName + ".hpi").isFile() ||
new File(rootDir, shortName + ".jpl").isFile() ||
@@ -627,7 +627,7 @@ void considerDetachedPlugin(String shortName) {
for (String loadedFile : loadPluginsFromWar(getDetachedLocation(), (dir, name) -> normalisePluginName(name).equals(shortName))) {
String loaded = normalisePluginName(loadedFile);
File arc = new File(rootDir, loaded + ".jpi");
- LOGGER.info(() -> "Loading a detached plugin as a dependency: " + arc);
+ LOGGER.info(() -> "Loading a detached plugin " + arc + " as a dependency of " + source);
try {
plugins.add(strategy.createPluginWrapper(arc));
} catch (IOException e) {
diff --git a/core/src/main/java/hudson/lifecycle/ExitLifecycle.java b/core/src/main/java/hudson/lifecycle/ExitLifecycle.java
index f8fcc3abefbf..038dafc442a3 100644
--- a/core/src/main/java/hudson/lifecycle/ExitLifecycle.java
+++ b/core/src/main/java/hudson/lifecycle/ExitLifecycle.java
@@ -26,6 +26,7 @@
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.Extension;
+import hudson.util.BootFailure;
import java.util.logging.Level;
import java.util.logging.Logger;
import jenkins.model.Jenkins;
@@ -72,4 +73,9 @@ public void restart() {
System.exit(exitOnRestart);
}
+
+ @Override
+ public void onBootFailure(BootFailure problem) {
+ restart();
+ }
}
diff --git a/core/src/main/java/hudson/lifecycle/Lifecycle.java b/core/src/main/java/hudson/lifecycle/Lifecycle.java
index dbc53d2b5005..fcd7769aeff2 100644
--- a/core/src/main/java/hudson/lifecycle/Lifecycle.java
+++ b/core/src/main/java/hudson/lifecycle/Lifecycle.java
@@ -32,6 +32,8 @@
import hudson.Util;
import hudson.init.InitMilestone;
import hudson.init.Initializer;
+import hudson.util.BootFailure;
+import hudson.util.JenkinsReloadFailed;
import java.io.File;
import java.io.IOException;
import java.io.UncheckedIOException;
@@ -324,6 +326,14 @@ public boolean supportsDynamicLoad() {
return true;
}
+ /**
+ * Called when Jenkins has failed to boot.
+ * @param problem a boot failure (could be {@link JenkinsReloadFailed})
+ * @since TODO
+ */
+ public void onBootFailure(BootFailure problem) {
+ }
+
@Restricted(NoExternalUse.class)
public static final class PlaceholderLifecycle extends ExitLifecycle {
diff --git a/core/src/main/java/hudson/model/AbstractItem.java b/core/src/main/java/hudson/model/AbstractItem.java
index 614b1c13eb4d..adebec8f289f 100644
--- a/core/src/main/java/hudson/model/AbstractItem.java
+++ b/core/src/main/java/hudson/model/AbstractItem.java
@@ -25,7 +25,6 @@
package hudson.model;
-import static hudson.model.queue.Executables.getParentOf;
import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST;
import com.infradna.tool.bridge_method_injector.WithBridgeMethods;
@@ -39,9 +38,6 @@
import hudson.cli.declarative.CLIResolver;
import hudson.model.listeners.ItemListener;
import hudson.model.listeners.SaveableListener;
-import hudson.model.queue.SubTask;
-import hudson.model.queue.Tasks;
-import hudson.model.queue.WorkUnit;
import hudson.security.ACL;
import hudson.security.ACLContext;
import hudson.security.AccessControlled;
@@ -57,12 +53,8 @@
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
import java.util.List;
import java.util.ListIterator;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
@@ -705,11 +697,13 @@ public void delete(StaplerRequest req, StaplerResponse rsp) throws IOException,
*
*
* Any exception indicates the deletion has failed, but {@link AbortException} would prevent the caller
- * from showing the stack trace. This
+ * from showing the stack trace.
+ * @see ItemDeletion
*/
@Override
public void delete() throws IOException, InterruptedException {
checkPermission(DELETE);
+ ItemListener.checkBeforeDelete(this);
boolean responsibleForAbortingBuilds = !ItemDeletion.contains(this);
boolean ownsRegistration = ItemDeletion.register(this);
if (!ownsRegistration && ItemDeletion.isRegistered(this)) {
@@ -719,87 +713,7 @@ public void delete() throws IOException, InterruptedException {
try {
// if a build is in progress. Cancel it.
if (responsibleForAbortingBuilds || ownsRegistration) {
- Queue queue = Queue.getInstance();
- if (this instanceof Queue.Task) {
- // clear any items in the queue so they do not get picked up
- queue.cancel((Queue.Task) this);
- }
- // now cancel any child items - this happens after ItemDeletion registration, so we can use a snapshot
- for (Queue.Item i : queue.getItems()) {
- Item item = Tasks.getItemOf(i.task);
- while (item != null) {
- if (item == this) {
- if (!queue.cancel(i)) {
- LOGGER.warning(() -> "failed to cancel " + i);
- }
- break;
- }
- if (item.getParent() instanceof Item) {
- item = (Item) item.getParent();
- } else {
- break;
- }
- }
- }
- // interrupt any builds in progress (and this should be a recursive test so that folders do not pay
- // the 15 second delay for every child item). This happens after queue cancellation, so will be
- // a complete set of builds in flight
- Map buildsInProgress = new LinkedHashMap<>();
- for (Computer c : Jenkins.get().getComputers()) {
- for (Executor e : c.getAllExecutors()) {
- final WorkUnit workUnit = e.getCurrentWorkUnit();
- final Queue.Executable executable = workUnit != null ? workUnit.getExecutable() : null;
- final SubTask subtask = executable != null ? getParentOf(executable) : null;
-
- if (subtask != null) {
- Item item = Tasks.getItemOf(subtask);
- while (item != null) {
- if (item == this) {
- buildsInProgress.put(e, e.getCurrentExecutable());
- e.interrupt(Result.ABORTED);
- break;
- }
- if (item.getParent() instanceof Item) {
- item = (Item) item.getParent();
- } else {
- break;
- }
- }
- }
- }
- }
- if (!buildsInProgress.isEmpty()) {
- // give them 15 seconds or so to respond to the interrupt
- long expiration = System.nanoTime() + TimeUnit.SECONDS.toNanos(15);
- // comparison with executor.getCurrentExecutable() == computation currently should always be true
- // as we no longer recycle Executors, but safer to future-proof in case we ever revisit recycling
- while (!buildsInProgress.isEmpty() && expiration - System.nanoTime() > 0L) {
- // we know that ItemDeletion will prevent any new builds in the queue
- // ItemDeletion happens-before Queue.cancel so we know that the Queue will stay clear
- // Queue.cancel happens-before collecting the buildsInProgress list
- // thus buildsInProgress contains the complete set we need to interrupt and wait for
- for (Iterator> iterator =
- buildsInProgress.entrySet().iterator();
- iterator.hasNext(); ) {
- Map.Entry entry = iterator.next();
- // comparison with executor.getCurrentExecutable() == executable currently should always be
- // true as we no longer recycle Executors, but safer to future-proof in case we ever
- // revisit recycling.
- if (!entry.getKey().isAlive()
- || entry.getValue() != entry.getKey().getCurrentExecutable()) {
- iterator.remove();
- }
- // I don't know why, but we have to keep interrupting
- entry.getKey().interrupt(Result.ABORTED);
- }
- Thread.sleep(50L);
- }
- if (!buildsInProgress.isEmpty()) {
- throw new Failure(Messages.AbstractItem_FailureToStopBuilds(
- buildsInProgress.size(), getFullDisplayName()
- ));
- }
- }
+ ItemDeletion.cancelBuildsInProgress(this);
}
if (this instanceof ItemGroup) {
// delete individual items first
diff --git a/core/src/main/java/hudson/model/AbstractProject.java b/core/src/main/java/hudson/model/AbstractProject.java
index c323f50bca0b..c568f8df8b31 100644
--- a/core/src/main/java/hudson/model/AbstractProject.java
+++ b/core/src/main/java/hudson/model/AbstractProject.java
@@ -1011,6 +1011,7 @@ public List getActions() {
* null if no information is available (for example,
* if no build was done yet.)
*/
+ @SuppressWarnings("deprecation")
@Override
public Node getLastBuiltOn() {
// where was it built on?
diff --git a/core/src/main/java/hudson/model/AdministrativeMonitor.java b/core/src/main/java/hudson/model/AdministrativeMonitor.java
index e2f69d654ca8..bdbfb48027d3 100644
--- a/core/src/main/java/hudson/model/AdministrativeMonitor.java
+++ b/core/src/main/java/hudson/model/AdministrativeMonitor.java
@@ -200,7 +200,10 @@ public void doDisable(StaplerRequest req, StaplerResponse rsp) throws IOExceptio
* Form UI elements that change system state, e.g. toggling a feature on or off, need to be hidden from users
* lacking Administer permission.
*
+ * @since 2.233
+ * @deprecated Callers should use {@link #checkRequiredPermission()} or {@link #hasRequiredPermission()}.
*/
+ @Deprecated
public Permission getRequiredPermission() {
return Jenkins.ADMINISTER;
}
@@ -213,6 +216,7 @@ public Permission getRequiredPermission() {
*
* @see #getRequiredPermission()
* @see #hasRequiredPermission()
+ * @since 2.468
*/
public void checkRequiredPermission() {
Jenkins.get().checkPermission(getRequiredPermission());
@@ -226,6 +230,7 @@ public void checkRequiredPermission() {
*
* @see #getRequiredPermission()
* @see #checkRequiredPermission()
+ * @since 2.468
*/
public boolean hasRequiredPermission() {
return Jenkins.get().hasPermission(getRequiredPermission());
@@ -236,7 +241,7 @@ public boolean hasRequiredPermission() {
*
* @return true if the current user has the minimum required permission to view any administrative monitor.
*
- * @since TODO
+ * @since 2.468
*/
public static boolean hasPermissionToDisplay() {
return Jenkins.get().hasAnyPermission(Jenkins.SYSTEM_READ, Jenkins.MANAGE);
diff --git a/core/src/main/java/hudson/model/BuildAuthorizationToken.java b/core/src/main/java/hudson/model/BuildAuthorizationToken.java
index f101eb3d6e74..a09ed113e1cf 100644
--- a/core/src/main/java/hudson/model/BuildAuthorizationToken.java
+++ b/core/src/main/java/hudson/model/BuildAuthorizationToken.java
@@ -29,7 +29,6 @@
import hudson.security.ACL;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
-import jenkins.security.ApiTokenProperty;
import org.kohsuke.stapler.HttpResponses;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
@@ -82,10 +81,6 @@ public static void checkPermission(Job, ?> project, BuildAuthorizationToken to
return;
}
- if (req.getAttribute(ApiTokenProperty.class.getName()) instanceof User) {
- return;
- }
-
rsp.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
rsp.addHeader("Allow", "POST");
throw HttpResponses.forwardToView(project, "requirePOST.jelly");
diff --git a/core/src/main/java/hudson/model/Descriptor.java b/core/src/main/java/hudson/model/Descriptor.java
index 07789531e94d..b5eb07784d27 100644
--- a/core/src/main/java/hudson/model/Descriptor.java
+++ b/core/src/main/java/hudson/model/Descriptor.java
@@ -594,6 +594,9 @@ public T newInstance(@Nullable StaplerRequest req, @NonNull JSONObject formData)
return verifyNewInstance(bindJSON(req, clazz, formData, true));
}
} catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException | RuntimeException e) {
+ if (e instanceof RuntimeException && e instanceof HttpResponse) {
+ throw (RuntimeException) e;
+ }
throw new LinkageError("Failed to instantiate " + clazz + " from " + RedactSecretJsonInErrorMessageSanitizer.INSTANCE.sanitize(formData), e);
}
}
@@ -674,7 +677,7 @@ public Object instantiate(Class actualType, JSONObject json) {
+ actualType.getName() + " " + json);
}
} catch (Exception x) {
- LOGGER.log(Level.WARNING, "falling back to default instantiation " + actualType.getName() + " " + json, x);
+ LOGGER.log(x instanceof HttpResponse ? Level.FINE : Level.WARNING, "falling back to default instantiation " + actualType.getName() + " " + json, x);
// If nested objects are not using newInstance, bindJSON will wind up throwing the same exception anyway,
// so logging above will result in a duplicated stack trace.
// However if they *are* then this is the only way to find errors in that newInstance.
diff --git a/core/src/main/java/hudson/model/Queue.java b/core/src/main/java/hudson/model/Queue.java
index d489f042100d..0d299fb9426d 100644
--- a/core/src/main/java/hudson/model/Queue.java
+++ b/core/src/main/java/hudson/model/Queue.java
@@ -130,6 +130,7 @@
import org.kohsuke.stapler.HttpResponse;
import org.kohsuke.stapler.HttpResponses;
import org.kohsuke.stapler.QueryParameter;
+import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.ExportedBean;
import org.kohsuke.stapler.interceptor.RequirePOST;
@@ -2414,6 +2415,10 @@ public Api getApi() throws AccessDeniedException {
}
}
+ public HttpResponse doIndex(StaplerRequest req) {
+ return HttpResponses.text("Queue item exists. For details check, for example, " + req.getRequestURI() + "api/json?tree=cancelled,executable[url]");
+ }
+
protected Object readResolve() {
this.future = new FutureImpl(task);
return this;
diff --git a/core/src/main/java/hudson/model/UpdateCenter.java b/core/src/main/java/hudson/model/UpdateCenter.java
index 03ab31314372..4df95b7b3f45 100644
--- a/core/src/main/java/hudson/model/UpdateCenter.java
+++ b/core/src/main/java/hudson/model/UpdateCenter.java
@@ -58,14 +58,18 @@
import hudson.util.PersistedList;
import hudson.util.VersionNumber;
import hudson.util.XStream2;
+import java.io.BufferedInputStream;
import java.io.File;
+import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
+import java.io.UncheckedIOException;
import java.lang.reflect.Constructor;
import java.net.HttpRetryException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
+import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLConnection;
import java.net.UnknownHostException;
@@ -86,6 +90,7 @@
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
import java.util.Set;
import java.util.TreeSet;
import java.util.UUID;
@@ -1322,6 +1327,10 @@ public File download(DownloadJob job, URL src) throws IOException {
sha512 != null ? new DigestOutputStream(_out, sha512) : _out, sha256) : _out, sha1) : _out;
InputStream in = con.getInputStream();
CountingInputStream cin = new CountingInputStream(in)) {
+ if (LOGGER.isLoggable(Level.FINE)) {
+ var sourceUrlString = getSourceUrl(src, con);
+ LOGGER.fine(() -> "Downloading " + job.getName() + " from " + sourceUrlString);
+ }
while ((len = cin.read(buf)) >= 0) {
out.write(buf, 0, len);
final int count = cin.getCount();
@@ -1358,15 +1367,22 @@ public File download(DownloadJob job, URL src) throws IOException {
return tmp;
} catch (IOException e) {
// assist troubleshooting in case of e.g. "too many redirects" by printing actual URL
- String extraMessage = "";
- if (con != null && con.getURL() != null && !src.toString().equals(con.getURL().toString())) {
- // Two URLs are considered equal if different hosts resolve to same IP. Prefer to log in case of string inequality,
- // because who knows how the server responds to different host name in the request header?
- // Also, since it involved name resolution, it'd be an expensive operation.
- extraMessage = " (redirected to: " + con.getURL() + ")";
+ throw new IOException("Failed to download from " + getSourceUrl(src, con), e);
+ }
+ }
+
+ private static String getSourceUrl(@NonNull URL src, @CheckForNull URLConnection connection) {
+ var sourceUrlString = src.toExternalForm();
+ if (connection != null) {
+ var connectionURL = connection.getURL();
+ if (connectionURL != null) {
+ var finalUrlString = connectionURL.toExternalForm();
+ if (!sourceUrlString.equals(finalUrlString)) {
+ return sourceUrlString + " → " + finalUrlString;
+ }
}
- throw new IOException("Failed to download from " + src + extraMessage, e);
}
+ return sourceUrlString;
}
/**
@@ -1798,6 +1814,83 @@ public void run() {
String getComputedSHA512();
}
+ @SuppressFBWarnings(value = "WEAK_MESSAGE_DIGEST_SHA1", justification = "SHA-1 is only used as a fallback if SHA-256/SHA-512 are not available")
+ private static class FileWithComputedChecksums implements WithComputedChecksums {
+
+ private final File file;
+
+ private String computedSHA1;
+ private String computedSHA256;
+ private String computedSHA512;
+
+ FileWithComputedChecksums(File file) {
+ this.file = Objects.requireNonNull(file);
+ }
+
+ @Override
+ public synchronized String getComputedSHA1() {
+ if (computedSHA1 != null) {
+ return computedSHA1;
+ }
+
+ MessageDigest messageDigest;
+ try {
+ messageDigest = MessageDigest.getInstance("SHA-1");
+ } catch (NoSuchAlgorithmException e) {
+ throw new UnsupportedOperationException(e);
+ }
+ computedSHA1 = computeDigest(messageDigest);
+ return computedSHA1;
+ }
+
+ @Override
+ public synchronized String getComputedSHA256() {
+ if (computedSHA256 != null) {
+ return computedSHA256;
+ }
+
+ MessageDigest messageDigest;
+ try {
+ messageDigest = MessageDigest.getInstance("SHA-256");
+ } catch (NoSuchAlgorithmException e) {
+ throw new UnsupportedOperationException(e);
+ }
+ computedSHA256 = computeDigest(messageDigest);
+ return computedSHA256;
+ }
+
+ @Override
+ public synchronized String getComputedSHA512() {
+ if (computedSHA512 != null) {
+ return computedSHA512;
+ }
+
+ MessageDigest messageDigest;
+ try {
+ messageDigest = MessageDigest.getInstance("SHA-512");
+ } catch (NoSuchAlgorithmException e) {
+ throw new UnsupportedOperationException(e);
+ }
+ computedSHA512 = computeDigest(messageDigest);
+ return computedSHA512;
+ }
+
+ private String computeDigest(MessageDigest digest) {
+ try (InputStream is = new FileInputStream(file);
+ BufferedInputStream bis = new BufferedInputStream(is)) {
+ byte[] buffer = new byte[1024];
+ int read = bis.read(buffer, 0, buffer.length);
+ while (read > -1) {
+ digest.update(buffer, 0, read);
+ read = bis.read(buffer, 0, buffer.length);
+ }
+ return Base64.getEncoder().encodeToString(digest.digest());
+ } catch (IOException e) {
+ throw new UncheckedIOException(e);
+ }
+ }
+ }
+
/**
* Base class for a job that downloads a file from the Jenkins project.
*/
@@ -2234,7 +2327,24 @@ public void _run() throws IOException, InstallationStatus {
return;
}
try {
- super._run();
+ File cached = getCached(this);
+ if (cached != null) {
+ File dst = getDestination();
+
+ // A bit naive, but following the corresponding logic in UpdateCenterConfiguration#download...
+ File tmp = new File(dst.getPath() + ".tmp");
+ Files.copy(cached.toPath(), tmp.toPath(), StandardCopyOption.REPLACE_EXISTING);
+
+ config.postValidate(this, tmp);
+
+ /*
+ * Will unfortunately validate the checksum a second time, but this should still be faster than
+ * network I/O and at least allows us to reuse code...
+ */
+ config.install(this, tmp, dst);
+ } else {
+ super._run();
+ }
// if this is a bundled plugin, make sure it won't get overwritten
PluginWrapper pw = plugin.getInstalled();
@@ -2267,6 +2377,62 @@ public void _run() throws IOException, InstallationStatus {
}
}
+ /**
+ * If we happen to have the file already in the {@coode WEB-INF/detached-plugins} directory and it happens to
+ * match the checksum we were expecting, then save ourselves a trip to the download site. This method is
+ * best-effort, and if anything goes wrong we simply fall back to the standard download path.
+ *
+ * @return The cached file, or null for a cache miss
+ */
+ @CheckForNull
+ private File getCached(DownloadJob job) {
+ URL src;
+ try {
+ /*
+ * Could make PluginManager#getDetachedLocation public and consume it here, but this method is
+ * best-effort anyway.
+ */
+ src = Jenkins.get().servletContext.getResource(String.format("/WEB-INF/detached-plugins/%s.hpi", plugin.name));
+ } catch (MalformedURLException e) {
+ return null;
+ }
+
+ if (src == null || !"file".equals(src.getProtocol())) {
+ return null;
+ }
+
+ try {
+ config.preValidate(this, src);
+ } catch (IOException e) {
+ return null;
+ }
+
+ File cached;
+ try {
+ cached = new File(src.toURI());
+ } catch (URISyntaxException e) {
+ return null;
+ }
+
+ if (!cached.isFile()) {
+ return null;
+ }
+
+ WithComputedChecksums withComputedChecksums = new FileWithComputedChecksums(cached);
+ try {
+ verifyChecksums(withComputedChecksums, plugin, cached);
+ } catch (IOException | UncheckedIOException | UnsupportedOperationException e) {
+ return null;
+ }
+
+ // Allow us to reuse UpdateCenter.InstallationJob#replace.
+ job.computedSHA1 = withComputedChecksums.getComputedSHA1();
+ job.computedSHA256 = withComputedChecksums.getComputedSHA256();
+ job.computedSHA512 = withComputedChecksums.getComputedSHA512();
+
+ return cached;
+ }
+
/**
* Indicates there is another installation job for this plugin
* @since 2.1
diff --git a/core/src/main/java/hudson/model/User.java b/core/src/main/java/hudson/model/User.java
index e588a79b347a..792622eb3c54 100644
--- a/core/src/main/java/hudson/model/User.java
+++ b/core/src/main/java/hudson/model/User.java
@@ -344,7 +344,7 @@ public synchronized void addProperty(@NonNull UserProperty p) throws IOException
* The properties not included in the list will be let untouched.
* It will call the {@link UserProperty#setUser(User)} method and at the end, {@link #save()} once.
*
- * @since TODO
+ * @since 2.468
*/
public synchronized void addProperties(@NonNull List multipleProperties) throws IOException {
List newProperties = new ArrayList<>(this.properties);
diff --git a/core/src/main/java/hudson/model/UserProperty.java b/core/src/main/java/hudson/model/UserProperty.java
index 6538a5fdf661..a6ebeb738b23 100644
--- a/core/src/main/java/hudson/model/UserProperty.java
+++ b/core/src/main/java/hudson/model/UserProperty.java
@@ -86,7 +86,7 @@ public static DescriptorExtensionList all(
/**
* Returns all the registered {@link UserPropertyCategory} descriptors for a given category.
*
- * @since TODO
+ * @since 2.468
*/
public static List allByCategoryClass(@NonNull Class extends UserPropertyCategory> categoryClass) {
DescriptorExtensionList all = all();
diff --git a/core/src/main/java/hudson/model/UserPropertyDescriptor.java b/core/src/main/java/hudson/model/UserPropertyDescriptor.java
index ff3171c1fbf7..66762bf3c716 100644
--- a/core/src/main/java/hudson/model/UserPropertyDescriptor.java
+++ b/core/src/main/java/hudson/model/UserPropertyDescriptor.java
@@ -85,7 +85,7 @@ public boolean isEnabled() {
*
* @return never null, always the same value for a given instance of {@link Descriptor}.
*
- * @since TODO
+ * @since 2.468
*/
public @NonNull UserPropertyCategory getUserPropertyCategory() {
// As this method is expected to be overloaded by subclasses
@@ -120,7 +120,7 @@ public boolean isEnabled() {
*
* @return String name corresponding to the symbol of {@link #getUserPropertyCategory()}
*
- * @since TODO
+ * @since 2.468
*/
@Deprecated
protected @CheckForNull String getUserPropertyCategoryAsString() {
diff --git a/core/src/main/java/hudson/model/listeners/ItemListener.java b/core/src/main/java/hudson/model/listeners/ItemListener.java
index aef431c3207b..fe09a9c56373 100644
--- a/core/src/main/java/hudson/model/listeners/ItemListener.java
+++ b/core/src/main/java/hudson/model/listeners/ItemListener.java
@@ -35,6 +35,8 @@
import java.util.logging.Level;
import java.util.logging.Logger;
import jenkins.util.Listeners;
+import org.kohsuke.accmod.Restricted;
+import org.kohsuke.accmod.restrictions.NoExternalUse;
/**
* Receives notifications about CRUD operations of {@link Item}.
@@ -94,6 +96,16 @@ public void onCopied(Item src, Item item) {
public void onLoaded() {
}
+ /**
+ * Called before an item is deleted, providing the ability to veto the deletion operation before it starts.
+ * @param item the item being deleted
+ * @throws Failure to veto the operation.
+ * @throws InterruptedException If a blocking condition was interrupted, also vetoing the operation.
+ * @since TODO
+ */
+ public void onCheckDelete(Item item) throws Failure, InterruptedException {
+ }
+
/**
* Called right before a job is going to be deleted.
*
@@ -205,6 +217,19 @@ public static void fireOnUpdated(final Item item) {
Listeners.notify(ItemListener.class, false, l -> l.onUpdated(item));
}
+ @Restricted(NoExternalUse.class)
+ public static void checkBeforeDelete(Item item) throws Failure, InterruptedException {
+ for (ItemListener l : all()) {
+ try {
+ l.onCheckDelete(item);
+ } catch (Failure e) {
+ throw e;
+ } catch (RuntimeException x) {
+ LOGGER.log(Level.WARNING, "failed to send event to listener of " + l.getClass(), x);
+ }
+ }
+ }
+
/** @since 1.548 */
public static void fireOnDeleted(final Item item) {
Listeners.notify(ItemListener.class, false, l -> l.onDeleted(item));
diff --git a/core/src/main/java/hudson/model/queue/MappingWorksheet.java b/core/src/main/java/hudson/model/queue/MappingWorksheet.java
index 9dbeaa3816f4..8150dd1bc132 100644
--- a/core/src/main/java/hudson/model/queue/MappingWorksheet.java
+++ b/core/src/main/java/hudson/model/queue/MappingWorksheet.java
@@ -190,7 +190,9 @@ public class WorkChunk extends ReadOnlyList {
* If the previous execution of this task run on a certain node
* and this task prefers to run on the same node, return that.
* Otherwise null.
+ * @deprecated Unused.
*/
+ @Deprecated
public final ExecutorChunk lastBuiltOn;
@@ -200,6 +202,7 @@ private WorkChunk(List base, int index) {
this.index = index;
this.assignedLabel = getAssignedLabel(base.get(0));
+ @SuppressWarnings("deprecation")
Node lbo = base.get(0).getLastBuiltOn();
for (ExecutorChunk ec : executors) {
if (ec.node == lbo) {
diff --git a/core/src/main/java/hudson/model/queue/QueueTaskFilter.java b/core/src/main/java/hudson/model/queue/QueueTaskFilter.java
index e2a113dfaa59..a36c5ca7c753 100644
--- a/core/src/main/java/hudson/model/queue/QueueTaskFilter.java
+++ b/core/src/main/java/hudson/model/queue/QueueTaskFilter.java
@@ -52,6 +52,7 @@ public Label getAssignedLabel() {
return base.getAssignedLabel();
}
+ @Deprecated
@Override
public Node getLastBuiltOn() {
return base.getLastBuiltOn();
diff --git a/core/src/main/java/hudson/model/queue/SubTask.java b/core/src/main/java/hudson/model/queue/SubTask.java
index f8b7dd435088..0690d074617c 100644
--- a/core/src/main/java/hudson/model/queue/SubTask.java
+++ b/core/src/main/java/hudson/model/queue/SubTask.java
@@ -62,7 +62,9 @@ default Label getAssignedLabel() {
* and this task prefers to run on the same node, return that.
* Otherwise null.
* @return by default, null
+ * @deprecated Unused.
*/
+ @Deprecated
default Node getLastBuiltOn() {
return null;
}
diff --git a/core/src/main/java/hudson/model/userproperty/UserPropertyCategory.java b/core/src/main/java/hudson/model/userproperty/UserPropertyCategory.java
index 803b7e2d3527..5d5467b6eed4 100644
--- a/core/src/main/java/hudson/model/userproperty/UserPropertyCategory.java
+++ b/core/src/main/java/hudson/model/userproperty/UserPropertyCategory.java
@@ -43,7 +43,7 @@
* as the catch-all "unclassified".) Categories themselves are extensible — plugins may introduce
* its own category as well, although that should only happen if you are creating a big enough subsystem.
*
- * @since TODO
+ * @since 2.468
* @see UserProperty
*/
public abstract class UserPropertyCategory implements ExtensionPoint, ModelObject {
diff --git a/core/src/main/java/hudson/util/BootFailure.java b/core/src/main/java/hudson/util/BootFailure.java
index a460ffea148e..f23cf7fa66b7 100644
--- a/core/src/main/java/hudson/util/BootFailure.java
+++ b/core/src/main/java/hudson/util/BootFailure.java
@@ -15,6 +15,7 @@
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletContext;
+import jenkins.model.Jenkins;
import jenkins.util.groovy.GroovyHookScript;
import org.kohsuke.stapler.WebApp;
@@ -51,6 +52,7 @@ public void publish(ServletContext context, @CheckForNull File home) {
.bind("servletContext", context)
.bind("attempts", loadAttempts(home))
.run();
+ Jenkins.get().getLifecycle().onBootFailure(this);
}
/**
diff --git a/core/src/main/java/jenkins/agents/WebSocketAgents.java b/core/src/main/java/jenkins/agents/WebSocketAgents.java
index 005587c6365a..d9560f156ebd 100644
--- a/core/src/main/java/jenkins/agents/WebSocketAgents.java
+++ b/core/src/main/java/jenkins/agents/WebSocketAgents.java
@@ -36,6 +36,7 @@
import hudson.remoting.ChannelBuilder;
import hudson.remoting.ChunkHeader;
import hudson.remoting.Engine;
+import hudson.slaves.SlaveComputer;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.ClosedChannelException;
@@ -107,7 +108,9 @@ public HttpResponse doIndex(StaplerRequest req, StaplerResponse rsp) throws IOEx
Capability remoteCapability = Capability.fromASCII(remoteCapabilityStr);
LOGGER.fine(() -> "received " + remoteCapability);
rsp.setHeader(Capability.KEY, new Capability().toASCII());
- rsp.setHeader(Engine.REMOTING_MINIMUM_VERSION_HEADER, RemotingVersionInfo.getMinimumSupportedVersion().toString());
+ if (!SlaveComputer.ALLOW_UNSUPPORTED_REMOTING_VERSIONS) {
+ rsp.setHeader(Engine.REMOTING_MINIMUM_VERSION_HEADER, RemotingVersionInfo.getMinimumSupportedVersion().toString());
+ }
rsp.setHeader(Engine.WEBSOCKET_COOKIE_HEADER, cookie);
return WebSockets.upgrade(new Session(state, agent, remoteCapability));
}
diff --git a/core/src/main/java/jenkins/model/GlobalComputerRetentionCheckIntervalConfiguration.java b/core/src/main/java/jenkins/model/GlobalComputerRetentionCheckIntervalConfiguration.java
index c73b862ef1e5..46d760fe8ee2 100644
--- a/core/src/main/java/jenkins/model/GlobalComputerRetentionCheckIntervalConfiguration.java
+++ b/core/src/main/java/jenkins/model/GlobalComputerRetentionCheckIntervalConfiguration.java
@@ -23,7 +23,7 @@ public class GlobalComputerRetentionCheckIntervalConfiguration extends GlobalCon
/**
* Gets the check interval for computer retention.
*
- * @since TODO
+ * @since 2.463
*/
public int getComputerRetentionCheckInterval() {
if (computerRetentionCheckInterval <= 0) {
@@ -42,7 +42,7 @@ public int getComputerRetentionCheckInterval() {
*
* @param interval new check interval in seconds
* @throws IllegalArgumentException interval must be greater than zero
- * @since TODO
+ * @since 2.463
*/
private void setComputerRetentionCheckInterval(int interval) throws IllegalArgumentException {
if (interval <= 0) {
diff --git a/core/src/main/java/jenkins/model/ParameterizedJobMixIn.java b/core/src/main/java/jenkins/model/ParameterizedJobMixIn.java
index 734534220901..662ffa9359e2 100644
--- a/core/src/main/java/jenkins/model/ParameterizedJobMixIn.java
+++ b/core/src/main/java/jenkins/model/ParameterizedJobMixIn.java
@@ -218,6 +218,7 @@ public final void doBuild(StaplerRequest req, StaplerResponse rsp, @QueryParamet
Queue.Item item = Jenkins.get().getQueue().schedule2(asJob(), delay.getTimeInSeconds(), getBuildCause(asJob(), req)).getItem();
if (item != null) {
+ // TODO JENKINS-66105 use SC_SEE_OTHER if !ScheduleResult.created
rsp.sendRedirect(SC_CREATED, req.getContextPath() + '/' + item.getUrl());
} else {
rsp.sendRedirect(".");
diff --git a/core/src/main/java/jenkins/model/experimentalflags/RemoveYuiUserExperimentalFlag.java b/core/src/main/java/jenkins/model/experimentalflags/RemoveYuiUserExperimentalFlag.java
new file mode 100644
index 000000000000..e8f8dcc31775
--- /dev/null
+++ b/core/src/main/java/jenkins/model/experimentalflags/RemoveYuiUserExperimentalFlag.java
@@ -0,0 +1,49 @@
+/*
+ * The MIT License
+ *
+ * Copyright (c) 2024, Markus Winter
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+package jenkins.model.experimentalflags;
+
+import edu.umd.cs.findbugs.annotations.Nullable;
+import hudson.Extension;
+import org.kohsuke.accmod.Restricted;
+import org.kohsuke.accmod.restrictions.NoExternalUse;
+
+@Extension
+@Restricted(NoExternalUse.class)
+public class RemoveYuiUserExperimentalFlag extends BooleanUserExperimentalFlag {
+ public RemoveYuiUserExperimentalFlag() {
+ super("remove-yui.flag");
+ }
+
+ @Override
+ public String getDisplayName() {
+ return "Remove YUI";
+ }
+
+ @Nullable
+ @Override
+ public String getShortDescription() {
+ return "Remove YUI from all Jenkins UI pages. This will break anything that depends on YUI";
+ }
+}
diff --git a/core/src/main/java/jenkins/model/queue/ItemDeletion.java b/core/src/main/java/jenkins/model/queue/ItemDeletion.java
index e5c9fc2ca87e..fd18edde04a5 100644
--- a/core/src/main/java/jenkins/model/queue/ItemDeletion.java
+++ b/core/src/main/java/jenkins/model/queue/ItemDeletion.java
@@ -28,25 +28,42 @@
import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.ExtensionList;
+import hudson.model.AbstractItem;
import hudson.model.Action;
+import hudson.model.Computer;
+import hudson.model.Executor;
+import hudson.model.Failure;
import hudson.model.Item;
+import hudson.model.Messages;
import hudson.model.Queue;
+import hudson.model.Result;
+import hudson.model.queue.Executables;
+import hudson.model.queue.SubTask;
import hudson.model.queue.Tasks;
+import hudson.model.queue.WorkUnit;
import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
import java.util.List;
+import java.util.Map;
import java.util.Set;
+import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
+import java.util.logging.Logger;
+import jenkins.model.Jenkins;
import net.jcip.annotations.GuardedBy;
/**
* A {@link Queue.QueueDecisionHandler} that blocks items being deleted from entering the queue.
- *
+ * @see AbstractItem#delete()
* @since 2.55
*/
@Extension
public class ItemDeletion extends Queue.QueueDecisionHandler {
+ private static final Logger LOGGER = Logger.getLogger(ItemDeletion.class.getName());
+
/**
* Lock to guard the {@link #registrations} set.
*/
@@ -176,4 +193,94 @@ public boolean shouldSchedule(Queue.Task p, List actions) {
}
return true;
}
+
+ /**
+ * Cancels any builds in progress of this item (if a job) or descendants (if a folder).
+ * Also cancels any associated queue items.
+ * @param initiatingItem an item being deleted
+ * @since TODO
+ */
+ public static void cancelBuildsInProgress(@NonNull Item initiatingItem) throws Failure, InterruptedException {
+ Queue queue = Queue.getInstance();
+ if (initiatingItem instanceof Queue.Task) {
+ // clear any items in the queue so they do not get picked up
+ queue.cancel((Queue.Task) initiatingItem);
+ }
+ // now cancel any child items - this happens after ItemDeletion registration, so we can use a snapshot
+ for (Queue.Item i : queue.getItems()) {
+ Item item = Tasks.getItemOf(i.task);
+ while (item != null) {
+ if (item == initiatingItem) {
+ if (!queue.cancel(i)) {
+ LOGGER.warning(() -> "failed to cancel " + i);
+ }
+ break;
+ }
+ if (item.getParent() instanceof Item) {
+ item = (Item) item.getParent();
+ } else {
+ break;
+ }
+ }
+ }
+ // interrupt any builds in progress (and this should be a recursive test so that folders do not pay
+ // the 15 second delay for every child item). This happens after queue cancellation, so will be
+ // a complete set of builds in flight
+ Map buildsInProgress = new LinkedHashMap<>();
+ for (Computer c : Jenkins.get().getComputers()) {
+ for (Executor e : c.getAllExecutors()) {
+ final WorkUnit workUnit = e.getCurrentWorkUnit();
+ final Queue.Executable executable = workUnit != null ? workUnit.getExecutable() : null;
+ final SubTask subtask = executable != null ? Executables.getParentOf(executable) : null;
+ if (subtask != null) {
+ Item item = Tasks.getItemOf(subtask);
+ while (item != null) {
+ if (item == initiatingItem) {
+ buildsInProgress.put(e, e.getCurrentExecutable());
+ e.interrupt(Result.ABORTED);
+ break;
+ }
+ if (item.getParent() instanceof Item) {
+ item = (Item) item.getParent();
+ } else {
+ break;
+ }
+ }
+ }
+ }
+ }
+ if (!buildsInProgress.isEmpty()) {
+ // give them 15 seconds or so to respond to the interrupt
+ long expiration = System.nanoTime() + TimeUnit.SECONDS.toNanos(15);
+ // comparison with executor.getCurrentExecutable() == computation currently should always be true
+ // as we no longer recycle Executors, but safer to future-proof in case we ever revisit recycling
+ while (!buildsInProgress.isEmpty() && expiration - System.nanoTime() > 0L) {
+ // we know that ItemDeletion will prevent any new builds in the queue
+ // ItemDeletion happens-before Queue.cancel so we know that the Queue will stay clear
+ // Queue.cancel happens-before collecting the buildsInProgress list
+ // thus buildsInProgress contains the complete set we need to interrupt and wait for
+ for (Iterator> iterator =
+ buildsInProgress.entrySet().iterator();
+ iterator.hasNext(); ) {
+ Map.Entry entry = iterator.next();
+ // comparison with executor.getCurrentExecutable() == executable currently should always be
+ // true as we no longer recycle Executors, but safer to future-proof in case we ever
+ // revisit recycling.
+ if (!entry.getKey().isAlive()
+ || entry.getValue() != entry.getKey().getCurrentExecutable()) {
+ iterator.remove();
+ }
+ // I don't know why, but we have to keep interrupting
+ entry.getKey().interrupt(Result.ABORTED);
+ }
+ Thread.sleep(50L);
+ }
+ if (!buildsInProgress.isEmpty()) {
+ throw new Failure(Messages.AbstractItem_FailureToStopBuilds(
+ buildsInProgress.size(), initiatingItem.getFullDisplayName()
+ ));
+ }
+ }
+ }
+
}
diff --git a/core/src/main/java/jenkins/widgets/BuildTimeTrend.java b/core/src/main/java/jenkins/widgets/BuildTimeTrend.java
index 59ab879f05da..dd0f0434ecb3 100644
--- a/core/src/main/java/jenkins/widgets/BuildTimeTrend.java
+++ b/core/src/main/java/jenkins/widgets/BuildTimeTrend.java
@@ -25,7 +25,9 @@
package jenkins.widgets;
import hudson.model.AbstractBuild;
+import hudson.model.AbstractProject;
import hudson.model.BallColor;
+import hudson.model.Job;
import hudson.model.Node;
import hudson.model.Run;
import jenkins.console.ConsoleUrlProvider;
@@ -37,6 +39,10 @@
@Restricted(DoNotUse.class) // only for buildTimeTrend.jelly
public class BuildTimeTrend extends RunListProgressiveRendering {
+ public boolean isAbstractProject(Job, ?> job) {
+ return job instanceof AbstractProject;
+ }
+
@Override protected void calculate(Run, ?> build, JSONObject element) {
BallColor iconColor = build.getIconColor();
element.put("iconName", iconColor.getIconName());
@@ -46,6 +52,8 @@ public class BuildTimeTrend extends RunListProgressiveRendering {
element.put("displayName", build.getDisplayName());
element.put("duration", build.getDuration());
element.put("durationString", build.getDurationString());
+ element.put("timestampString", build.getTimestampString());
+ element.put("timestampString2", build.getTimestampString2());
element.put("consoleUrl", ConsoleUrlProvider.getRedirectUrl(build));
if (build instanceof AbstractBuild) {
AbstractBuild, ?> b = (AbstractBuild) build;
diff --git a/core/src/main/resources/hudson/TcpSlaveAgentListener/index.jelly b/core/src/main/resources/hudson/TcpSlaveAgentListener/index.jelly
index 1b04d3c2c9ae..9e4b36af14a2 100644
--- a/core/src/main/resources/hudson/TcpSlaveAgentListener/index.jelly
+++ b/core/src/main/resources/hudson/TcpSlaveAgentListener/index.jelly
@@ -40,8 +40,11 @@ THE SOFTWARE.
-
-
+
+
+
+
+
Jenkins
diff --git a/core/src/main/resources/hudson/model/Job/buildTimeTrend.jelly b/core/src/main/resources/hudson/model/Job/buildTimeTrend.jelly
index 18f874a6751f..7efb53f362a4 100644
--- a/core/src/main/resources/hudson/model/Job/buildTimeTrend.jelly
+++ b/core/src/main/resources/hudson/model/Job/buildTimeTrend.jelly
@@ -25,7 +25,7 @@ THE SOFTWARE.
-
+
@@ -45,29 +45,36 @@ THE SOFTWARE.
+