Skip to content

Commit e765eb1

Browse files
committed
Merge branch 'master' into JENKINS-73813
2 parents 75c34be + 9e3a75a commit e765eb1

File tree

225 files changed

+2945
-1673
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

225 files changed

+2945
-1673
lines changed

.gitattributes

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@
3939

4040
# Yarn
4141
# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
42-
/war/.yarn/plugins/** binary
42+
/.yarn/plugins/** binary

.gitignore

+1-6
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ junit.xml
6565

6666
# Yarn
6767
# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
68-
.pnp.*
6968
.yarn/*
70-
.yarnrc.yml
7169
!.yarn/patches
7270
!.yarn/plugins
7371
!.yarn/sdks
@@ -78,7 +76,4 @@ node/
7876
node_modules/
7977

8078
# Generated JavaScript Bundles
81-
jsbundles
82-
83-
# In case someone accidentally runs npm install instead of yarn install
84-
package-lock.json
79+
war/src/main/webapp/jsbundles/

.prettierignore

+2-4
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@ node/
77

88
.git
99

10-
.yarnrc.yml
11-
1210
# libraries / external deps / generated files
13-
war/src/main/js/plugin-setup-wizard/bootstrap-detached.js
11+
src/main/js/plugin-setup-wizard/bootstrap-detached.js
1412
war/src/main/webapp/scripts/yui
1513
war/src/main/webapp/jsbundles/
16-
war/src/main/scss/_bootstrap.scss
14+
src/main/scss/_bootstrap.scss
1715

1816
# test files that we don't need formatted
1917
test/src/test/resources

.stylelintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
22
extends: "stylelint-config-standard",
33
customSyntax: "postcss-scss",
4-
ignoreFiles: ["war/src/main/scss/_bootstrap.scss"],
4+
ignoreFiles: ["src/main/scss/_bootstrap.scss"],
55
rules: {
66
"no-descending-specificity": null,
77
"selector-class-pattern": "[a-z]",

.yarnrc.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
enableGlobalCache: false
2+
nodeLinker: node-modules

CONTRIBUTING.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This page provides information about contributing code to the Jenkins core codeb
1111
3. Install the necessary development tools. In order to develop Jenkins, you need the following:
1212
- Java Development Kit (JDK) 17 or 21.
1313
In the Jenkins project we usually use [Eclipse Temurin](https://adoptium.net/) or [OpenJDK](https://openjdk.java.net/), but you can use other JDKs as well.
14-
- Apache Maven 3.8.1 or above. You can [download Maven here](https://maven.apache.org/download.cgi).
14+
- Apache Maven 3.9.6 or above. You can [download Maven here](https://maven.apache.org/download.cgi).
1515
In the Jenkins project we usually use the most recent Maven release.
1616
- Any IDE which supports importing Maven projects.
1717
4. Set up your development environment as described in [Preparing for Plugin Development](https://www.jenkins.io/doc/developer/tutorial/prepare/)
@@ -53,12 +53,12 @@ MAVEN_OPTS='--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/ja
5353
### Running the Yarn frontend build
5454

5555
> [!TIP]
56-
> If you already have Node.js installed, you do not need to change your path. Start using `yarn` by enabling [Corepack](https://yarnpkg.com/corepack) with `corepack enable`, if it isn't already; this will add the `yarn` binary to your PATH.
56+
> If you already have Node.js installed, you do not need to change your path. Start using Yarn by enabling [Corepack](https://yarnpkg.com/corepack) with `corepack enable`, if it isn't already; this will add the `yarn` binary to your path.
5757
5858
To run the Yarn frontend build, after [building the WAR file](#building-the-war-file), add the downloaded versions of Node and Yarn to your path:
5959

6060
```sh
61-
export PATH=$PWD/node:$PWD/node/yarn/dist/bin:$PATH
61+
export PATH=$PWD/node:$PWD/node/node_modules/corepack/shims:$PATH
6262
```
6363

6464
Then you can run Yarn with e.g.

ath.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -o xtrace
66
cd "$(dirname "$0")"
77

88
# https://github.com/jenkinsci/acceptance-test-harness/releases
9-
export ATH_VERSION=5997.v2a_1a_696620a_0
9+
export ATH_VERSION=6038.v190f938efc87
1010

1111
if [[ $# -eq 0 ]]; then
1212
export JDK=17

bom/pom.xml

+13-7
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ THE SOFTWARE.
8888
<dependency>
8989
<groupId>com.google.guava</groupId>
9090
<artifactId>guava</artifactId>
91-
<version>33.3.0-jre</version>
91+
<version>33.3.1-jre</version>
9292
</dependency>
9393
<dependency>
9494
<!-- Overriding Stapler’s 1.1.3 version to diagnose JENKINS-20618: -->
@@ -250,7 +250,7 @@ THE SOFTWARE.
250250
<dependency>
251251
<groupId>org.jenkins-ci</groupId>
252252
<artifactId>annotation-indexer</artifactId>
253-
<version>1.17</version>
253+
<version>1.18</version>
254254
</dependency>
255255
<dependency>
256256
<groupId>org.jenkins-ci</groupId>
@@ -260,27 +260,27 @@ THE SOFTWARE.
260260
<dependency>
261261
<groupId>org.jenkins-ci</groupId>
262262
<artifactId>crypto-util</artifactId>
263-
<version>1.9</version>
263+
<version>1.10</version>
264264
</dependency>
265265
<dependency>
266266
<groupId>org.jenkins-ci</groupId>
267267
<artifactId>memory-monitor</artifactId>
268-
<version>1.12</version>
268+
<version>1.13</version>
269269
</dependency>
270270
<dependency>
271271
<groupId>org.jenkins-ci</groupId>
272272
<artifactId>symbol-annotation</artifactId>
273-
<version>1.24</version>
273+
<version>1.25</version>
274274
</dependency>
275275
<dependency>
276276
<groupId>org.jenkins-ci</groupId>
277277
<artifactId>task-reactor</artifactId>
278-
<version>1.8</version>
278+
<version>1.9</version>
279279
</dependency>
280280
<dependency>
281281
<groupId>org.jenkins-ci</groupId>
282282
<artifactId>version-number</artifactId>
283-
<version>1.11</version>
283+
<version>1.12</version>
284284
</dependency>
285285
<dependency>
286286
<groupId>org.jenkins-ci.main</groupId>
@@ -352,6 +352,12 @@ THE SOFTWARE.
352352
<artifactId>stapler-groovy</artifactId>
353353
<version>${stapler.version}</version>
354354
</dependency>
355+
<!-- Override the outdated managed dependency on asm in guice-parent -->
356+
<dependency>
357+
<groupId>org.ow2.asm</groupId>
358+
<artifactId>asm</artifactId>
359+
<version>9.7.1</version>
360+
</dependency>
355361
<dependency>
356362
<groupId>org.samba.jcifs</groupId>
357363
<artifactId>jcifs</artifactId>

cli/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<url>https://github.com/jenkinsci/jenkins</url>
1616

1717
<properties>
18-
<mina-sshd.version>2.13.2</mina-sshd.version>
18+
<mina-sshd.version>2.14.0</mina-sshd.version>
1919
<!-- Filled in by jacoco-maven-plugin -->
2020
<jacocoSurefireArgs />
2121
</properties>

core/src/main/java/hudson/logging/LogRecorder.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ public void delete() throws IOException {
556556
loggers.forEach(Target::disable);
557557

558558
getParent().getRecorders().forEach(logRecorder -> logRecorder.getLoggers().forEach(Target::enable));
559-
SaveableListener.fireOnChange(this, getConfigFile());
559+
SaveableListener.fireOnDeleted(this, getConfigFile());
560560
}
561561

562562
/**

core/src/main/java/hudson/markup/MarkupFormatter.java

+8-3
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,14 @@
6262
* This is an extension point in Hudson, allowing plugins to implement different markup formatters.
6363
*
6464
* <p>
65-
* Implement the following methods to enable and control CodeMirror syntax highlighting
66-
* public String getCodeMirrorMode() // return null to disable CodeMirror dynamically
67-
* public String getCodeMirrorConfig()
65+
* Implement the following methods to enable and control CodeMirror syntax highlighting:
66+
* <ul>
67+
* <li><code>public String getCodeMirrorMode()</code> (return <code>null</code> to disable CodeMirror dynamically)</li>
68+
* <li>
69+
* <code>public String getCodeMirrorConfig()</code> (JSON snippet without surrounding curly braces, e.g., <code>"mode": "text/css"</code>.
70+
* Historically this allowed invalid JSON, but since TODO it needs to be properly quoted etc.
71+
* </li>
72+
* </ul>
6873
*
6974
* <h2>Views</h2>
7075
* <p>

core/src/main/java/hudson/model/AbstractItem.java

+10-12
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@
5959
import java.util.ListIterator;
6060
import java.util.logging.Level;
6161
import java.util.logging.Logger;
62-
import java.util.regex.Matcher;
63-
import java.util.regex.Pattern;
6462
import javax.xml.transform.Source;
6563
import javax.xml.transform.TransformerException;
6664
import javax.xml.transform.sax.SAXSource;
@@ -70,6 +68,7 @@
7068
import jenkins.model.Jenkins;
7169
import jenkins.model.Loadable;
7270
import jenkins.model.queue.ItemDeletion;
71+
import jenkins.security.ExtendedReadRedaction;
7372
import jenkins.security.NotReallyRoleSensitiveCallable;
7473
import jenkins.security.stapler.StaplerNotDispatchable;
7574
import jenkins.util.SystemProperties;
@@ -815,6 +814,7 @@ public void delete() throws IOException, InterruptedException {
815814
ItemDeletion.deregister(this);
816815
}
817816
}
817+
SaveableListener.fireOnDeleted(this, getConfigFile());
818818
getParent().onDeleted(AbstractItem.this);
819819
Jenkins.get().rebuildDependencyGraphAsync();
820820
}
@@ -870,11 +870,11 @@ private void doConfigDotXmlImpl(StaplerRequest2 req, StaplerResponse2 rsp)
870870
rsp.sendError(SC_BAD_REQUEST);
871871
}
872872

873-
static final Pattern SECRET_PATTERN = Pattern.compile(">(" + Secret.ENCRYPTED_VALUE_PATTERN + ")<");
874873
/**
875874
* Writes {@code config.xml} to the specified output stream.
876875
* The user must have at least {@link #EXTENDED_READ}.
877-
* If he lacks {@link #CONFIGURE}, then any {@link Secret}s detected will be masked out.
876+
* If he lacks {@link #CONFIGURE}, then any {@link Secret}s or other sensitive information detected will be masked out.
877+
* @see jenkins.security.ExtendedReadRedaction
878878
*/
879879

880880
@Restricted(NoExternalUse.class)
@@ -886,15 +886,13 @@ public void writeConfigDotXml(OutputStream os) throws IOException {
886886
} else {
887887
String encoding = configFile.sniffEncoding();
888888
String xml = Files.readString(Util.fileToPath(configFile.getFile()), Charset.forName(encoding));
889-
Matcher matcher = SECRET_PATTERN.matcher(xml);
890-
StringBuilder cleanXml = new StringBuilder();
891-
while (matcher.find()) {
892-
if (Secret.decrypt(matcher.group(1)) != null) {
893-
matcher.appendReplacement(cleanXml, ">********<");
894-
}
889+
890+
for (ExtendedReadRedaction redaction : ExtendedReadRedaction.all()) {
891+
LOGGER.log(Level.FINE, () -> "Applying redaction " + redaction.getClass().getName());
892+
xml = redaction.apply(xml);
895893
}
896-
matcher.appendTail(cleanXml);
897-
org.apache.commons.io.IOUtils.write(cleanXml.toString(), os, encoding);
894+
895+
org.apache.commons.io.IOUtils.write(xml, os, encoding);
898896
}
899897
}
900898

0 commit comments

Comments
 (0)