Skip to content

Commit

Permalink
Use SubTask.getOwnerExecutable (#2388)
Browse files Browse the repository at this point in the history
* Use `SubTask.getOwnerExecutable`

* Update to releases

* Removing some gratuitous version overrides

* Using newest available BOM

* Restoring `InjectedTest`, deleting Animal Sniffer config obsolete as of #2379, and fixing `github` dep versions

* May as well go to 2.401.x now
  • Loading branch information
jglick authored Jul 31, 2023
1 parent d1fcf4a commit e40f92f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 63 deletions.
1 change: 1 addition & 0 deletions blueocean-pipeline-api-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-durable-task-step</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.jenkinsci.plugins.workflow.steps.FlowInterruptedException;
import org.jenkinsci.plugins.workflow.steps.StepDescriptor;
import org.jenkinsci.plugins.workflow.support.actions.PauseAction;
import org.jenkinsci.plugins.workflow.support.steps.ExecutorStep;
import org.jenkinsci.plugins.workflow.support.steps.input.InputAction;

import edu.umd.cs.findbugs.annotations.CheckForNull;
Expand Down Expand Up @@ -193,7 +192,7 @@ public static boolean isPausedForInputStep(@NonNull StepAtomNode step, @Nullable
}

/**
* Determine if the given {@link FlowNode} is the initial {@link StepStartNode} for an {@link ExecutorStep}.
* Determine if the given {@link FlowNode} is the initial {@link StepStartNode} for an {@code ExecutorStep}.
*
* @param node a possibly null {@link FlowNode}
* @return true if {@code node} is the non-body start of the agent execution.
Expand All @@ -205,7 +204,7 @@ public static boolean isAgentStart(@Nullable FlowNode node) {
if (stepStartNode.getDescriptor() != null) {
StepDescriptor sd = stepStartNode.getDescriptor();
return sd != null &&
ExecutorStep.DescriptorImpl.class.equals(sd.getClass()) &&
sd.getFunctionName().equals("node") &&
!stepStartNode.isBody();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import jenkins.scm.api.SCMRevisionAction;
import org.jenkinsci.plugins.workflow.cps.replay.ReplayAction;
import org.jenkinsci.plugins.workflow.job.WorkflowRun;
import org.jenkinsci.plugins.workflow.support.steps.ExecutorStepExecution;
import org.jenkinsci.plugins.workflow.support.steps.input.InputAction;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.export.Exported;
Expand Down Expand Up @@ -231,17 +230,13 @@ public String getCommitUrl() {
@Override
public String getCauseOfBlockage() {
for(Queue.Item i: Jenkins.get().getQueue().getItems()) {
if (i.task instanceof ExecutorStepExecution.PlaceholderTask) {
ExecutorStepExecution.PlaceholderTask task = (ExecutorStepExecution.PlaceholderTask) i.task;
Run r = task.runForDisplay();
if (r != null && r.equals(run)) {
String cause = i.getCauseOfBlockage().getShortDescription();
CauseOfBlockage causeOfBlockage = task.getCauseOfBlockage();
if ( causeOfBlockage != null) {
return causeOfBlockage.getShortDescription();
}
return cause;
if (run.equals(i.task.getOwnerExecutable())) {
String cause = i.getCauseOfBlockage().getShortDescription();
CauseOfBlockage causeOfBlockage = i.task.getCauseOfBlockage();
if (causeOfBlockage != null) {
return causeOfBlockage.getShortDescription();
}
return cause;
}
}
return null;
Expand Down
52 changes: 3 additions & 49 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@
when changing jenkins core version please remember to change it in Jenkinsfile as well jenkinsVersions
and acceptance-tests/runner/scripts/args.sh
-->
<jenkins.version>2.361.4</jenkins.version>
<jenkins.version>2.401.3</jenkins.version>

This comment has been minimized.

Copy link
@olamy

olamy Aug 3, 2023

Member

@jglick ok there it is why ATH tests are now failing with this PR just read the comment :)

This comment has been minimized.

Copy link
@olamy

olamy Aug 3, 2023

Member

fixed with 37b4c1d

<javadoc.exec.goal>javadoc-no-fork</javadoc.exec.goal> <!-- stop initialize phase plugins executing twice -->
<frontend-version>1.12.0</frontend-version>
<node.version>10.13.0</node.version>
<npm.version>6.14.4</npm.version>
<hamcrest.version>2.2</hamcrest.version>
<mockito.version>4.7.0</mockito.version>
<jacoco.version>0.8.6</jacoco.version>
<jacoco.haltOnFailure>false</jacoco.haltOnFailure>
Expand Down Expand Up @@ -190,7 +189,6 @@
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.15</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -208,25 +206,6 @@
<artifactId>mockito-inline</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<version>${hamcrest.version}</version>
<scope>test</scope>
</dependency>
<!-- This is needed in order to force junit4 and JTH tests to use newer hamcrest version -->
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<version>${hamcrest.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.mashape.unirest</groupId>
<artifactId>unirest-java</artifactId>
Expand All @@ -252,18 +231,12 @@

<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.361.x</artifactId>
<artifactId>bom-2.401.x</artifactId>
<version>2102.v854b_fec19c92</version>
<scope>import</scope>
<type>pom</type>
</dependency>

<dependency>
<groupId>org.jenkins-ci</groupId>
<artifactId>symbol-annotation</artifactId>
<version>1.23</version>
</dependency>

<!-- Module versions -->
<dependency>
<groupId>${project.groupId}</groupId>
Expand Down Expand Up @@ -712,26 +685,7 @@
</plugins>
</pluginManagement>
<plugins>
<plugin>
<!-- TODO: java8 signature doesn't exist yet -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<version>1.22</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<!-- Disable InjectedTest -->
<plugin>
<groupId>org.jenkins-ci.tools</groupId>
<artifactId>maven-hpi-plugin</artifactId>
<configuration>
<disabledTestInjection>true</disabledTestInjection>
<dependencyResolution>${hpi.dependencyResolution}</dependencyResolution>
</configuration>
</plugin>

<plugin>
<plugin> <!-- TODO could probably all be deleted -->
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<reuseForks>true</reuseForks>
Expand Down

0 comments on commit e40f92f

Please sign in to comment.