Skip to content

Commit

Permalink
Merge branch 'master' into new-plugin-manager-1
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Jul 5, 2022
2 parents 87c27c2 + 76e5c98 commit a39862c
Show file tree
Hide file tree
Showing 5,657 changed files with 24,447 additions and 22,505 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
*.json text
*.jelly text
*.jellytag text
*.less text
# JENKINS-68887: postcss-less fails to properly parse .less files with Windows line breaks
*.less text eol=lf
*.properties text
*.rb text
*.sh text
Expand Down
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ N/A
* Fill-in the `Proposed changelog entries` section only if there are breaking changes or other changes which may require extra steps from users during the upgrade
- [ ] Appropriate autotests or explanation to why this change has no tests
- [ ] New public classes, fields, and methods are annotated with `@Restricted` or have `@since TODO` Javadoc, as appropriate.
- [ ] New deprecations are annotated with `@Deprecated(since = "TODO")` or `@Deprecated(forRemoval = true, since = "TODO")` if applicable.
- [ ] For dependency updates: links to external changelogs and, if possible, full diffs

<!-- For new API and extension points: Link to the reference implementation in open-source (or example in Javadoc) -->
Expand Down
16 changes: 11 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ updates:
# 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: "javax.servlet:javax.servlet-api"
- 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.
Expand All @@ -34,10 +34,6 @@ updates:
# Fails test automation; needs further investigation.
- dependency-name: "com.google.inject:guice-bom"

# Requires Java 11 starting with version 10.0.
- dependency-name: "com.puppycrawl.tools:checkstyle"
versions: [">=10.0"]

# Contains incompatible API changes and needs compatibility work.
- dependency-name: "jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api"

