Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…e-task-step-plugin into retry-JENKINS-49707
  • Loading branch information
jglick committed Apr 28, 2022
2 parents 75b2375 + 8fd69d0 commit 79d4ff0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ jobs:
if: needs.validate.outputs.should_release == 'true'
steps:
- name: Check out
uses: actions/checkout@v2.4.0
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 8
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'adopt'
distribution: 'temurin'
java-version: 8
- name: Release
uses: jenkins-infra/[email protected]
Expand Down
7 changes: 3 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.37</version>
<version>4.40</version>
<relativePath />
</parent>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
Expand All @@ -47,7 +47,7 @@
</license>
</licenses>
<scm>
<connection>scm:git:git://github.com/${gitHubRepo}.git</connection>
<connection>scm:git:https://github.com/${gitHubRepo}.git</connection>
<developerConnection>scm:git:[email protected]:${gitHubRepo}.git</developerConnection>
<url>https://github.com/${gitHubRepo}</url>
<tag>${scmTag}</tag>
Expand All @@ -67,7 +67,6 @@
<properties>
<changelist>999999-SNAPSHOT</changelist>
<jenkins.version>2.303.3</jenkins.version>
<java.level>8</java.level>
<useBeta>true</useBeta>
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
<hpi.compatibleSinceVersion>2.40</hpi.compatibleSinceVersion>
Expand All @@ -77,7 +76,7 @@
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.303.x</artifactId>
<version>1198.v387c834fca_1a_</version>
<version>1289.v5c4b_1c43511b_</version>
<scope>import</scope>
<type>pom</type>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,11 @@ private static class HandlerImpl extends Handler {
// Defined in Java Platform and protected, so should not happen.
throw new ExceptionInInitializerError(x);
}
printStreamDelegate.setAccessible(true);
try {
printStreamDelegate.setAccessible(true);
} catch (/* TODO Java 11+ InaccessibleObjectException */RuntimeException x) {
LOGGER.log(Level.WARNING, "On Java 17 error handling is degraded unless `--add-opens java.base/java.io=ALL-UNNAMED` is passed to the agent", x);
}
}

private static final long serialVersionUID = 1L;
Expand All @@ -720,7 +724,12 @@ private static class HandlerImpl extends Handler {
try {
if (ps.getClass() == PrintStream.class) {
// Try to extract the underlying stream, since swallowing exceptions is undesirable and PrintStream.checkError is useless.
OutputStream os = (OutputStream) printStreamDelegate.get(ps);
OutputStream os = ps;
try {
os = (OutputStream) printStreamDelegate.get(ps);
} catch (IllegalAccessException x) {
LOGGER.log(Level.FINE, "using PrintStream rather than underlying FilterOutputStream.out", x);
}
if (os == null) { // like PrintStream.ensureOpen
throw new IOException("Stream closed");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,14 +396,17 @@ private static class Decorator extends LauncherDecorator implements Serializable

@Issue("JENKINS-38381")
@Test public void remoteLogger() throws Exception {
logging.record(DurableTaskStep.class, Level.FINE).record(FileMonitoringTask.class, Level.FINE);
DurableTaskStep.USE_WATCHING = true;
assumeFalse(Functions.isWindows()); // TODO create Windows equivalent
final String credentialsId = "creds";
final String username = "bob";
final String password = "s3cr3t";
UsernamePasswordCredentialsImpl c = new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, credentialsId, "sample", username, password);
CredentialsProvider.lookupStores(j.jenkins).iterator().next().addCredentials(Domain.global(), c);
j.createSlave("remote", null, null);
DumbSlave s = j.createSlave("remote", null, null);
j.waitOnline(s);
j.showAgentLogs(s, logging);
WorkflowJob p = j.jenkins.createProject(WorkflowJob.class, "p");
String builtInNodeLabel = j.jenkins.getSelfLabel().getName(); // compatibility with 2.307+
p.setDefinition(new CpsFlowDefinition(
Expand Down

0 comments on commit 79d4ff0

Please sign in to comment.