Skip to content

Commit

Permalink
Merge branch 'master' into JENKINS-30175
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkEWaite committed Jul 28, 2024
2 parents 665b62b + cbfe2d4 commit 62ae29b
Show file tree
Hide file tree
Showing 339 changed files with 5,664 additions and 3,401 deletions.
12 changes: 9 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,29 @@ For refactoring and code cleanup changes, exercise the code before and after the

### Proposed changelog entries

- JENKINS-XXXXX, human-readable text
- human-readable text

<!-- Comment:
The changelog entry should be in the imperative mood; e.g., write "do this"/"return that" rather than "does this"/"returns that".
For examples, see: https://www.jenkins.io/changelog/
Remove JENKINS-XXXXX if there is no issue for the pull request.
Do not include the Jira issue in the changelog entry.
Include the Jira issue in the description of the pull request so that the changelog generator can find it and include it in the generated changelog.
You may add multiple changelog entries if applicable by adding a new entry to the list, e.g.
- JENKINS-123456, First changelog entry
- First changelog entry
- Second changelog entry
-->

### Proposed upgrade guidelines

N/A

<!-- Comment:
Leave the proposed upgrade guidelines in the pull request with the "N/A" value if no upgrade guidelines are needed.
The changelog generator relies on the presence of the upgrade guidelines section as part of its data extraction process.
-->

