Skip to content

Commit

Permalink
Merge branch 'master' into tippy-1-tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Mar 17, 2022
2 parents 7223890 + 422efe9 commit 22f300a
Show file tree
Hide file tree
Showing 63 changed files with 674 additions and 639 deletions.
2 changes: 0 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ updates:
# Must remain within jetty 9.x until Java 8 support is removed, ignore jetty 10.x and jetty 11.x updates
- dependency-name: "org.eclipse.jetty:jetty-maven-plugin"
versions: [">=10.0.0"]
# Pending https://github.com/siom79/japicmp/pull/266
- dependency-name: "com.github.siom79.japicmp:japicmp-maven-plugin"
# Winstone upgrades require multiple changes in pom.xml. See https://github.com/jenkinsci/jenkins/pull/5439#discussion_r616418468
- dependency-name: "org.jenkins-ci:winstone"
# Starting with version 10.0, this library requires Java 11
Expand Down
11 changes: 0 additions & 11 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ for (i = 0; i < buildTypes.size(); i++) {
realtimeJUnit(healthScaleFactor: 20.0, testResults: '*/target/surefire-reports/*.xml,war/junit.xml') {
def mavenOptions = [
'-Pdebug',
'-Pjapicmp',
'--update-snapshots',
"-Dmaven.repo.local=$m2repo",
'-Dmaven.test.failure.ignore',
Expand Down Expand Up @@ -128,16 +127,6 @@ for (i = 0; i < buildTypes.size(); i++) {
fingerprint: true
)
}
publishHTML([
allowMissing: true,
alwaysLinkToLastBuild: false,
includes: 'japicmp.html',
keepAll: false,
reportDir: 'core/target/japicmp',
reportFiles: 'japicmp.html',
reportName: 'API compatibility',
reportTitles: 'japicmp report',
])
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion 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.2</asm.version>
<slf4jVersion>1.7.36</slf4jVersion>
<stapler.version>1642.ve454c4518974</stapler.version>
<stapler.version>1666.v0275e61a_9874</stapler.version>
<groovy.version>2.4.21</groovy.version>
</properties>

Expand Down
38 changes: 0 additions & 38 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -818,43 +818,5 @@ THE SOFTWARE.
<maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
</properties>
</profile>
<profile>
<id>japicmp</id>
<build>
<plugins>
<plugin>
<groupId>com.github.siom79.japicmp</groupId>
<artifactId>japicmp-maven-plugin</artifactId>
<!-- TODO https://github.com/siom79/japicmp/pull/266 -->
<version>0.14.4-20200728.214757-1</version>
<configuration>
<parameter>
<!-- see https://siom79.github.io/japicmp/MavenPlugin.html -->
<oldVersionPattern>\d+[.]\d+</oldVersionPattern>
<!-- <onlyModified>true</onlyModified> -->
<onlyBinaryIncompatible>true</onlyBinaryIncompatible>
</parameter>
<oldClassPathDependencies>
<dependency>
<!-- provided, so not visible in flattened artifact -->
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
</oldClassPathDependencies>
</configuration>
<executions>
<execution>
<goals>
<goal>cmp</goal>
</goals>
<phase>verify</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
35 changes: 30 additions & 5 deletions core/src/main/java/hudson/cli/CLICommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.io.UncheckedIOException;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Type;
Expand Down Expand Up @@ -406,8 +407,16 @@ protected void printUsage(PrintStream stderr, CmdLineParser p) {
public final String getSingleLineSummary() {
ByteArrayOutputStream out = new ByteArrayOutputStream();
getCmdLineParser().printSingleLineUsage(out);
Charset charset;
try {
return out.toString(getClientCharset().name());
charset = getClientCharset();
} catch (IOException e) {
throw new UncheckedIOException(e);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
try {
return out.toString(charset.name());
} catch (UnsupportedEncodingException e) {
throw new AssertionError(e);
}
Expand All @@ -420,8 +429,16 @@ public final String getSingleLineSummary() {
public final String getUsage() {
ByteArrayOutputStream out = new ByteArrayOutputStream();
getCmdLineParser().printUsage(out);
Charset charset;
try {
return out.toString(getClientCharset().name());
charset = getClientCharset();
} catch (IOException e) {
throw new UncheckedIOException(e);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
try {
return out.toString(charset.name());
} catch (UnsupportedEncodingException e) {
throw new AssertionError(e);
}
Expand All @@ -433,17 +450,25 @@ public final String getUsage() {
@Restricted(NoExternalUse.class)
public final String getLongDescription() {
ByteArrayOutputStream out = new ByteArrayOutputStream();
Charset charset;
try {
charset = getClientCharset();
} catch (IOException e) {
throw new UncheckedIOException(e);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
PrintStream ps;
try {
ps = new PrintStream(out, false, getClientCharset().name());
ps = new PrintStream(out, false, charset.name());
} catch (UnsupportedEncodingException e) {
throw new AssertionError(e);
}

printUsageSummary(ps);
ps.close();
try {
return out.toString(getClientCharset().name());
return out.toString(charset.name());
} catch (UnsupportedEncodingException e) {
throw new AssertionError(e);
}
Expand Down Expand Up @@ -476,7 +501,7 @@ public void setClientCharset(@NonNull Charset encoding) {
this.encoding = encoding;
}

protected @NonNull Charset getClientCharset() {
protected @NonNull Charset getClientCharset() throws IOException, InterruptedException {
if (encoding != null) {
return encoding;
}
Expand Down
13 changes: 12 additions & 1 deletion core/src/main/java/hudson/cli/GroovyshCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@
import groovy.lang.Closure;
import hudson.Extension;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.UncheckedIOException;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
import jenkins.model.Jenkins;
Expand Down Expand Up @@ -85,7 +88,15 @@ protected Groovysh createShell(InputStream stdin, PrintStream stdout,

Binding binding = new Binding();
// redirect "println" to the CLI
binding.setProperty("out", new PrintWriter(new OutputStreamWriter(stdout, getClientCharset()), true));
Charset charset;
try {
charset = getClientCharset();
} catch (IOException e) {
throw new UncheckedIOException(e);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
binding.setProperty("out", new PrintWriter(new OutputStreamWriter(stdout, charset), true));
binding.setProperty("hudson", Jenkins.get()); // backward compatibility
binding.setProperty("jenkins", Jenkins.get());

Expand Down
12 changes: 11 additions & 1 deletion core/src/main/java/hudson/cli/ListChangesCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.UncheckedIOException;
import java.nio.charset.Charset;
import java.util.List;
import jenkins.scm.RunWithSCM;
import org.kohsuke.accmod.Restricted;
Expand Down Expand Up @@ -47,7 +49,15 @@ protected int act(List<Run<?, ?>> builds) throws IOException {
// No other permission check needed.
switch (format) {
case XML:
PrintWriter w = new PrintWriter(new OutputStreamWriter(stdout, getClientCharset()));
Charset charset;
try {
charset = getClientCharset();
} catch (IOException e) {
throw new UncheckedIOException(e);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
PrintWriter w = new PrintWriter(new OutputStreamWriter(stdout, charset));
w.println("<changes>");
for (Run<?, ?> build : builds) {
if (build instanceof RunWithSCM) {
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/console/ModelHyperlinkNote.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public ModelHyperlinkNote(String url, int length) {

@Override
protected String extraAttributes() {
return " class='model-link'";
return " class='model-link model-link--float'";
}

public static String encodeTo(@NonNull User u) {
Expand Down
25 changes: 21 additions & 4 deletions core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,18 @@ public ContextMenu add(String url, String icon, String iconXml, String text, boo
@Restricted(DoNotUse.class) // manage.jelly only
public ContextMenu addHeader(String title) {
final MenuItem item = new MenuItem().withDisplayName(title);
item.header = true;
item.type = MenuItemType.HEADER;
return add(item);
}

/**
* Add a separator row (no icon, no URL, no text).
*
* @since TODO - Provide version
*/
public ContextMenu addSeparator() {
final MenuItem item = new MenuItem();
item.type = MenuItemType.SEPARATOR;
return add(item);
}

Expand Down Expand Up @@ -303,12 +314,12 @@ class MenuItem {


/**
* True to display this item as a section header.
* @since 2.231
* The type of menu item
* @since TODO
*/
@Exported
@SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD", justification = "read by Stapler")
public boolean header;
public MenuItemType type = MenuItemType.ITEM;

/**
* If this is a submenu, definition of subitems.
Expand Down Expand Up @@ -388,6 +399,12 @@ private String getResourceUrl() {

}

enum MenuItemType {
ITEM,
HEADER,
SEPARATOR
}

/**
* Allows an action to decide whether it will be visible in a context menu.
* @since 1.538
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

started_by_project=Started by upstream project <a class="model-link inside" href="{3}/{2}">{0}</a> build number <a class="model-link inside" href="{3}/{2}{1}/">{1}</a>
started_by_project_with_deleted_build=Started by upstream project <a class="model-link inside" href="{3}/{2}">{0}</a> build number {1}
started_by_project=Started by upstream project <a class="model-link model-link--float" href="{3}/{2}">{0}</a> build number <a class="model-link model-link--float" href="{3}/{2}{1}/">{1}</a>
started_by_project_with_deleted_build=Started by upstream project <a class="model-link model-link--float" href="{3}/{2}">{0}</a> build number {1}
caused_by=originally caused by:
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@

started_by_project_with_deleted_build=\
\u0421\u0442\u0430\u0440\u0442\u0438\u0440\u0430\u043d\u043e \u0437\u0430\u0440\u0430\u0434\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043e\u0442 \u043a\u043e\u0439\u0442\u043e \u0442\u043e\u0437\u0438 \u0437\u0430\u0432\u0438\u0441\u0438:\
<a class="model-link inside" href="{3}/{2}">{0}</a>, \u0438\u0437\u0433\u0440\u0430\u0436\u0434\u0430\u043d\u0435 \u2116\u200a{1}
<a class="model-link model-link--float" href="{3}/{2}">{0}</a>, \u0438\u0437\u0433\u0440\u0430\u0436\u0434\u0430\u043d\u0435 \u2116\u200a{1}
caused_by=\
\u043f\u044a\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u043d\u043e \u0441\u0442\u0430\u0440\u0442\u0438\u0440\u0430\u043d\u043e \u043f\u043e\u0440\u0430\u0434\u0438:
started_by_project=\
\u0421\u0442\u0430\u0440\u0442\u0438\u0440\u0430\u043d\u043e \u0437\u0430\u0440\u0430\u0434\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043e\u0442 \u043a\u043e\u0439\u0442\u043e \u0442\u043e\u0437\u0438 \u0437\u0430\u0432\u0438\u0441\u0438:\
<a class="model-link inside" href="{3}/{2}">{0}</a>, \u0438\u0437\u0433\u0440\u0430\u0436\u0434\u0430\u043d\u0435\
\u2116\u200a<a class="model-link inside" href="{3}/{2}{1}/">{1}</a>
<a class="model-link model-link--float" href="{3}/{2}">{0}</a>, \u0438\u0437\u0433\u0440\u0430\u0436\u0434\u0430\u043d\u0435\
\u2116\u200a<a class="model-link model-link--float" href="{3}/{2}{1}/">{1}</a>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is under the MIT License by authors

started_by_project=Spu\u0161t\u011Bno nad\u0159azen\u00FDm projektem <a class="model-link inside" href="{3}/{2}">{0}</a> build \u010D\u00EDslo <a class="model-link inside" href="{3}/{2}{1}/">{1}</a>
started_by_project_with_deleted_build=Spu\u0161t\u011Bno nad\u0159azen\u00FDm projektem <a class="model-link inside" href="{3}/{2}">{0}</a> build \u010D\u00EDslo {1}
started_by_project=Spu\u0161t\u011Bno nad\u0159azen\u00FDm projektem <a class="model-link model-link--float" href="{3}/{2}">{0}</a> build \u010D\u00EDslo <a class="model-link model-link--float" href="{3}/{2}{1}/">{1}</a>
started_by_project_with_deleted_build=Spu\u0161t\u011Bno nad\u0159azen\u00FDm projektem <a class="model-link model-link--float" href="{3}/{2}">{0}</a> build \u010D\u00EDslo {1}
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

started_by_project=Startet af upstream projekt <a class="model-link inside" href="{3}/{2}">{0}</a> byg nummer <a class="model-link inside" href="{3}/{2}{1}/">{1}</a>
started_by_project_with_deleted_build=Startet af upstream projekt <a class="model-link inside" href="{3}/{2}">{0}</a> byg nummer {1}
started_by_project=Startet af upstream projekt <a class="model-link model-link--float" href="{3}/{2}">{0}</a> byg nummer <a class="model-link model-link--float" href="{3}/{2}{1}/">{1}</a>
started_by_project_with_deleted_build=Startet af upstream projekt <a class="model-link model-link--float" href="{3}/{2}">{0}</a> byg nummer {1}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
# THE SOFTWARE.

caused_by=urspr\u00FCnglich ausgel\u00F6st durch:
started_by_project=Gestartet durch vorgelagertes Projekt <a class="model-link inside" href="{3}/{2}">{0}</a>, Build <a class="model-link inside" href="{3}/{2}{1}/">{1}</a>
started_by_project_with_deleted_build=Gestartet durch vorgelagertes Projekt <a class="model-link inside" href="{3}/{2}">{0}</a>, Build {1}
started_by_project=Gestartet durch vorgelagertes Projekt <a class="model-link model-link--float" href="{3}/{2}">{0}</a>, Build <a class="model-link model-link--float" href="{3}/{2}{1}/">{1}</a>
started_by_project_with_deleted_build=Gestartet durch vorgelagertes Projekt <a class="model-link model-link--float" href="{3}/{2}">{0}</a>, Build {1}

Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@
# THE SOFTWARE.


started_by_project=Lanzado por la ejecuci\u00F3n n\u00FAmero <a class="model-link inside" href\="{3}/{2}{1}/">{1}</a> del proyecto padre\: <a class="model-link inside" href\="{3}/{2}">{0}</a>
started_by_project_with_deleted_build=Lanzado por la ejecuci\u00F3n n\u00FAmero {1} del proyecto padre\: <a class="model-link inside" href\="{3}/{2}">{0}</a>
started_by_project=Lanzado por la ejecuci\u00F3n n\u00FAmero <a class="model-link model-link--float" href\="{3}/{2}{1}/">{1}</a> del proyecto padre\: <a class="model-link model-link--float" href\="{3}/{2}">{0}</a>
started_by_project_with_deleted_build=Lanzado por la ejecuci\u00F3n n\u00FAmero {1} del proyecto padre\: <a class="model-link model-link--float" href\="{3}/{2}">{0}</a>
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

started_by_project=K\u00E4ynnist\u00E4j\u00E4 yl\u00E4virran projekti <a class="model-link inside" href="{3}/{2}">{0}</a> k\u00E4\u00E4nn\u00F6snumero <a class="model-link inside" href="{3}/{2}{1}/">{1}</a>
started_by_project_with_deleted_build=K\u00E4ynnist\u00E4j\u00E4 yl\u00E4virran projekti <a class="model-link inside" href="{3}/{2}">{0}</a> k\u00E4\u00E4nn\u00F6snumero {1}
started_by_project=K\u00E4ynnist\u00E4j\u00E4 yl\u00E4virran projekti <a class="model-link model-link--float" href="{3}/{2}">{0}</a> k\u00E4\u00E4nn\u00F6snumero <a class="model-link model-link--float" href="{3}/{2}{1}/">{1}</a>
started_by_project_with_deleted_build=K\u00E4ynnist\u00E4j\u00E4 yl\u00E4virran projekti <a class="model-link model-link--float" href="{3}/{2}">{0}</a> k\u00E4\u00E4nn\u00F6snumero {1}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
# THE SOFTWARE.

caused_by=Originellement lanc\u00E9 par:
started_by_project=Lanc\u00E9 par le projet amont <a class="model-link inside" href="{3}/{2}">{0}</a> avec le num\u00E9ro de construction <a class="model-link inside" href="{3}/{2}{1}/">{1}</a>
started_by_project_with_deleted_build=Lanc\u00E9 par le projet amont <a class="model-link inside" href="{3}/{2}">{0}</a> avec le num\u00E9ro de construction {1}
started_by_project=Lanc\u00E9 par le projet amont <a class="model-link model-link--float" href="{3}/{2}">{0}</a> avec le num\u00E9ro de construction <a class="model-link model-link--float" href="{3}/{2}{1}/">{1}</a>
started_by_project_with_deleted_build=Lanc\u00E9 par le projet amont <a class="model-link model-link--float" href="{3}/{2}">{0}</a> avec le num\u00E9ro de construction {1}

Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
# THE SOFTWARE.

caused_by=originariamente scatenata da:
started_by_project=Avviata dal progetto upstream <a class="model-link inside" \
href="{3}/{2}">{0}</a>, compilazione numero <a class="model-link inside" \
started_by_project=Avviata dal progetto upstream <a class="model-link model-link--float" \
href="{3}/{2}">{0}</a>, compilazione numero <a class="model-link model-link--float" \
href="{3}/{2}{1}/">{1}</a>
started_by_project_with_deleted_build=Avviata dal progetto upstream <a \
class="model-link inside" href="{3}/{2}">{0}</a>, compilazione numero {1}
class="model-link model-link--float" href="{3}/{2}">{0}</a>, compilazione numero {1}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

started_by_project=\u4e0a\u6d41\u30d7\u30ed\u30b8\u30a7\u30af\u30c8<a class="model-link inside" href="{3}/{2}">{0}</a>\u306e#<a class="model-link inside" href="{3}/{2}{1}/">{1}</a>\u304c\u5b9f\u884c
started_by_project_with_deleted_build=\u4e0a\u6d41\u30d7\u30ed\u30b8\u30a7\u30af\u30c8<a class="model-link inside" href="{3}/{2}">{0}</a>\u306e#{1}\u304c\u5b9f\u884c
started_by_project=\u4e0a\u6d41\u30d7\u30ed\u30b8\u30a7\u30af\u30c8<a class="model-link model-link--float" href="{3}/{2}">{0}</a>\u306e#<a class="model-link model-link--float" href="{3}/{2}{1}/">{1}</a>\u304c\u5b9f\u884c
started_by_project_with_deleted_build=\u4e0a\u6d41\u30d7\u30ed\u30b8\u30a7\u30af\u30c8<a class="model-link model-link--float" href="{3}/{2}">{0}</a>\u306e#{1}\u304c\u5b9f\u884c
caused_by=\u5143\u306e\u539f\u56e0:
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is under the MIT License by authors

caused_by=s\u0101kotn\u0113ji izrais\u012Bjis:
started_by_project=S\u0101kts no aug\u0161upstraumes projekta <a class="model-link inside" href="{3}/{2}">{0}</a> b\u016Bv\u0113juma <a class="model-link inside" href="{3}/{2}{1}/">{1}</a>
started_by_project_with_deleted_build=S\u0101kts no aug\u0161upstraumes projekta <a class="model-link inside" href="{3}/{2}">{0}</a> b\u016Bv\u0113juma {1}
started_by_project=S\u0101kts no aug\u0161upstraumes projekta <a class="model-link model-link--float" href="{3}/{2}">{0}</a> b\u016Bv\u0113juma <a class="model-link model-link--float" href="{3}/{2}{1}/">{1}</a>
started_by_project_with_deleted_build=S\u0101kts no aug\u0161upstraumes projekta <a class="model-link model-link--float" href="{3}/{2}">{0}</a> b\u016Bv\u0113juma {1}
Loading

0 comments on commit 22f300a

Please sign in to comment.