Expand All @@ -63,3 +59,13 @@ updates:
# Contains incompatible API changes and needs compatibility work. See:
# https://github.com/jenkinsci/jenkins/pull/4224
- dependency-name: "org.jfree:jfreechart"
- package-ecosystem: "npm"
directory: "/war"
schedule:
interval: "daily"
reviewers:
- jenkinsci/sig-ux
ignore:
# Handlebars files (*.hbs) require a few tweaks in order to comply with 4.x' standards:
# https://issues.jenkins.io/browse/JENKINS-68926
- dependency-name: "handlebars"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ work
/.idea/*
!/.idea/icon.svg
!/.idea/.name
!/.idea/encodings.xml
out

# Eclipse and VSCode project files
Expand Down
33 changes: 33 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 4 additions & 7 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,19 @@ properties([
])

def buildTypes = ['Linux', 'Windows']
def jdks = [8, 11, 17]
def jdks = [11, 17]

def builds = [:]
for (i = 0; i < buildTypes.size(); i++) {
for (j = 0; j < jdks.size(); j++) {
def buildType = buildTypes[i]
def jdk = jdks[j]
if (buildType == 'Windows' && jdk == 8) {
continue // unnecessary use of hardware
}
if (buildType == 'Windows' && jdk == 17) {
continue // TODO pending jenkins-infra/helpdesk#2822
}
builds["${buildType}-jdk${jdk}"] = {
// see https://github.com/jenkins-infra/documentation/blob/master/ci.adoc#node-labels for information on what node types are available
def agentContainerLabel = jdk == 8 ? 'maven' : 'maven-' + jdk
def agentContainerLabel = 'maven-' + jdk
if (buildType == 'Windows') {
agentContainerLabel += '-windows'
}
Expand All @@ -44,7 +41,7 @@ for (i = 0; i < buildTypes.size(); i++) {

// Now run the actual build.
stage("${buildType} Build / Test") {
timeout(time: 5, unit: 'HOURS') {
timeout(time: 6, unit: 'HOURS') {
realtimeJUnit(healthScaleFactor: 20.0, testResults: '*/target/surefire-reports/*.xml,war/junit.xml') {
def mavenOptions = [
'-Pdebug',
Expand Down Expand Up @@ -81,7 +78,7 @@ for (i = 0; i < buildTypes.size(); i++) {
if (!fileExists('test/target/surefire-reports/TEST-jenkins.Junit4TestsRanTest.xml')) {
error 'JUnit 4 tests are no longer being run for the test package'
}
// cli has been migrated to JUnit 5
// cli and war have been migrated to JUnit 5
if (failFast && currentBuild.result == 'UNSTABLE') {
error 'There were test failures; halting early'
}
Expand Down
13 changes: 4 additions & 9 deletions bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ THE SOFTWARE.
<properties>
<asm.version>9.3</asm.version>
<slf4jVersion>1.7.36</slf4jVersion>
<stapler.version>1685.v3b_5035c4ce05</stapler.version>
<stapler.version>1711.v5b_1b_03f0fcf2</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.20</version>
<version>5.3.21</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.7.1</version>
<version>5.7.2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -173,7 +173,7 @@ THE SOFTWARE.
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>5.11.0</version>
<version>5.12.1</version>
</dependency>
<dependency>
<groupId>net.java.sezpoz</groupId>
Expand Down Expand Up @@ -256,11 +256,6 @@ THE SOFTWARE.
<artifactId>remoting</artifactId>
<version>${remoting.version}</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.modules</groupId>
<artifactId>instance-identity</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.jfree</groupId>
<artifactId>jfreechart</artifactId>
Expand Down
27 changes: 15 additions & 12 deletions cli/src/main/java/hudson/cli/CLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,14 @@
import java.net.URLConnection;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.InvalidPathException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.security.GeneralSecurityException;
import java.security.KeyPair;
import java.security.SecureRandom;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.Map;
Expand All @@ -60,7 +63,6 @@
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.TrustManager;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
import org.glassfish.tyrus.client.ClientManager;
import org.glassfish.tyrus.client.ClientProperties;
Expand Down Expand Up @@ -267,7 +269,7 @@ public boolean verify(String s, SSLSession sslSession) {
}

if (args.isEmpty())
args = Collections.singletonList("help"); // default to help
args = List.of("help"); // default to help

if (mode == null) {
mode = Mode.HTTP;
Expand Down Expand Up @@ -327,7 +329,13 @@ public boolean verify(String s, SSLSession sslSession) {

@SuppressFBWarnings(value = {"PATH_TRAVERSAL_IN", "URLCONNECTION_SSRF_FD"}, justification = "User provided values for running the program.")
private static String readAuthFromFile(String auth) throws IOException {
return FileUtils.readFileToString(new File(auth.substring(1)), Charset.defaultCharset());
Path path;
try {
path = Paths.get(auth.substring(1));
} catch (InvalidPathException e) {
throw new IOException(e);
}
return Files.readString(path, Charset.defaultCharset());
}

@SuppressFBWarnings(value = {"PATH_TRAVERSAL_IN", "URLCONNECTION_SSRF_FD"}, justification = "User provided values for running the program.")
Expand All @@ -346,7 +354,7 @@ class Authenticator extends ClientEndpointConfig.Configurator {
@Override
public void beforeRequest(Map<String, List<String>> headers) {
if (factory.authorization != null) {
headers.put("Authorization", Collections.singletonList(factory.authorization));
headers.put("Authorization", List.of(factory.authorization));
}
}
}
Expand Down Expand Up @@ -483,14 +491,9 @@ synchronized int exit() throws InterruptedException {

private static String computeVersion() {
Properties props = new Properties();
try {
InputStream is = CLI.class.getResourceAsStream("/jenkins/cli/jenkins-cli-version.properties");
try (InputStream is = CLI.class.getResourceAsStream("/jenkins/cli/jenkins-cli-version.properties")) {
if (is != null) {
try {
props.load(is);
} finally {
is.close();
}
props.load(is);
}
} catch (IOException e) {
e.printStackTrace(); // if the version properties is missing, that's OK.
Expand Down
3 changes: 1 addition & 2 deletions cli/src/main/java/hudson/cli/SSHCLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import java.net.URLConnection;
import java.security.KeyPair;
import java.security.PublicKey;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.logging.Level;
Expand Down Expand Up @@ -114,7 +113,7 @@ public boolean verifyServerKey(ClientSession clientSession, SocketAddress remote
WaitableFuture wf = channel.open();
wf.await();

Set<ClientChannelEvent> waitMask = channel.waitFor(Collections.singletonList(ClientChannelEvent.CLOSED), 0L);
Set<ClientChannelEvent> waitMask = channel.waitFor(List.of(ClientChannelEvent.CLOSED), 0L);

if (waitMask.contains(ClientChannelEvent.TIMEOUT)) {
throw new SocketTimeoutException("Failed to retrieve command result in time: " + command);
Expand Down
34 changes: 17 additions & 17 deletions cli/src/main/resources/hudson/cli/client/Messages_bg.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@
# THE SOFTWARE.

CLI.Usage=\
\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u0430 \u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0438\u044f \u0440\u0435\u0434 \u043d\u0430 Jenkins\n\
\u0423\u043f\u043e\u0442\u0440\u0435\u0431\u0430: java -jar jenkins-cli.jar [-s \u0410\u0414\u0420\u0415\u0421] \u041a\u041e\u041c\u0410\u041d\u0414\u0410 [\u041e\u041f\u0426\u0418\u042f\u2026] \u0410\u0420\u0413\u0423\u041c\u0415\u041d\u0422\u2026\n\
\u041e\u043f\u0446\u0438\u0438:\n\
-s \u0410\u0414\u0420\u0415\u0421 : \u0430\u0434\u0440\u0435\u0441\u044a\u0442 \u043d\u0430 \u0441\u044a\u0440\u0432\u044a\u0440\u0430 (\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e \u0441\u0435 \u0432\u0437\u0438\u043c\u0430 \u043e\u0442 \u043f\u0440\u043e\u043c\u0435\u043d\u043b\u0438\u0432\u0430\u0442\u0430 \u043d\u0430\n\
\u0441\u0440\u0435\u0434\u0430\u0442\u0430 \u201eJENKINS_URL\u201c)\n\
-i \u041a\u041b\u042e\u0427 : \u0447\u0430\u0441\u0442\u0435\u043d \u043a\u043b\u044e\u0447 \u0437\u0430 SSH \u0437\u0430 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f\n\
-p \u0425\u041e\u0421\u0422:\u041f\u041e\u0420\u0422 : \u0445\u043e\u0441\u0442 \u0438 \u043f\u043e\u0440\u0442 \u0437\u0430 \u0441\u044a\u0440\u0432\u044a\u0440-\u043f\u043e\u0441\u0440\u0435\u0434\u043d\u0438\u043a \u043f\u043e HTTP \u0437\u0430 \u0442\u0443\u043d\u0435\u043b \u043f\u043e HTTPS.\n\
\u0417\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f: https://www.jenkins.io/redirect/cli-https-proxy-tunnel\n\
-noCertificateCheck : \u0431\u0435\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 \u0437\u0430 HTTPS (\u0412\u041d\u0418\u041c\u0410\u041d\u0418\u0415!)\n\
-noKeyAuth : \u0431\u0435\u0437 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0441 \u0447\u0430\u0441\u0442\u0435\u043d \u043a\u043b\u044e\u0447 \u0437\u0430 SSH, \u043e\u043f\u0446\u0438\u044f\u0442\u0430 \u0435\n\
\u043d\u0435\u0441\u044a\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u0430 \u0441 \u043e\u043f\u0446\u0438\u044f\u0442\u0430 \u201e-i\u201c\n\n\
\u041d\u0430\u043b\u0438\u0447\u043d\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0438 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u0432\u0435\u0440\u0441\u0438\u044f\u0442\u0430 \u043d\u0430 \u0441\u044a\u0440\u0432\u044a\u0440\u0430. \u0417\u0430 \u0438\u0437\u0432\u0435\u0436\u0434\u0430\u043d\u0435 \u043d\u0430 \u0441\u043f\u0438\u0441\u044a\u043a\u0430\n\
\u0438\u043c \u0438\u0437\u043f\u043e\u043b\u0437\u0432\u0430\u0439\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u0442\u0430 \u201ehelp\u201c.\n
Програма на командния ред на Jenkins\n\
Употреба: java -jar jenkins-cli.jar [-s АДРЕС] КОМАНДА [ОПЦИЯ…] АРГУМЕНТ…\n\
Опции:\n\
-s АДРЕС : адресът на сървъра (стандартно се взима от променливата на\n\
средата „JENKINS_URL“)\n\
-i КЛЮЧ : частен ключ за SSH за идентификация\n\
-p ХОСТ:ПОРТ : хост и порт за сървър-посредник по HTTP за тунел по HTTPS.\n\
За информация: https://www.jenkins.io/redirect/cli-https-proxy-tunnel\n\
-noCertificateCheck : без проверка на сертификата за HTTPS (ВНИМАНИЕ!)\n\
-noKeyAuth : без идентификация с частен ключ за SSH, опцията е\n\
несъвместима с опцията „-i“\n\n\
Наличните команди зависят от версията на сървъра. За извеждане на списъка\n\
им използвайте командата „help“.\n
CLI.NoURL=\
\u0410\u0434\u0440\u0435\u0441\u044a\u0442 \u043d\u0435 \u0435 \u0437\u0430\u0434\u0430\u0434\u0435\u043d \u043d\u0438\u0442\u043e \u0447\u0440\u0435\u0437 \u043e\u043f\u0446\u0438\u044f\u0442\u0430 \u201e-s\u201c, \u043d\u0438\u0442\u043e \u0447\u0440\u0435\u0437 \u043f\u0440\u043e\u043c\u0435\u043d\u043b\u0438\u0432\u0430\u0442\u0430 \u043d\u0430\
\u0441\u0440\u0435\u0434\u0430\u0442\u0430 \u201eJENKINS_URL\u201c.
Адресът не е зададен нито чрез опцията „-s“, нито чрез променливата на\
средата „JENKINS_URL“.
CLI.VersionMismatch=\
\u0412\u0435\u0440\u0441\u0438\u0438\u0442\u0435 \u043d\u0435 \u0441\u044a\u0432\u043f\u0430\u0434\u0430\u0442. \u0422\u0430\u0437\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0430 \u0437\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0435\u043d \u0440\u0435\u0434 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0438 \u0441 \u0442\u043e\u0437\u0438 \u0441\u044a\u0440\u0432\u044a\u0440\
Версиите не съвпадат. Тази програма за команден ред не работи с този сървър\
Jenkins.
CLI.NoSuchFileExists=\
\u0422\u0430\u043a\u044a\u0432 \u0444\u0430\u0439\u043b \u043d\u0435 \u0441\u044a\u0449\u0435\u0441\u0442\u0432\u0443\u0432\u0430: {0}
Такъв файл не съществува: {0}
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ CLI.VersionMismatch=Versionskonflikt. CLI''en fungerer ikke med denne Hudson ser
CLI.Usage=Jenkins_ CLI\n\
Brug: java -jar jenkins-cli.jar [-s URL] command [opts...] args...\n\
Tilvalg:\n\
De tilg\u00e6ngelige kommandoer afh\u00e6nger af serveren. K\u00f8r 'help' kommandoen for at se listen.
CLI.NoURL=Hverken -s eller JENKINS_URL milj\u00f8variablen er defineret
De tilgængelige kommandoer afhænger af serveren. Kør 'help' kommandoen for at se listen.
CLI.NoURL=Hverken -s eller JENKINS_URL miljøvariablen er defineret
10 changes: 5 additions & 5 deletions cli/src/main/resources/hudson/cli/client/Messages_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ CLI.Usage=Jenkins Kommandozeilenschnittstelle (Jenkins CLI)\n\
Verwendung: java -jar jenkins-cli.jar [-s URL] command [opts...] args...\n\
Optionen:\n\
-s URL : URL des Jenkins-Servers (Wert der Umgebungsvariable JENKINS_URL ist der Vorgabewert)\n\
-i KEY : Datei mit privatem SSH-Schl\u00FCssel zur Authentisierung\n\
-p HOST\:PORT : HTTP-Proxy-Host und -Port f\u00FCr HTTPS-Proxy-Tunnel. Siehe https://www.jenkins.io/redirect/cli-https-proxy-tunnel\n\
-noCertificateCheck : \u00DCberspringt die Zertifikatspr\u00FCfung bei HTTPS. Bitte mit Vorsicht einsetzen.\n\
-noKeyAuth : \u00DCberspringt die Authentifizierung mit einem privaten SSH-Schl\u00FCssel. Nicht kombinierbar mit -i\n\
-i KEY : Datei mit privatem SSH-Schlüssel zur Authentisierung\n\
-p HOST\:PORT : HTTP-Proxy-Host und -Port für HTTPS-Proxy-Tunnel. Siehe https://www.jenkins.io/redirect/cli-https-proxy-tunnel\n\
-noCertificateCheck : Überspringt die Zertifikatsprüfung bei HTTPS. Bitte mit Vorsicht einsetzen.\n\
-noKeyAuth : Überspringt die Authentifizierung mit einem privaten SSH-Schlüssel. Nicht kombinierbar mit -i\n\
\n\
Die verf\u00FCgbaren Kommandos h\u00E4ngen vom kontaktierten Server ab. Verwenden Sie das Kommando help, um eine Liste aller verf\u00FCgbaren Kommandos anzuzeigen.
Die verfügbaren Kommandos hängen vom kontaktierten Server ab. Verwenden Sie das Kommando help, um eine Liste aller verfügbaren Kommandos anzuzeigen.
CLI.NoURL=Weder die Option -s noch eine Umgebungsvariable JENKINS_URL wurde spezifiziert.
CLI.NoSuchFileExists=Diese Datei existiert nicht {0}
CLI.VersionMismatch=Versionskonflikt: Diese Version von Jenkins CLI ist nicht mit dem kontaktierten Jenkins-Server kompatibel.
Loading

0 comments on commit a39862c

Please sign in to comment.