Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use SubTask.getOwnerExecutable #2388

Merged
merged 8 commits into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implies a corresponding change in jenkinsci/bom/bom-2.387.x/pom.xml: jenkinsci/bom#2395

<jenkins.version>2.401.3</jenkins.version>
<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>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see #2444

<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
Loading