```[tasklist]
### Submitter checklist
- [ ] The Jira issue, if it exists, is well-described.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/label-conflicting-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Label conflicting PRs
uses: eps1lon/actions-label-merge-conflict@v3.0.1
uses: eps1lon/actions-label-merge-conflict@v3.0.2
with:
dirtyLabel: "unresolved-merge-conflict"
repoToken: "${{ secrets.GITHUB_TOKEN }}"
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/publish-release-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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@69320dbe05506a9a39fc8ae11030b214ec2d1f87
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
- name: Upload Release Asset
id: upload-deb
if: always()
uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down Expand Up @@ -144,7 +144,7 @@ jobs:
- name: Upload Release Asset
id: upload-rpm
if: always()
uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down Expand Up @@ -180,7 +180,7 @@ jobs:
- name: Upload Release Asset
id: upload-msi
if: always()
uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down Expand Up @@ -216,7 +216,7 @@ jobs:
- name: Upload Release Asset
id: upload-suse-rpm
if: always()
uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
2 changes: 1 addition & 1 deletion .gitpod/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM gitpod/workspace-full

ARG MAVEN_VERSION=3.9.7
ARG MAVEN_VERSION=3.9.8

RUN brew install gh && \
bash -c ". /home/gitpod/.sdkman/bin/sdkman-init.sh && sdk install maven ${MAVEN_VERSION} && sdk default maven ${MAVEN_VERSION}"
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This page provides information about contributing code to the Jenkins core codeb
1. Fork the repository on GitHub
2. Clone the forked repository to your machine
3. Install the necessary development tools. In order to develop Jenkins, you need the following:
- Java Development Kit (JDK) 11, 17 or 21.
- Java Development Kit (JDK) 17 or 21.
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.
- Apache Maven 3.8.1 or above. You can [download Maven here](https://maven.apache.org/download.cgi).
In the Jenkins project we usually use the most recent Maven release.
Expand Down
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ properties([

def axes = [
platforms: ['linux', 'windows'],
jdks: [11, 17, 21],
jdks: [17, 21],
]

stage('Record build') {
retry(conditions: [kubernetesAgent(handleNonKubernetes: true), nonresumable()], count: 2) {
node('maven-11') {
node('maven-17') {
infra.checkoutSCM()

/*
Expand Down
2 changes: 1 addition & 1 deletion ath.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -o xtrace
cd "$(dirname "$0")"

# https://github.com/jenkinsci/acceptance-test-harness/releases
export ATH_VERSION=5858.v4b_c4e3b_16099
export ATH_VERSION=5909.vc4fa_3e55b_f84

if [[ $# -eq 0 ]]; then
export JDK=17
Expand Down
12 changes: 6 additions & 6 deletions bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ THE SOFTWARE.
<properties>
<commons-fileupload2.version>2.0.0-M2</commons-fileupload2.version>
<slf4jVersion>2.0.13</slf4jVersion>
<stapler.version>1870.v48cc46ef5fee</stapler.version>
<stapler.version>1892.v73465f3d074d</stapler.version>
<groovy.version>2.4.21</groovy.version>
</properties>

Expand All @@ -56,15 +56,15 @@ THE SOFTWARE.
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>5.3.36</version>
<version>5.3.37</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<!-- https://docs.spring.io/spring-security/site/docs/5.5.4/reference/html5/#getting-maven-no-boot -->
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-bom</artifactId>
<version>5.8.12</version>
<version>5.8.13</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -82,7 +82,7 @@ THE SOFTWARE.
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>33.2.0-jre</version>
<version>33.2.1-jre</version>
</dependency>
<dependency>
<!-- Overriding Stapler’s 1.1.3 version to diagnose JENKINS-20618: -->
Expand Down Expand Up @@ -113,7 +113,7 @@ THE SOFTWARE.
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.17.0</version>
<version>1.17.1</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
Expand Down Expand Up @@ -376,7 +376,7 @@ THE SOFTWARE.
<!-- provided by jcl-over-slf4j -->
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.3.2</version>
<version>1.3.3</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.3</version>
<version>3.6.0</version>
<executions>
<execution>
<goals>
Expand Down
56 changes: 56 additions & 0 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,62 @@ THE SOFTWARE.

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<!-- Version specified in parent POM -->
<executions>
<execution>
<id>enforce-banned-dependencies</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<bannedDependencies>
<excludes combine.children="append">
<!-- Library plugins -->
<exclude>com.fasterxml.jackson.*</exclude>
<exclude>com.github.ben-manes.caffeine:caffeine</exclude>
<exclude>com.github.jnr:jnr-posix</exclude>
<exclude>com.github.mwiede:jsch</exclude>
<exclude>com.google.code.gson:gson</exclude>
<exclude>com.jayway.jsonpath:json-path</exclude>
<exclude>commons-httpclient:commons-httpclient</exclude>
<exclude>com.sun.activation:javax.activation</exclude>
<exclude>com.sun.mail:javax.mail</exclude>
<exclude>com.sun.xml.bind:jaxb-impl</exclude>
<exclude>io.jsonwebtoken</exclude>
<!-- Used in unit tests, so exclude from compile and runtime scope only -->
<exclude>jakarta.activation:jakarta.activation-api:*:jar:compile</exclude>
<exclude>jakarta.activation:jakarta.activation-api:*:jar:runtime</exclude>
<exclude>jakarta.mail:jakarta.mail-api</exclude>
<exclude>javax.activation:javax.activation-api</exclude>
<exclude>javax.mail:javax.mail-api</exclude>
<exclude>javax.xml.bind:jaxb-api</exclude>
<exclude>joda-time:joda-time</exclude>
<!-- Used in unit tests, so exclude from compile and runtime scope only -->
<exclude>net.bytebuddy:byte-buddy:*:jar:compile</exclude>
<exclude>net.bytebuddy:byte-buddy:*:jar:runtime</exclude>
<exclude>net.i2p.crypto:eddsa</exclude>
<exclude>net.minidev</exclude>
<exclude>org.apache.commons:commons-lang3</exclude>
<exclude>org.apache.commons:commons-text</exclude>
<exclude>org.apache.httpcomponents</exclude>
<exclude>org.bouncycastle</exclude>
<exclude>org.eclipse.angus:angus-activation</exclude>
<exclude>org.eclipse.angus:angus-mail</exclude>
<exclude>org.glassfish.jersey.*</exclude>
<exclude>org.json:json</exclude>
<exclude>org.ow2.asm</exclude>
<exclude>org.yaml:snakeyaml</exclude>
</excludes>
</bannedDependencies>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
Expand Down
12 changes: 6 additions & 6 deletions core/src/main/java/hudson/ClassicPluginStrategy.java
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ private void fix(Attributes atts, List<PluginWrapper.Dependency> 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);
}
}
Expand All @@ -269,25 +269,25 @@ public static List<PluginWrapper.Dependency> getImpliedDependencies(String plugi
}

/**
* @deprecated since TODO use {@link #createClassLoader(String, List, ClassLoader, Attributes)}
* @deprecated since 2.459 use {@link #createClassLoader(String, List, ClassLoader, Attributes)}
*/
@Deprecated(since = "TODO")
@Deprecated(since = "2.459")
protected ClassLoader createClassLoader(List<File> paths, ClassLoader parent) throws IOException {
return createClassLoader(paths, parent, null);
}

/**
* @deprecated since TODO use {@link #createClassLoader(String, List, ClassLoader, Attributes)}
* @deprecated since 2.459 use {@link #createClassLoader(String, List, ClassLoader, Attributes)}
*/
@Deprecated(since="TODO")
@Deprecated(since="2.459")
protected ClassLoader createClassLoader(List<File> paths, ClassLoader parent, Attributes atts) throws IOException {
// generate a legacy id so at least we can track to something
return createClassLoader("unidentified-" + UUID.randomUUID(), paths, parent, atts);
}

/**
* Creates a classloader that can load all the specified jar files and delegate to the given parent.
* @since TODO
* @since 2.459
*/
protected ClassLoader createClassLoader(String name, List<File> paths, ClassLoader parent, Attributes atts) throws IOException {
boolean usePluginFirstClassLoader =
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/DependencyRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void run() {
// Get all top-level projects
LOGGER.fine("assembling top level projects");
for (AbstractProject p : Jenkins.get().allItems(AbstractProject.class))
if (p.getUpstreamProjects().size() == 0) {
if (p.getUpstreamProjects().isEmpty()) {
LOGGER.fine("adding top level project " + p.getName());
topLevelProjects.add(p);
} else {
Expand Down
3 changes: 1 addition & 2 deletions core/src/main/java/hudson/EnvVars.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ public EnvVars(@NonNull Map<String, String> m) {

// because of the backward compatibility, some parts of Jenkins passes
// EnvVars as Map<String,String> so downcasting is safer.
if (m instanceof EnvVars) {
EnvVars lhs = (EnvVars) m;
if (m instanceof EnvVars lhs) {
this.platform = lhs.platform;
}
}
Expand Down
13 changes: 6 additions & 7 deletions core/src/main/java/hudson/FilePath.java
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ public static String normalize(@NonNull String path) {
buf.append(m.group(1));
path = path.substring(m.end());
}
boolean isAbsolute = buf.length() > 0;
boolean isAbsolute = !buf.isEmpty();
// Split remaining path into tokens, trimming any duplicate or trailing separators
List<String> tokens = new ArrayList<>();
int s = 0, end = path.length();
Expand Down Expand Up @@ -366,7 +366,7 @@ public static String normalize(@NonNull String path) {
}
// Recombine tokens
for (String token : tokens) buf.append(token);
if (buf.length() == 0) buf.append('.');
if (buf.isEmpty()) buf.append('.');
return buf.toString();
}

Expand Down Expand Up @@ -997,8 +997,7 @@ private boolean installIfNecessaryFrom(@NonNull URL archive, @NonNull TaskListen
}
}

if (con instanceof HttpURLConnection) {
HttpURLConnection httpCon = (HttpURLConnection) con;
if (con instanceof HttpURLConnection httpCon) {
int responseCode = httpCon.getResponseCode();
if (responseCode == HttpURLConnection.HTTP_MOVED_PERM
|| responseCode == HttpURLConnection.HTTP_MOVED_TEMP) {
Expand Down Expand Up @@ -1445,7 +1444,7 @@ private static class DeleteSuffixesRecursive extends MasterToSlaveFileCallable<V
public Void invoke(File f, VirtualChannel channel) throws IOException {
for (File file : listParentFiles(f)) {
if (file.getName().startsWith(f.getName() + WorkspaceList.COMBINATOR)) {
Util.deleteRecursive(file.toPath(), path -> path.toFile());
Util.deleteRecursive(file.toPath(), Path::toFile);
}
}

Expand Down Expand Up @@ -1476,7 +1475,7 @@ private static class DeleteRecursive extends MasterToSlaveFileCallable<Void> {

@Override
public Void invoke(File f, VirtualChannel channel) throws IOException {
Util.deleteRecursive(fileToPath(f), path -> path.toFile());
Util.deleteRecursive(fileToPath(f), Path::toFile);
return null;
}
}
Expand All @@ -1493,7 +1492,7 @@ private static class DeleteContents extends MasterToSlaveFileCallable<Void> {

@Override
public Void invoke(File f, VirtualChannel channel) throws IOException {
Util.deleteContentsRecursive(fileToPath(f), path -> path.toFile());
Util.deleteContentsRecursive(fileToPath(f), Path::toFile);
return null;
}
}
Expand Down
Loading

0 comments on commit 62ae29b

Please sign in to comment.